This commit is contained in:
Илья Федотов 2024-05-19 17:52:59 +04:00
parent 8ef811e533
commit be5db49184
5 changed files with 13 additions and 14 deletions

View File

@ -11,7 +11,7 @@ namespace ElectronicsShopContracts.BindingModels
public class OrderBindingModel : IOrderModel
{
public int ID { get; set; }
public int UserID { get; set; }
public int ClientID { get; set; }
public int? ImplementerID { get; set; }
public int PaymentID { get; set; }
public double Sum { get; set; }

View File

@ -12,11 +12,11 @@ namespace ElectronicsShopContracts.SearchModels
{
public int? ID { get; set; }
//public int? OplataID { get; set; }
public int? UserID { get; set; }
public int? ClientID { get; set; }
public OrderStatus OrderStatus { get; set; }
public PaymeantOption PaymeantOption { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set;}
public Dictionary<int, (IProductModel, int)>? ProductList { get; set; }
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
}
}

View File

@ -13,9 +13,9 @@ namespace ElectronicsShopContracts.ViewModels
{
public int ID { get; set; }
[DisplayName("Клиент ID")]
public int UserID { get; set; }
public int ClientID { get; set; }
[DisplayName("Исполнитель ID")]
public int ImplementerID { get; set; }
public int? ImplementerID { get; set; }
[DisplayName("Оплата ID")]
public int PaymentID { get; set; }
@ -23,7 +23,7 @@ namespace ElectronicsShopContracts.ViewModels
public double Sum { get; set; }
[DisplayName("Статус")]
public OrderStatus OrderStatus { get; set; } = OrderStatus.Неизвестен;
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[DisplayName("Стутус оплаты")]
public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно;
@ -35,6 +35,5 @@ namespace ElectronicsShopContracts.ViewModels
public DateTime? DateImplement { get; set; }
[DisplayName("Корзина")]
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
}
}
}

View File

@ -18,8 +18,8 @@ namespace ElectronicsShopDataBaseImplement.Models
public int ID { get; set; }
[Required]
public double Sum { get; set; }
[ForeignKey("UserID")]
public int UserID { get; set; }
[ForeignKey("ClientID")]
public int ClientID { get; set; }
[Required]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[Required]
@ -53,7 +53,7 @@ namespace ElectronicsShopDataBaseImplement.Models
return new Order()
{
ID = model.ID,
UserID=model.UserID,
ClientID=model.ClientID,
Sum = model.Sum,
Status = model.Status,
PaymeantOption = model.PaymeantOption,
@ -72,7 +72,7 @@ namespace ElectronicsShopDataBaseImplement.Models
return;
}
ID = model.ID;
UserID = model.UserID;
ClientID = model.ClientID;
Sum = model.Sum;
PaymeantOption = model.PaymeantOption;
Status = model.Status;
@ -87,7 +87,7 @@ namespace ElectronicsShopDataBaseImplement.Models
public OrderViewModel GetViewModel => new()
{
ID = ID,
UserID = UserID,
ClientID = ClientID,
Sum = Sum,
PaymeantOption = PaymeantOption,
Status = Status,

View File

@ -9,7 +9,7 @@ namespace ElectronicsShopDataModels.Models
{
public interface IOrderModel : IID
{
int UserID { get; }
int ClientID { get; }
int? ImplementerID { get; }
int PaymentID { get; }
OrderStatus Status { get; }