internal Local_Database.OrderContent ConvertToDBOrderContent(SharedDataTypes.OrderContent oc, string orderId) { return(new Local_Database.OrderContent { Order_ID = orderId, ID_OrderContent = oc.OrderContentId, ModifyDate = DateTime.Now }); }
internal Local_Database.OrderContent_has_Chocolate ConvertToDBOcHasChoco(SharedDataTypes.OrderContent oc, SharedDataTypes.Chocolate c) { return(new OrderContent_has_Chocolate { OrderContent_ID = oc.OrderContentId, Amount = oc.Amount, Chocolate_ID = c.ChocolateId, ModifyDate = DateTime.Now }); }
internal Local_Database.OrderContent_has_Package ConvertToDBOcHasPackage(SharedDataTypes.OrderContent oc, SharedDataTypes.Package p) { return(new OrderContent_has_Package { OrderContent_ID = oc.OrderContentId, Amount = oc.Amount, Package_ID = p.PackageId, ModifyDate = DateTime.Now }); }
public bool UpdateOrderContent(SharedDataTypes.OrderContent oc, string orderId) { var temp = localDb.OrderContent.Where(p => p.ID_OrderContent.Equals(oc.OrderContentId)).Select(p => p).First(); temp.ID_OrderContent = oc.OrderContentId; temp.Order_ID = orderId; temp.ModifyDate = DateTime.Now; return(localDb.SaveChanges() == 1); }
public bool InsertOrderContent(SharedDataTypes.OrderContent oc, string orderId) { localDb.OrderContent.Add(converter.ConvertToDBOrderContent(oc, orderId)); return(localDb.SaveChanges() == 1); }