Ejemplo n.º 1
0
        public static CustomerOrderVM SetSubData(CustomerOrder model)
        {
            var data = CustomerOrderVM.MToVM(model);

            data.DateTime  = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByOID(model.ID, model.API).FirstOrDefault());
            data.OrderItem = CustomerOrderItemService.SetSubDatas(CustomerOrderItemService.GetByCOID(model.ID, model.API));
            return(data);
        }
Ejemplo n.º 2
0
 public static bool Remove(Guid id, Guid uid, Guid aid)
 {
     try {
         using (var context = new CentralProcessContext()){
             var query = (from i in context.CustomerOrderDB where i.ID == id && i.UserID == uid && i.API == aid select i).FirstOrDefault();
             context.CustomerOrderDB.Remove(query);
             context.SaveChanges();
             //remove customerOrderItem
             //remove date time
             if (DateTimeStorageService.Remove(query.DateTimeID, aid, id) && CustomerOrderItemService.RemoveByCOID(id, aid))
             {
                 return(true);
             }
             return(false);
         }
     } catch { return(false); }
 }