2024-12-04 17:38:21 +04:00
|
|
|
|
using InternetShopContracts.DataViewModels;
|
|
|
|
|
using InternetShopDataModels.Models;
|
2024-11-19 21:40:30 +04:00
|
|
|
|
|
|
|
|
|
namespace InternetShopContracts.DataBindingModels
|
|
|
|
|
{
|
|
|
|
|
public class OrderBindingModel : IOrderModel
|
|
|
|
|
{
|
|
|
|
|
public string CustomerFIO { get; set; } = string.Empty;
|
|
|
|
|
public string CustomerEmail { get; set; } = string.Empty;
|
|
|
|
|
public string ImagePath { get; set; } = string.Empty;
|
|
|
|
|
public List<string> ProductNames { get; set; } = new List<string>();
|
|
|
|
|
public int Id { get; set; }
|
2024-12-04 17:38:21 +04:00
|
|
|
|
|
|
|
|
|
public static OrderBindingModel FromViewModel(OrderViewModel viewModel)
|
|
|
|
|
{
|
|
|
|
|
OrderBindingModel model = new OrderBindingModel();
|
|
|
|
|
model.Id = viewModel.Id;
|
|
|
|
|
model.CustomerFIO = viewModel.CustomerFIO;
|
|
|
|
|
model.CustomerEmail = viewModel.CustomerEmail;
|
|
|
|
|
model.ImagePath = viewModel.ImagePath;
|
|
|
|
|
model.ProductNames = viewModel.ProductNames;
|
|
|
|
|
return model;
|
|
|
|
|
}
|
2024-11-19 21:40:30 +04:00
|
|
|
|
}
|
|
|
|
|
}
|