ViewModels: Use partial properties
This commit is contained in:
@@ -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<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _searchQuery = "";
|
||||
public partial string? SearchQuery { get; set; } = "";
|
||||
public List<string> 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<Member> _members = [];
|
||||
public partial IEnumerable<Member> 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<bool> _memberHasDeliveries = [.. Enumerable.Range(0, 9999).Select(i => false)];
|
||||
public partial IEnumerable<bool> 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<AT_PlzDest> _ortSource = [];
|
||||
public partial IEnumerable<AT_PlzDest> 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<AT_PlzDest> _billingOrtSource = [];
|
||||
public partial IEnumerable<AT_PlzDest> 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<Branch> _branchSource = [];
|
||||
public partial IEnumerable<Branch> BranchSource { get; set; } = [];
|
||||
[ObservableProperty]
|
||||
private AT_Kg? _defaultKg;
|
||||
public partial AT_Kg? DefaultKg { get; set; }
|
||||
[ObservableProperty]
|
||||
private IEnumerable<AT_Kg> _defaultKgSource = [];
|
||||
public partial IEnumerable<AT_Kg> 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<string?> 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<PhoneNr> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user