Files
elwig/Elwig/Documents/DeliveryConfirmation.cs

27 lines
992 B
C#

using Elwig.Helpers;
using Elwig.Models.Dtos;
using Elwig.Models.Entities;
using System;
using System.Collections.Generic;
namespace Elwig.Documents {
public class DeliveryConfirmation : BusinessDocument {
public Season Season;
public DeliveryConfirmationData Data;
public string? Text = App.Client.TextDeliveryConfirmation;
public Dictionary<string, MemberBucket> MemberBuckets;
public DeliveryConfirmation(AppDbContext ctx, int year, Member m, DeliveryConfirmationData data) :
base($"Anlieferungsbestätigung {year}", m) {
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("invalid season");
ShowDateAndLocation = true;
UseBillingAddress = true;
IncludeSender = true;
DocumentId = $"Anl.-Best. {Season.Year}/{m.MgNr}";
Data = data;
MemberBuckets = ctx.GetMemberBuckets(Season.Year, m.MgNr).GetAwaiter().GetResult();
}
}
}