public static Business.Library.OrderDetails MapOrderDetails(Entities.OrderDetails order) { return(new Business.Library.OrderDetails { ID = order.OrderId, Order = MapOrder(order.Order), Product = MapProduct(order.Product), order_id = order.OrderId, product_id = order.ProductId, Quantity = order.Quantity }); }
public void AddNewOrderDetail(Business.Library.OrderDetails order) { Business.Library.OrderDetails od = new Business.Library.OrderDetails { order_id = order.order_id, product_id = order.product_id, Quantity = order.Quantity, //Product = product, //Order = order }; Entities.OrderDetails entity = Mapper.MapOrderDetails(od); _context.Add(entity); }
public void AddNewOrderDetail(Business.Library.OrderDetails order) { Entities.OrderDetails entity = Mapper.MapOrderDetails(order); _context.Add(entity); }
public void UpdateCartForOrder(Business.Library.OrderDetails order) { Entities.OrderDetails myEntity = _context.OrderDetails.Find(order.ID); Entities.OrderDetails newEntity = Mapper.MapOrderDetails(order); _context.Entry(myEntity).CurrentValues.SetValues(newEntity); }