From c2bc5b221aeb3c579b5f568a021b49fbe7545bbf Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Tue, 29 Sep 2026 21:08:25 +0200 Subject: [PATCH] ViewModels: Use partial properties --- Elwig/ViewModels/AreaComAdminViewModel.cs | 46 ++--- Elwig/ViewModels/DeliveryAdminViewModel.cs | 128 ++++++------- .../ViewModels/DeliveryAncmtAdminViewModel.cs | 54 +++--- .../DeliveryScheduleAdminViewModel.cs | 48 ++--- Elwig/ViewModels/MemberAdminViewModel.cs | 178 +++++++++--------- .../MemberBusinessSharesViewModel.cs | 38 ++-- Elwig/ViewModels/PaymentVariantsViewModel.cs | 70 +++---- 7 files changed, 281 insertions(+), 281 deletions(-) diff --git a/Elwig/ViewModels/AreaComAdminViewModel.cs b/Elwig/ViewModels/AreaComAdminViewModel.cs index 151486a..b20cb23 100644 --- a/Elwig/ViewModels/AreaComAdminViewModel.cs +++ b/Elwig/ViewModels/AreaComAdminViewModel.cs @@ -8,94 +8,94 @@ namespace Elwig.ViewModels { public partial class AreaComAdminViewModel : ObservableObject { [ObservableProperty] - private string _title = "Flächenbindungen - Elwig"; + public partial string Title { get; set; } = "Flächenbindungen - Elwig"; public required Member FilterMember { get; set; } [ObservableProperty] - private string? _searchQuery = ""; + public partial string? SearchQuery { get; set; } = ""; public List TextFilter { get => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []]; set => SearchQuery = string.Join(' ', value.Where(e => e.Length > 0)); } [ObservableProperty] - private string? _filterSeasonString; + public partial string? FilterSeasonString { get; set; } public int? FilterSeason { get => int.TryParse(FilterSeasonString, out var year) ? year : null; set => FilterSeasonString = $"{value}"; } [ObservableProperty] - private string? _fbNrString; + public partial string? FbNrString { get; set; } public int? FbNr { get => int.TryParse(FbNrString, out var mgnr) ? mgnr : null; set => FbNrString = $"{value}"; } [ObservableProperty] - private string? _mgNrString; + public partial string? MgNrString { get; set; } public int? MgNr { get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null; set => MgNrString = $"{value}"; } [ObservableProperty] - private string? _yearFromString; + public partial string? YearFromString { get; set; } public int? YearFrom { get => int.TryParse(YearFromString, out var year) ? year : null; set => YearFromString = $"{value}"; } [ObservableProperty] - private string? _yearToString; + public partial string? YearToString { get; set; } public int? YearTo { get => int.TryParse(YearToString, out var year) ? year : null; set => YearToString = $"{value}"; } [ObservableProperty] - private string? _period; + public partial string? Period { get; set; } [ObservableProperty] - private AreaComType? _areaComType; + public partial AreaComType? AreaComType { get; set; } [ObservableProperty] - private IEnumerable _areaComTypeSource = []; + public partial IEnumerable AreaComTypeSource { get; set; } = []; [ObservableProperty] - private object? _wineCultObj; + public partial object? WineCultObj { get; set; } public WineCult? WineCult { get => WineCultObj as WineCult; set => WineCultObj = value ?? WineCultSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _wineCultSource = []; + public partial IEnumerable WineCultSource { get; set; } = []; [ObservableProperty] - private string? _comment; + public partial string? Comment { get; set; } [ObservableProperty] - private AT_Kg? _kg; + public partial AT_Kg? Kg { get; set; } [ObservableProperty] - private IEnumerable _kgSource = []; + public partial IEnumerable KgSource { get; set; } = []; [ObservableProperty] - private object? _rdObj; + public partial object? RdObj { get; set; } public WbRd? Rd { get => RdObj as WbRd; set => RdObj = value ?? RdSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _rdSource = []; + public partial IEnumerable RdSource { get; set; } = []; [ObservableProperty] - private string? _gstNr; + public partial string? GstNr { get; set; } [ObservableProperty] - private string? _areaString; + public partial string? AreaString { get; set; } public int? Area { get => int.TryParse(AreaString, out var area) ? area : null; set => AreaString = $"{value}"; } [ObservableProperty] - private string _statusAreaCommitments = "-"; + public partial string StatusAreaCommitments { get; set; } = "-"; [ObservableProperty] - private string _statusContracts = "-"; + public partial string StatusContracts { get; set; } = "-"; [ObservableProperty] - private string _statusArea = "-"; + public partial string StatusArea { get; set; } = "-"; [ObservableProperty] - private Grid? _statusAreaToolTip; + public partial Grid? StatusAreaToolTip { get; set; } } } diff --git a/Elwig/ViewModels/DeliveryAdminViewModel.cs b/Elwig/ViewModels/DeliveryAdminViewModel.cs index 16c0765..f3c4640 100644 --- a/Elwig/ViewModels/DeliveryAdminViewModel.cs +++ b/Elwig/ViewModels/DeliveryAdminViewModel.cs @@ -9,175 +9,175 @@ using System.Windows.Controls; namespace Elwig.ViewModels { public partial class DeliveryAdminViewModel : ObservableObject { - public bool IsReceipt = false; + public bool IsReceipt { get; set; } = false; [ObservableProperty] - private string _title = "Lieferungen - Elwig"; + public partial string Title { get; set; } = "Lieferungen - Elwig"; public Member? FilterMember { get; set; } [ObservableProperty] - private string? _searchQuery = ""; + public partial string? SearchQuery { get; set; } = ""; public List TextFilter => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []]; [ObservableProperty] - private string? _lastScaleError; + public partial string? LastScaleError { get; set; } [ObservableProperty] - private string? _manualWeighingReason; + public partial string? ManualWeighingReason { get; set; } [ObservableProperty] - private string? _scaleTerminalId; + public partial string? ScaleTerminalId { get; set; } [ObservableProperty] - private string? _weighingData; + public partial string? WeighingData { get; set; } [ObservableProperty] - private bool _filterTodayOnly; + public partial bool FilterTodayOnly { get; set; } [ObservableProperty] - private bool _filterAllSeasons; + public partial bool FilterAllSeasons { get; set; } [ObservableProperty] - private bool _enableAllSeasons; + public partial bool EnableAllSeasons { get; set; } [ObservableProperty] - private string? _filterSeasonString; + public partial string? FilterSeasonString { get; set; } public int? FilterSeason { get => int.TryParse(FilterSeasonString, out var year) ? year : null; set => FilterSeasonString = $"{value}"; } [ObservableProperty] - private Delivery? _selectedDelivery; + public partial Delivery? SelectedDelivery { get; set; } [ObservableProperty] - private IEnumerable _deliveries = []; + public partial IEnumerable Deliveries { get; set; } = []; [ObservableProperty] - private string? _mgNrString; + public partial string? MgNrString { get; set; } public int? MgNr { get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null; set => MgNrString = $"{value}"; } [ObservableProperty] - private Member? _member; + public partial Member? Member { get; set; } [ObservableProperty] - private IEnumerable _memberSource = []; + public partial IEnumerable MemberSource { get; set; } = []; [ObservableProperty] - private string? _memberAddress; + public partial string? MemberAddress { get; set; } [ObservableProperty] - private string? _lsNr; + public partial string? LsNr { get; set; } [ObservableProperty] - private string? _date; + public partial string? Date { get; set; } [ObservableProperty] - private string? _time; + public partial string? Time { get; set; } [ObservableProperty] - private Branch? _branch; + public partial Branch? Branch { get; set; } [ObservableProperty] - private IEnumerable _branchSource = []; + public partial IEnumerable BranchSource { get; set; } = []; [ObservableProperty] - private string? _comment; + public partial string? Comment { get; set; } [ObservableProperty] - private string? _sortId; + public partial string? SortId { get; set; } [ObservableProperty] - private WineVar? _wineVar; + public partial WineVar? WineVar { get; set; } [ObservableProperty] - private IEnumerable _wineVarSource = []; + public partial IEnumerable WineVarSource { get; set; } = []; [ObservableProperty] - private object? _wineAttrObj; + public partial object? WineAttrObj { get; set; } public WineAttr? WineAttr { get => WineAttrObj as WineAttr; set => WineAttrObj = value ?? WineAttrSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _wineAttrSource = []; + public partial IEnumerable WineAttrSource { get; set; } = []; [ObservableProperty] - private object? _wineCultObj; + public partial object? WineCultObj { get; set; } public WineCult? WineCult { get => WineCultObj as WineCult; set => WineCultObj = value ?? WineCultSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _wineCultSource = []; + public partial IEnumerable WineCultSource { get; set; } = []; [ObservableProperty] - private string? _gradationOeString; + public partial string? GradationOeString { get; set; } public double? GradationOe { get => double.TryParse(GradationOeString, out var oe) ? oe : null; set => GradationOeString = $"{value:0}"; } [ObservableProperty] - private string? _gradationKmwString; + public partial string? GradationKmwString { get; set; } public double? GradationKmw { get => double.TryParse(GradationKmwString, out var kmw) ? kmw : null; set => GradationKmwString = $"{value:0.0}"; } [ObservableProperty] - private WineQualLevel? _wineQualityLevel; + public partial WineQualLevel? WineQualityLevel { get; set; } [ObservableProperty] - private IEnumerable _wineQualityLevelSource = []; + public partial IEnumerable WineQualityLevelSource { get; set; } = []; [ObservableProperty] - private bool _abgewertet; + public partial bool Abgewertet { get; set; } [ObservableProperty] - private string? _weightString; + public partial string? WeightString { get; set; } public int? Weight { get => int.TryParse(WeightString?.Replace(Utils.GroupSeparator, ""), out var w) ? w : null; set => WeightString = $"{value:N0}"; } [ObservableProperty] - private string? _tareString = "-"; + public partial string? TareString { get; set; } = "-"; public int? Tare { get => int.TryParse(TareString?.Replace(Utils.GroupSeparator, "").Replace(" kg", ""), out var w) ? w : null; set => TareString = value == null ? "-" : $"{value:N0} kg{(TargetTare != null ? "*" : "")}"; } - public int? ActualTare; - public int? TargetTare; + public int? ActualTare { get; set; } + public int? TargetTare { get; set; } [ObservableProperty] - private bool _isManualWeighing; + public partial bool IsManualWeighing { get; set; } [ObservableProperty] - private bool? _isNetWeightValue = false; + public partial bool? IsNetWeightValue { get; set; } = false; public bool IsNetWeight { get => IsNetWeightValue ?? false; set => IsNetWeightValue = value; } [ObservableProperty] - private WineOrigin? _wineOrigin; + public partial WineOrigin? WineOrigin { get; set; } [ObservableProperty] - private IEnumerable _wineOriginSource = []; + public partial IEnumerable WineOriginSource { get; set; } = []; [ObservableProperty] - private object? _wineKgObj; + public partial object? WineKgObj { get; set; } public AT_Kg? WineKg { get => WineKgObj as AT_Kg; set => WineKgObj = value ?? WineKgSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _wineKgSource = []; + public partial IEnumerable WineKgSource { get; set; } = []; [ObservableProperty] - private object? _wineRdObj; + public partial object? WineRdObj { get; set; } public WbRd? WineRd { get => WineRdObj as WbRd; set => WineRdObj = value ?? WineRdSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _wineRdSource = []; + public partial IEnumerable WineRdSource { get; set; } = []; [ObservableProperty] - private bool? _isGebunden; + public partial bool? IsGebunden { get; set; } public ObservableCollection Modifiers { get; set; } = []; [ObservableProperty] - private IEnumerable _modifiersSource = []; + public partial IEnumerable ModifiersSource { get; set; } = []; [ObservableProperty] - private string? _partComment; + public partial string? PartComment { get; set; } [ObservableProperty] - private string? _temperatureString; + public partial string? TemperatureString { get; set; } public double? Temperature { get => double.TryParse(TemperatureString, out var t) ? t : null; set => TemperatureString = $"{value:0.0}"; } [ObservableProperty] - private string? _acidString; + public partial string? AcidString { get; set; } public double? Acid { get => double.TryParse(AcidString, out var a) ? a : null; set => AcidString = $"{value:0.0}"; } [ObservableProperty] - private bool? _isHandPicked; + public partial bool? IsHandPicked { get; set; } public string? Unloading { get => IsUnloadingDumper ? DeliveryPart.Dumper : IsUnloadingPumped ? DeliveryPart.Pumped : IsUnloadingBox ? DeliveryPart.Box : null; @@ -191,28 +191,28 @@ namespace Elwig.ViewModels { } } [ObservableProperty] - private bool _isUnloadingDumper; + public partial bool IsUnloadingDumper { get; set; } [ObservableProperty] - private bool _isUnloadingPumped; + public partial bool IsUnloadingPumped { get; set; } [ObservableProperty] - private bool _isUnloadingBox; + public partial bool IsUnloadingBox { get; set; } [ObservableProperty] - private bool _isUnloadingOther; + public partial bool IsUnloadingOther { get; set; } [ObservableProperty] - private string _statusMembers = "-"; + public partial string StatusMembers { get; set; } = "-"; [ObservableProperty] - private string _statusDeliveries = "-"; + public partial string StatusDeliveries { get; set; } = "-"; [ObservableProperty] - private string _statusVarieties = "-"; + public partial string StatusVarieties { get; set; } = "-"; [ObservableProperty] - private string _statusWeight = "-"; + public partial string StatusWeight { get; set; } = "-"; [ObservableProperty] - private string _statusGradation = "-"; + public partial string StatusGradation { get; set; } = "-"; [ObservableProperty] - private Grid? _statusWeightToolTip; + public partial Grid? StatusWeightToolTip { get; set; } [ObservableProperty] - private Grid? _statusGradationToolTip; + public partial Grid? StatusGradationToolTip { get; set; } } } diff --git a/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs b/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs index a1a2729..ac25570 100644 --- a/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs +++ b/Elwig/ViewModels/DeliveryAncmtAdminViewModel.cs @@ -9,80 +9,80 @@ namespace Elwig.ViewModels { public partial class DeliveryAncmtAdminViewModel : ObservableObject { [ObservableProperty] - private string _title = "Anmeldungen - Elwig"; + public partial string Title { get; set; } = "Anmeldungen - Elwig"; [ObservableProperty] - private string? _searchQuery = ""; + public partial string? SearchQuery { get; set; } = ""; public List TextFilter => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []]; [ObservableProperty] - private bool _filterOnlyUpcoming; + public partial bool FilterOnlyUpcoming { get; set; } [ObservableProperty] - private bool _filterFromAllSchedules; + public partial bool FilterFromAllSchedules { get; set; } [ObservableProperty] - private string? _filterSeasonString; + public partial string? FilterSeasonString { get; set; } public int? FilterSeason { get => int.TryParse(FilterSeasonString, out var year) ? year : null; set => FilterSeasonString = $"{value}"; } [ObservableProperty] - private DeliveryAncmt? _selectedDeliveryAncmt; + public partial DeliveryAncmt? SelectedDeliveryAncmt { get; set; } [ObservableProperty] - private IEnumerable _deliveryAncmts = []; + public partial IEnumerable DeliveryAncmts { get; set; } = []; [ObservableProperty] - private DeliverySchedule? _selectedDeliverySchedule; + public partial DeliverySchedule? SelectedDeliverySchedule { get; set; } [ObservableProperty] - private IEnumerable _deliverySchedules = []; + public partial IEnumerable DeliverySchedules { get; set; } = []; [ObservableProperty] - private bool _enableSearchInputs = true; + public partial bool EnableSearchInputs { get; set; } = true; [ObservableProperty] - private string? _mgNrString; + public partial string? MgNrString { get; set; } public int? MgNr { get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null; set => MgNrString = $"{value}"; } [ObservableProperty] - private Member? _member; + public partial Member? Member { get; set; } [ObservableProperty] - private IEnumerable _memberSource = []; + public partial IEnumerable MemberSource { get; set; } = []; [ObservableProperty] - private string? _memberAddress; + public partial string? MemberAddress { get; set; } [ObservableProperty] - private DeliverySchedule? _deliverySchedule; + public partial DeliverySchedule? DeliverySchedule { get; set; } [ObservableProperty] - private IEnumerable _deliveryScheduleSource = []; + public partial IEnumerable DeliveryScheduleSource { get; set; } = []; [ObservableProperty] - private string? _sortId; + public partial string? SortId { get; set; } [ObservableProperty] - private WineVar? _wineVariety; + public partial WineVar? WineVariety { get; set; } [ObservableProperty] - private IEnumerable _wineVarietySource = []; + public partial IEnumerable WineVarietySource { get; set; } = []; [ObservableProperty] - private string? _weightString; + public partial string? WeightString { get; set; } public int? Weight { get => int.TryParse(WeightString, out var w) ? w : null; set => WeightString = $"{value}"; } [ObservableProperty] - private string _statusAncmts = "-"; + public partial string StatusAncmts { get; set; } = "-"; [ObservableProperty] - private string _statusWeight = "-"; + public partial string StatusWeight { get; set; } = "-"; [ObservableProperty] - private string _statusAncmtCreated = "-"; + public partial string StatusAncmtCreated { get; set; } = "-"; [ObservableProperty] - private string _statusAncmtModified = "-"; + public partial string StatusAncmtModified { get; set; } = "-"; [ObservableProperty] - private Grid? _statusWeightToolTip; + public partial Grid? StatusWeightToolTip { get; set; } [ObservableProperty] - private Visibility _controlButtonsVisibility = Visibility.Visible; + public partial Visibility ControlButtonsVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _editingButtonsVisibility = Visibility.Hidden; + public partial Visibility EditingButtonsVisibility { get; set; } = Visibility.Hidden; } } diff --git a/Elwig/ViewModels/DeliveryScheduleAdminViewModel.cs b/Elwig/ViewModels/DeliveryScheduleAdminViewModel.cs index 6b2f006..0cfbff7 100644 --- a/Elwig/ViewModels/DeliveryScheduleAdminViewModel.cs +++ b/Elwig/ViewModels/DeliveryScheduleAdminViewModel.cs @@ -10,76 +10,76 @@ namespace Elwig.ViewModels { public partial class DeliveryScheduleAdminViewModel : ObservableObject { [ObservableProperty] - private string? _searchQuery = ""; + public partial string? SearchQuery { get; set; } = ""; public List TextFilter => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []]; [ObservableProperty] - private bool _filterOnlyUpcoming; + public partial bool FilterOnlyUpcoming { get; set; } [ObservableProperty] - private string? _filterSeasonString; + public partial string? FilterSeasonString { get; set; } public int? FilterSeason { get => int.TryParse(FilterSeasonString, out var year) ? year : null; set => FilterSeasonString = $"{value}"; } [ObservableProperty] - private DeliverySchedule? _selectedDeliverySchedule; + public partial DeliverySchedule? SelectedDeliverySchedule { get; set; } [ObservableProperty] - private IEnumerable _deliverySchedules = []; + public partial IEnumerable DeliverySchedules { get; set; } = []; [ObservableProperty] - private bool _enableSearchInputs = true; + public partial bool EnableSearchInputs { get; set; } = true; [ObservableProperty] - private string _dateString = ""; + public partial string DateString { get; set; } = ""; public DateOnly? Date { get => DateOnly.TryParseExact(DateString, "dd.MM.yyyy", out var d) ? d : null; set => DateString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private Branch? _branch; + public partial Branch? Branch { get; set; } [ObservableProperty] - private IEnumerable _branchSource = []; + public partial IEnumerable BranchSource { get; set; } = []; [ObservableProperty] - private string _description = ""; + public partial string Description { get; set; } = ""; [ObservableProperty] - private string? _maxWeightString = ""; + public partial string? MaxWeightString { get; set; } = ""; public int? MaxWeight { get => int.TryParse(MaxWeightString, out var w) ? w : null; set => MaxWeightString = $"{value}"; } [ObservableProperty] - private bool _isCancelled; + public partial bool IsCancelled { get; set; } public ObservableCollection MainVarieties { get; set; } = []; [ObservableProperty] - private IEnumerable _mainVarietiesSource = []; + public partial IEnumerable MainVarietiesSource { get; set; } = []; public ObservableCollection OtherVarieties { get; set; } = []; [ObservableProperty] - private IEnumerable _otherVarietiesSource = []; + public partial IEnumerable OtherVarietiesSource { get; set; } = []; [ObservableProperty] - private IEnumerable _attributeSource = []; + public partial IEnumerable AttributeSource { get; set; } = []; [ObservableProperty] - private object? _attributeObj; + public partial object? AttributeObj { get; set; } public WineAttr? Attribute { get => AttributeObj as WineAttr; set => AttributeObj = value ?? AttributeSource.FirstOrDefault(); } [ObservableProperty] - private IEnumerable _cultivationSource = []; + public partial IEnumerable CultivationSource { get; set; } = []; [ObservableProperty] - private object? _cultivationObj; + public partial object? CultivationObj { get; set; } public WineCult? Cultivation { get => CultivationObj as WineCult; set => CultivationObj = value ?? CultivationSource.FirstOrDefault(); } [ObservableProperty] - private string _ancmtFromDateString = ""; + public partial string AncmtFromDateString { get; set; } = ""; public DateOnly? AncmtFromDate { get => DateOnly.TryParseExact(AncmtFromDateString, "dd.MM.yyyy", out var d) ? d : null; set => AncmtFromDateString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string _ancmtFromTimeString = ""; + public partial string AncmtFromTimeString { get; set; } = ""; public TimeOnly? AncmtFromTime { get => TimeOnly.TryParseExact(AncmtFromTimeString, "HH:mm", out var t) ? t : null; set => AncmtFromTimeString = $"{value:HH:mm}"; @@ -92,13 +92,13 @@ namespace Elwig.ViewModels { } } [ObservableProperty] - private string _ancmtToDateString = ""; + public partial string AncmtToDateString { get; set; } = ""; public DateOnly? AncmtToDate { get => DateOnly.TryParseExact(AncmtToDateString, "dd.MM.yyyy", out var d) ? d : null; set => AncmtToDateString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string _ancmtToTimeString = ""; + public partial string AncmtToTimeString { get; set; } = ""; public TimeOnly? AncmtToTime { get => TimeOnly.TryParseExact(AncmtToTimeString, "HH:mm", out var t) ? t : null; set => AncmtToTimeString = $"{value:HH:mm}"; @@ -112,8 +112,8 @@ namespace Elwig.ViewModels { } [ObservableProperty] - private Visibility _controlButtonsVisibility = Visibility.Visible; + public partial Visibility ControlButtonsVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _editingButtonsVisibility = Visibility.Hidden; + public partial Visibility EditingButtonsVisibility { get; set; } = Visibility.Hidden; } } diff --git a/Elwig/ViewModels/MemberAdminViewModel.cs b/Elwig/ViewModels/MemberAdminViewModel.cs index 1928a9f..d45b490 100644 --- a/Elwig/ViewModels/MemberAdminViewModel.cs +++ b/Elwig/ViewModels/MemberAdminViewModel.cs @@ -12,197 +12,197 @@ namespace Elwig.ViewModels { public partial class MemberAdminViewModel : ObservableObject { [ObservableProperty] - private string _title = "Mitglieder - Elwig"; + public partial string Title { get; set; } = "Mitglieder - Elwig"; - public int? TransferPredecessorAreaComs = null; - public int? CancelAreaComs = null; + public int? TransferPredecessorAreaComs { get; set; } = null; + public int? CancelAreaComs { get; set; } = null; public ObservableCollection> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes); [ObservableProperty] - private string? _searchQuery = ""; + public partial string? SearchQuery { get; set; } = ""; public List TextFilter => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []]; [ObservableProperty] - private bool _showOnlyActiveMembers = true; + public partial bool ShowOnlyActiveMembers { get; set; } = true; [ObservableProperty] - private Member? _selectedMember; + public partial Member? SelectedMember { get; set; } [ObservableProperty] - private IEnumerable _members = []; + public partial IEnumerable Members { get; set; } = []; [ObservableProperty] - private bool _isMemberSelected; + public partial bool IsMemberSelected { get; set; } [ObservableProperty] - private bool _isMemberSelectedOrCreating; + public partial bool IsMemberSelectedOrCreating { get; set; } [ObservableProperty] - private bool _memberHasEmail; + public partial bool MemberHasEmail { get; set; } [ObservableProperty] - private bool _memberCanSendEmail; + public partial bool MemberCanSendEmail { get; set; } [ObservableProperty] - private bool _enableMemberReferenceButton; + public partial bool EnableMemberReferenceButton { get; set; } [ObservableProperty] - private bool _enableSearchInputs = true; + public partial bool EnableSearchInputs { get; set; } = true; [ObservableProperty] - private IEnumerable _memberHasDeliveries = [.. Enumerable.Range(0, 9999).Select(i => false)]; + public partial IEnumerable MemberHasDeliveries { get; set; } = [.. Enumerable.Range(0, 9999).Select(i => false)]; [ObservableProperty] - private bool _memberListOrderByMgNr; + public partial bool MemberListOrderByMgNr { get; set; } [ObservableProperty] - private bool _memberListOrderByName; + public partial bool MemberListOrderByName { get; set; } [ObservableProperty] - private bool _memberListOrderByOrt; + public partial bool MemberListOrderByOrt { get; set; } [ObservableProperty] - private string? _mgNrString; + public partial string? MgNrString { get; set; } public int? MgNr { get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null; set => MgNrString = $"{value}"; } [ObservableProperty] - private string? _predecessorMgNrString; + public partial string? PredecessorMgNrString { get; set; } public int? PredecessorMgNr { get => int.TryParse(PredecessorMgNrString, out var mgnr) ? mgnr : null; set => PredecessorMgNrString = $"{value}"; } [ObservableProperty] - private bool _isJuridicalPerson; + public partial bool IsJuridicalPerson { get; set; } [ObservableProperty] - private string? _prefix; + public partial string? Prefix { get; set; } [ObservableProperty] - private string? _givenName; + public partial string? GivenName { get; set; } [ObservableProperty] - private string? _name; + public partial string? Name { get; set; } [ObservableProperty] - private string? _suffix; + public partial string? Suffix { get; set; } [ObservableProperty] - private string? _forTheAttentionOf; + public partial string? ForTheAttentionOf { get; set; } [ObservableProperty] - private string? _birthday; + public partial string? Birthday { get; set; } [ObservableProperty] - private string? _age; + public partial string? Age { get; set; } [ObservableProperty] - private bool _isDeceased; + public partial bool IsDeceased { get; set; } [ObservableProperty] - private string? _address; + public partial string? Address { get; set; } [ObservableProperty] - private string? _plzString; + public partial string? PlzString { get; set; } public int? Plz { get => int.TryParse(PlzString, out var plz) ? plz : null; set => PlzString = $"{value}"; } [ObservableProperty] - private AT_PlzDest? _ort; + public partial AT_PlzDest? Ort { get; set; } [ObservableProperty] - private IEnumerable _ortSource = []; + public partial IEnumerable OrtSource { get; set; } = []; [ObservableProperty] - private string? _billingName; + public partial string? BillingName { get; set; } [ObservableProperty] - private string? _billingAddress; + public partial string? BillingAddress { get; set; } [ObservableProperty] - private string? _billingPlzString; + public partial string? BillingPlzString { get; set; } public int? BillingPlz { get => int.TryParse(BillingPlzString, out var plz) ? plz : null; set => BillingPlzString = $"{value}"; } [ObservableProperty] - private AT_PlzDest? _billingOrt; + public partial AT_PlzDest? BillingOrt { get; set; } [ObservableProperty] - private IEnumerable _billingOrtSource = []; + public partial IEnumerable BillingOrtSource { get; set; } = []; [ObservableProperty] - private string? _iban; + public partial string? Iban { get; set; } [ObservableProperty] - private string? _bic; + public partial string? Bic { get; set; } [ObservableProperty] - private string? _ustIdNr; + public partial string? UstIdNr { get; set; } [ObservableProperty] - private string? _lfbisNr; + public partial string? LfbisNr { get; set; } [ObservableProperty] - private string? _organicOperatorId; + public partial string? OrganicOperatorId { get; set; } [ObservableProperty] - private string? _organicAuthorityCode; + public partial string? OrganicAuthorityCode { get; set; } [ObservableProperty] - private bool _isBuchführend; + public partial bool IsBuchführend { get; set; } [ObservableProperty] - private bool _isOrganic; + public partial bool IsOrganic { get; set; } [ObservableProperty] - private string? _organicState; + public partial string? OrganicState { get; set; } [ObservableProperty] - private string? _organicDetails = "-"; + public partial string? OrganicDetails { get; set; } = "-"; [ObservableProperty] - private Brush? _organicColor = Brushes.Black; + public partial Brush? OrganicColor { get; set; } = Brushes.Black; [ObservableProperty] - private string? _organicToolTip; + public partial string? OrganicToolTip { get; set; } [ObservableProperty] - private string? _entryDate; + public partial string? EntryDate { get; set; } [ObservableProperty] - private string? _exitDate; + public partial string? ExitDate { get; set; } [ObservableProperty] - private string? _businessShares1String; + public partial string? BusinessShares1String { get; set; } public int? BusinessShares1 { get => int.TryParse(BusinessShares1String, out var shares) ? shares : null; set => BusinessShares1String = $"{value}"; } [ObservableProperty] - private string? _businessShares2String; + public partial string? BusinessShares2String { get; set; } public int? BusinessShares2 { get => int.TryParse(BusinessShares2String, out var shares) ? shares : null; set => BusinessShares2String = $"{value}"; } [ObservableProperty] - private string? _businessShares3String; + public partial string? BusinessShares3String { get; set; } public int? BusinessShares3 { get => int.TryParse(BusinessShares3String, out var shares) ? shares : null; set => BusinessShares3String = $"{value}"; } [ObservableProperty] - private string? _accountingNr; + public partial string? AccountingNr { get; set; } [ObservableProperty] - private bool _isActive; + public partial bool IsActive { get; set; } [ObservableProperty] - private bool _isVollLieferant; + public partial bool IsVollLieferant { get; set; } [ObservableProperty] - private bool _isFunktionär; + public partial bool IsFunktionär { get; set; } [ObservableProperty] - private Branch? _branch; + public partial Branch? Branch { get; set; } [ObservableProperty] - private IEnumerable _branchSource = []; + public partial IEnumerable BranchSource { get; set; } = []; [ObservableProperty] - private AT_Kg? _defaultKg; + public partial AT_Kg? DefaultKg { get; set; } [ObservableProperty] - private IEnumerable _defaultKgSource = []; + public partial IEnumerable DefaultKgSource { get; set; } = []; [ObservableProperty] - private string? _comment; + public partial string? Comment { get; set; } [ObservableProperty] - private bool _contactViaPost; + public partial bool ContactViaPost { get; set; } [ObservableProperty] - private bool _contactViaEmail; + public partial bool ContactViaEmail { get; set; } [ObservableProperty] - private string _createdAt = "-"; + public partial string CreatedAt { get; set; } = "-"; [ObservableProperty] - private string _modifiedAt = "-"; + public partial string ModifiedAt { get; set; } = "-"; [ObservableProperty] - private string _modifiedAtShort = "-"; + public partial string ModifiedAtShort { get; set; } = "-"; [ObservableProperty] - private string _exportedAt = "-"; + public partial string ExportedAt { get; set; } = "-"; [ObservableProperty] - private string _importedAt = "-"; + public partial string ImportedAt { get; set; } = "-"; public ObservableCollection EmailAddresses { get; private set; } = [null, null, null, null, null, null, null, null, null]; public partial class PhoneNr(int? type = null, string? number = null, string? comment = null) : ObservableObject { [ObservableProperty] - public int _type = type ?? -1; + public partial int Type { get; set; } = type ?? -1; [ObservableProperty] - public string? _number = number; + public partial string? Number { get; set; } = number; [ObservableProperty] - public string? _comment = comment; + public partial string? Comment { get; set; } = comment; public override bool Equals(object? obj) { return obj is PhoneNr nr && Type == nr.Type && Number == nr.Number && Comment == nr.Comment; @@ -215,37 +215,37 @@ namespace Elwig.ViewModels { public ObservableCollection PhoneNrs { get; private set; } = [new(), new(), new(), new(), new(), new(), new(), new(), new()]; [ObservableProperty] - private string _statusMembers = "-"; + public partial string StatusMembers { get; set; } = "-"; [ObservableProperty] - private string? _statusMembersToolTip; + public partial string? StatusMembersToolTip { get; set; } [ObservableProperty] - private TextBlock? _statusBusinessShares; + public partial TextBlock? StatusBusinessShares { get; set; } [ObservableProperty] - private string _statusDeliveriesLastSeason = "-"; + public partial string StatusDeliveriesLastSeason { get; set; } = "-"; [ObservableProperty] - private string _statusDeliveriesLastSeasonInfo = "letzte Saison"; + public partial string StatusDeliveriesLastSeasonInfo { get; set; } = "letzte Saison"; [ObservableProperty] - private Grid? _statusDeliveriesLastSeasonToolTip; + public partial Grid? StatusDeliveriesLastSeasonToolTip { get; set; } [ObservableProperty] - private string _statusDeliveriesThisSeason = "-"; + public partial string StatusDeliveriesThisSeason { get; set; } = "-"; [ObservableProperty] - private string _statusDeliveriesThisSeasonInfo = "aktuelle Saison"; + public partial string StatusDeliveriesThisSeasonInfo { get; set; } = "aktuelle Saison"; [ObservableProperty] - private Grid? _statusDeliveriesThisSeasonToolTip; + public partial Grid? StatusDeliveriesThisSeasonToolTip { get; set; } [ObservableProperty] - private string _statusAreaCommitment = "-"; + public partial string StatusAreaCommitment { get; set; } = "-"; [ObservableProperty] - private Grid? _statusAreaCommitmentToolTip; + public partial Grid? StatusAreaCommitmentToolTip { get; set; } [ObservableProperty] - private string _statusAreaCommitmentInfo = "aktuelle Saison"; + public partial string StatusAreaCommitmentInfo { get; set; } = "aktuelle Saison"; [ObservableProperty] - private Visibility _controlButtonsVisibility = Visibility.Visible; + public partial Visibility ControlButtonsVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _editingButtonsVisibility = Visibility.Hidden; + public partial Visibility EditingButtonsVisibility { get; set; } = Visibility.Hidden; [ObservableProperty] - private Visibility _personalNameVisibility = Visibility.Visible; + public partial Visibility PersonalNameVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _juridicalNameVisibility = Visibility.Hidden; + public partial Visibility JuridicalNameVisibility { get; set; } = Visibility.Hidden; } } diff --git a/Elwig/ViewModels/MemberBusinessSharesViewModel.cs b/Elwig/ViewModels/MemberBusinessSharesViewModel.cs index edd4b06..af8b382 100644 --- a/Elwig/ViewModels/MemberBusinessSharesViewModel.cs +++ b/Elwig/ViewModels/MemberBusinessSharesViewModel.cs @@ -8,71 +8,71 @@ namespace Elwig.ViewModels { public partial class MemberBusinessSharesViewModel : ObservableObject { [ObservableProperty] - private string _title = "Geschäftsanteilbewegungen - Elwig"; + public partial string Title { get; set; } = "Geschäftsanteilbewegungen - Elwig"; public required Member FilterMember { get; set; } [ObservableProperty] - private MemberHistory? _selectedHistoryEntry; + public partial MemberHistory? SelectedHistoryEntry { get; set; } [ObservableProperty] - private IEnumerable _history = []; + public partial IEnumerable History { get; set; } = []; [ObservableProperty] - private string? _dateNoticeString; + public partial string? DateNoticeString { get; set; } public DateOnly? DateNotice { get => DateOnly.TryParseExact(DateNoticeString, "dd.MM.yyyy", out var d) ? d : null; set => DateNoticeString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string? _dateEffectiveString; + public partial string? DateEffectiveString { get; set; } public DateOnly? DateEffective { get => DateOnly.TryParseExact(DateEffectiveString, "dd.MM.yyyy", out var d) ? d : null; set => DateEffectiveString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string? _reason; + public partial string? Reason { get; set; } [ObservableProperty] - private string? _sharesString; + public partial string? SharesString { get; set; } public int? Shares { get => int.TryParse(SharesString, out var shares) ? shares : null; set => SharesString = $"{value}"; } [ObservableProperty] - private string? _otherMgNrString; + public partial string? OtherMgNrString { get; set; } public int? OtherMgNr { get => int.TryParse(OtherMgNrString, out var mgnr) ? mgnr : null; set => OtherMgNrString = $"{value}"; } [ObservableProperty] - private string? _deductYearString; + public partial string? DeductYearString { get; set; } public int? DeductYear { get => int.TryParse(DeductYearString, out var year) ? year : null; set => DeductYearString = $"{value}"; } [ObservableProperty] - private bool _deduct; + public partial bool Deduct { get; set; } [ObservableProperty] - private bool _companyHasSigned; + public partial bool CompanyHasSigned { get; set; } [ObservableProperty] - private bool _memberHasSigned; + public partial bool MemberHasSigned { get; set; } [ObservableProperty] - private string? _valuePerShareString; + public partial string? ValuePerShareString { get; set; } public decimal? ValuePerShare { get => decimal.TryParse(ValuePerShareString, out var v) ? v : null; set => ValuePerShareString = $"{value:0.00}"; } [ObservableProperty] - private string? _totalAmount; + public partial string? TotalAmount { get; set; } [ObservableProperty] - private string? _comment; + public partial string? Comment { get; set; } [ObservableProperty] - private Visibility _controlButtonsVisibility = Visibility.Visible; + public partial Visibility ControlButtonsVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _editingButtonsVisibility = Visibility.Hidden; + public partial Visibility EditingButtonsVisibility { get; set; } = Visibility.Hidden; [ObservableProperty] - private Visibility _personalNameVisibility = Visibility.Visible; + public partial Visibility PersonalNameVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private Visibility _juridicalNameVisibility = Visibility.Hidden; + public partial Visibility JuridicalNameVisibility { get; set; } = Visibility.Hidden; } } diff --git a/Elwig/ViewModels/PaymentVariantsViewModel.cs b/Elwig/ViewModels/PaymentVariantsViewModel.cs index ce07e63..cbafd8a 100644 --- a/Elwig/ViewModels/PaymentVariantsViewModel.cs +++ b/Elwig/ViewModels/PaymentVariantsViewModel.cs @@ -9,87 +9,87 @@ namespace Elwig.ViewModels { public partial class PaymentVariantsViewModel : ObservableObject { [ObservableProperty] - private PaymentVar? _selectedPaymentVariant; + public partial PaymentVar? SelectedPaymentVariant { get; set; } [ObservableProperty] - private IEnumerable _paymentVariants = []; + public partial IEnumerable PaymentVariants { get; set; } = []; - public BillingData? BillingData; - public bool SeasonLocked = false; // never locked - public bool WeightModifierChanged; + public BillingData? BillingData { get; set; } + public bool SeasonLocked { get; set; } = false; // never locked + public bool WeightModifierChanged { get; set; } [ObservableProperty] - private string _name = ""; + public partial string Name { get; set; } = ""; [ObservableProperty] - private string _comment = ""; + public partial string Comment { get; set; } = ""; [ObservableProperty] - private string _dateString = ""; + public partial string DateString { get; set; } = ""; public DateOnly? Date { get => DateOnly.TryParseExact(DateString, "dd.MM.yyyy", out var d) ? d : null; set => DateString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string _transferDateString = ""; + public partial string TransferDateString { get; set; } = ""; public DateOnly? TransferDate { get => DateOnly.TryParseExact(TransferDateString, "dd.MM.yyyy", out var d) ? d : null; set => TransferDateString = $"{value:dd.MM.yyyy}"; } [ObservableProperty] - private string _weightModifierString = ""; + public partial string WeightModifierString { get; set; } = ""; public double? WeightModifier { get => double.TryParse(WeightModifierString, out var d) ? d : null; set => WeightModifierString = $"{value}"; } [ObservableProperty] - private string _data = ""; + public partial string Data { get; set; } = ""; [ObservableProperty] - private bool _considerModifiers; + public partial bool ConsiderModifiers { get; set; } [ObservableProperty] - private bool _considerPenalties; + public partial bool ConsiderPenalties { get; set; } [ObservableProperty] - private bool _considerPenalty; + public partial bool ConsiderPenalty { get; set; } [ObservableProperty] - private bool _considerAuto; + public partial bool ConsiderAuto { get; set; } [ObservableProperty] - private bool _considerCustom; + public partial bool ConsiderCustom { get; set; } [ObservableProperty] - private bool _isPaymentVariantSelected; + public partial bool IsPaymentVariantSelected { get; set; } [ObservableProperty] - private bool _isReadOnly = true; + public partial bool IsReadOnly { get; set; } = true; [ObservableProperty] - private bool _dataIsReadOnly = true; + public partial bool DataIsReadOnly { get; set; } = true; [ObservableProperty] - private bool _isEnabled = false; + public partial bool IsEnabled { get; set; } = false; [ObservableProperty] - private bool _saveIsEnabled = false; + public partial bool SaveIsEnabled { get; set; } = false; [ObservableProperty] - private bool _deleteIsEnabled = false; + public partial bool DeleteIsEnabled { get; set; } = false; [ObservableProperty] - private bool _calculateIsEnabled = false; + public partial bool CalculateIsEnabled { get; set; } = false; [ObservableProperty] - private bool _exportIsEnabled = false; + public partial bool ExportIsEnabled { get; set; } = false; [ObservableProperty] - private bool _commitIsEnabled = false; + public partial bool CommitIsEnabled { get; set; } = false; [ObservableProperty] - private Visibility _commitVisibility = Visibility.Visible; + public partial Visibility CommitVisibility { get; set; } = Visibility.Visible; [ObservableProperty] - private bool _revertIsEnabled = false; + public partial bool RevertIsEnabled { get; set; } = false; [ObservableProperty] - private Visibility _revertVisibility = Visibility.Hidden; + public partial Visibility RevertVisibility { get; set; } = Visibility.Hidden; [ObservableProperty] - private string _arrow = "\xF0AF"; + public partial string Arrow { get; set; } = "\xF0AF"; [ObservableProperty] - private string _editText = "Bearbeiten"; + public partial string EditText { get; set; } = "Bearbeiten"; [ObservableProperty] - private string _statusModifierSum = "-"; + public partial string StatusModifierSum { get; set; } = "-"; [ObservableProperty] - private string _statusTotalSum = "-"; + public partial string StatusTotalSum { get; set; } = "-"; [ObservableProperty] - private string _statusVatSum = "-"; + public partial string StatusVatSum { get; set; } = "-"; [ObservableProperty] - private string _statusDeductionSum = "-"; + public partial string StatusDeductionSum { get; set; } = "-"; [ObservableProperty] - private string _statusPaymentSum = "-"; + public partial string StatusPaymentSum { get; set; } = "-"; } }