Reports init, changed 1 relation

This commit is contained in:
the
2023-05-18 22:18:40 +04:00
parent 49b8f15517
commit 2b48d804a5
17 changed files with 1044 additions and 57 deletions

View File

@@ -5,6 +5,7 @@ using ComputerShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -19,6 +20,9 @@ namespace ComputerShopDatabaseImplement.Models
public int Id { get; set; }
public EquipmentReceivingStatus Status { get; private set; } = EquipmentReceivingStatus.Неизвестен;
[ForeignKey("ReceivingId")]
public List<Supply> Supplies { get; set; } = new();
public static EquipmentReceiving? Create(EquipmentReceivingBindingModel? model)
{
if (model == null)

View File

@@ -25,7 +25,6 @@ namespace ComputerShopDatabaseImplement.Models
public int OrderId { get; set; }
public int ReceivingId { get; set; }
private Dictionary<int, (IOrderModel, int)>? _supplyOrders =
null;
[NotMapped]
@@ -45,9 +44,7 @@ namespace ComputerShopDatabaseImplement.Models
[ForeignKey("SupplyId")]
public virtual List<SupplyOrder> Orders { get; set; } = new();
[ForeignKey("SupplyId")]
public virtual List<EquipmentReceiving> Receivings { get; set; } = new();
[ForeignKey("SupplyId")]
public virtual List<ComponentSupply> Supplies { get; set; } = new();
public virtual List<ComponentSupply> ComponentSupplies { get; set; } = new();
public static Supply Create(ComputerShopDatabase context, SupplyBindingModel model)
{