2024-04-21 19:17:40 +04:00
|
|
|
|
using AccountingWarehouseProductsContracts.BindingModels;
|
|
|
|
|
using AccountingWarehouseProductsContracts.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AccountingWarehouseProductsDatabaseImplement.Models
|
|
|
|
|
{
|
|
|
|
|
public class Stand
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
public string StandName { get; set; } = string.Empty;
|
|
|
|
|
|
2024-05-07 16:15:07 +04:00
|
|
|
|
public DateTime? DeliveryDate { get; set; }
|
2024-04-21 19:17:40 +04:00
|
|
|
|
|
|
|
|
|
public int Count { get; set; }
|
|
|
|
|
|
|
|
|
|
public int ProductId { get; set; }
|
|
|
|
|
|
|
|
|
|
public int SupplierId { get; set; }
|
|
|
|
|
|
|
|
|
|
public static Stand? Create(StandBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model == null) return null;
|
|
|
|
|
|
|
|
|
|
return new Stand()
|
|
|
|
|
{
|
|
|
|
|
Id = model.Id,
|
|
|
|
|
StandName = model.StandName,
|
|
|
|
|
DeliveryDate = model.DeliveryDate,
|
|
|
|
|
Count = model.Count,
|
|
|
|
|
ProductId = model.ProductId,
|
|
|
|
|
SupplierId = model.SupplierId
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Update(StandBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model == null) return;
|
|
|
|
|
StandName = model.StandName;
|
|
|
|
|
DeliveryDate = model.DeliveryDate;
|
|
|
|
|
Count = model.Count;
|
|
|
|
|
ProductId = model.ProductId;
|
|
|
|
|
SupplierId = model.SupplierId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public StandViewModel GetViewModel => new()
|
|
|
|
|
{
|
|
|
|
|
Id = Id,
|
|
|
|
|
StandName = StandName,
|
|
|
|
|
DeliveryDate = DeliveryDate,
|
|
|
|
|
Count = Count,
|
|
|
|
|
ProductId = ProductId,
|
|
|
|
|
SupplierId = SupplierId
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|