示例#1
0
 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
     });
 }
示例#2
0
 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
     });
 }
示例#3
0
 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
     });
 }
示例#4
0
        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);
        }
示例#5
0
        public bool InsertOrderContent(SharedDataTypes.OrderContent oc, string orderId)
        {
            localDb.OrderContent.Add(converter.ConvertToDBOrderContent(oc, orderId));

            return(localDb.SaveChanges() == 1);
        }