public void Add(InvenPurOrderDto DTO) { using (var container = new InventoryContainer()) { InvenPurOrder inreo = new InvenPurOrder(); container.InvenPurOrders.AddObject((InvenPurOrder)DTOMapper.DTOObjectConverter(DTO, inreo)); container.SaveChanges(); } }
public void Edit(InvenPurOrderDto DTO) { using (var container = new InventoryContainer()) { var Comp = new InvenPurOrder(); Comp = container.InvenPurOrders.FirstOrDefault(o => o.InvenPurOrderId.Equals(DTO.InvenPurOrderId)); Comp.InvenPurOrderId = DTO.InvenPurOrderId; Comp.Priority = DTO.Priority; Comp.PurOrderBy = DTO.PurOrderBy; Comp.ProductId = DTO.ProductId; Comp.PurOrderNO = DTO.PurOrderNO; Comp.PurOrderStatus = DTO.PurOrderStatus; Comp.UnitPrice = DTO.UnitPrice; Comp.BrProId = DTO.BrProId; Comp.PurOrderDate = DTO.PurOrderDate; Comp.Quantity = DTO.Quantity; Comp = (InvenPurOrder)DTOMapper.DTOObjectConverter(DTO, Comp); container.SaveChanges(); } }