89 lines
3.5 KiB
C#
89 lines
3.5 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Elwig.Models.Entities;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Elwig.ViewModels {
|
|
public partial class DeliveryAncmtAdminViewModel : ObservableObject {
|
|
|
|
[ObservableProperty]
|
|
public partial string Title { get; set; } = "Anmeldungen - Elwig";
|
|
|
|
[ObservableProperty]
|
|
public partial string? SearchQuery { get; set; } = "";
|
|
public List<string> TextFilter => [.. SearchQuery?.ToLower().Split(' ').ToList().FindAll(e => e.Length > 0) ?? []];
|
|
|
|
[ObservableProperty]
|
|
public partial bool FilterOnlyUpcoming { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool FilterFromAllSchedules { get; set; }
|
|
[ObservableProperty]
|
|
public partial string? FilterSeasonString { get; set; }
|
|
public int? FilterSeason {
|
|
get => int.TryParse(FilterSeasonString, out var year) ? year : null;
|
|
set => FilterSeasonString = $"{value}";
|
|
}
|
|
|
|
[ObservableProperty]
|
|
public partial DeliveryAncmt? SelectedDeliveryAncmt { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<DeliveryAncmt> DeliveryAncmts { get; set; } = [];
|
|
[ObservableProperty]
|
|
public partial DeliverySchedule? SelectedDeliverySchedule { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<DeliverySchedule> DeliverySchedules { get; set; } = [];
|
|
[ObservableProperty]
|
|
public partial bool EnableSearchInputs { get; set; } = true;
|
|
|
|
[ObservableProperty]
|
|
public partial string? MgNrString { get; set; }
|
|
public int? MgNr {
|
|
get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null;
|
|
set => MgNrString = $"{value}";
|
|
}
|
|
[ObservableProperty]
|
|
public partial Member? Member { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<Member> MemberSource { get; set; } = [];
|
|
[ObservableProperty]
|
|
public partial string? MemberAddress { get; set; }
|
|
|
|
[ObservableProperty]
|
|
public partial DeliverySchedule? DeliverySchedule { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<DeliverySchedule> DeliveryScheduleSource { get; set; } = [];
|
|
[ObservableProperty]
|
|
public partial string? SortId { get; set; }
|
|
[ObservableProperty]
|
|
public partial WineVar? WineVariety { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<WineVar> WineVarietySource { get; set; } = [];
|
|
|
|
[ObservableProperty]
|
|
public partial string? WeightString { get; set; }
|
|
public int? Weight {
|
|
get => int.TryParse(WeightString, out var w) ? w : null;
|
|
set => WeightString = $"{value}";
|
|
}
|
|
|
|
[ObservableProperty]
|
|
public partial string StatusAncmts { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusWeight { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusAncmtCreated { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusAncmtModified { get; set; } = "-";
|
|
|
|
[ObservableProperty]
|
|
public partial Grid? StatusWeightToolTip { get; set; }
|
|
|
|
[ObservableProperty]
|
|
public partial Visibility ControlButtonsVisibility { get; set; } = Visibility.Visible;
|
|
[ObservableProperty]
|
|
public partial Visibility EditingButtonsVisibility { get; set; } = Visibility.Hidden;
|
|
}
|
|
}
|