Exemple #1
0
 public List <Order> GetOrderToCharge(Func <Order, bool> seleWhere)
 {
     try
     {
         List <Order> order = new List <Order>();
         using (DCLEntities dcl = new DCLEntities())
         {
             foreach (Order item in dcl.Order.Where(seleWhere).ToList())
             {
                 item.RechargeStatus   = (int)OrderRechargeStatus.processing;
                 dcl.Entry(item).State = System.Data.Entity.EntityState.Modified;
                 if (dcl.SaveChanges() > 0)
                 {
                     order.Add(item);
                 }
             }
         }
         return(order);
     }
     catch (Exception ex)
     {
         WriteLog.Write("异常场信息[GetOrderToCharge]:" + ex.Message + ex.Source, LogPathFile.Exception);
         return(null);
     }
 }
Exemple #2
0
 public static bool UpdateCards(Cards cards)
 {
     try
     {
         using (DCLEntities dcl = new DCLEntities())
         {
             dcl.Entry(cards).State = System.Data.Entity.EntityState.Modified;
             return(dcl.SaveChanges() > 0);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public static bool UpdateOrderChargeAccount(OrderChargeAccount orderChargeAccount)
 {
     try
     {
         using (DCLEntities dcl = new DCLEntities())
         {
             dcl.Entry(orderChargeAccount).State = System.Data.Entity.EntityState.Modified;
             return(dcl.SaveChanges() > 0);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemple #4
0
        public bool UpdateOrder(Order order)
        {
            try
            {
                using (DCLEntities dcl = new DCLEntities())
                {
                    dcl.Entry(order).State = System.Data.Entity.EntityState.Modified;
                    return(dcl.SaveChanges() > 0);
                }
            }
            catch (System.Data.Entity.Validation.DbEntityValidationException ex)
            {
                WriteLog.Write("系统订单号:" + order.OrderInsideID + ",商户订单号:" + order.OrderExternalID + ",异常场信息[UpdateOrder]:" + ex.Message + ex.Source, LogPathFile.Exception);

                return(false);
            }
        }
Exemple #5
0
 public static bool UpdateCards(Cards cards, int cardStatus, string msg)
 {
     try
     {
         using (DCLEntities dcl = new DCLEntities())
         {
             cards.ReChargeStatus   = cardStatus;
             cards.UseTime          = DateTime.Now;
             cards.ReChargeMsg      = msg;
             dcl.Entry(cards).State = System.Data.Entity.EntityState.Modified;
             return(dcl.SaveChanges() > 0);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }