namespace LaaProductionWeb.Services.Models { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; public class OrderScanModel : OrderModel { public string Host { get; set; } public string Place { get; set; } public int PalletsCount { get; set; } [Display(Name = "Paletten-Nr.")] public int PalletNr { get; set; } = 1; public IDictionary Pallets { get; set; } = new Dictionary { { 1, false } }; public string PrintUrl => $"~/Shipments/Print?ordernr={this.OrderNr}&positionnr={this.PositionNr}&palletnr={this.PalletNr}"; public string DownloadUrl => $"~/Shipments/Download?ordernr={this.OrderNr}&positionnr={this.PositionNr}&palletnr={this.PalletNr}"; public void UpdatePalletsCount(int palletsCount) { this.PalletsCount = palletsCount; this.Pallets = Enumerable .Range(1, palletsCount) .ToDictionary(x => x, x => false); this.Pallets[this.PalletNr] = true; } } }