Esempio n. 1
0
 public static int ApproveBack(string acid)
 {
     using (var dbHelper = new SqlDbHelper(ConnectionHelper.GetDecryptConn("Gungnir")))
     {
         dbHelper.BeginTransaction();
         try
         {
             //var result1 = DalSeckill.DeleteFlashSaleTempByAcid(acid);
             //if (result1 <= 0)
             //{
             //    dbHelper.Rollback();
             //    return -1;
             //}
             //var result2 = DalSeckill.DeleteFlashSaleProductsTempByAcid(acid);
             //if (result2 <= 0)
             //{
             //    dbHelper.Rollback();
             //    return -1;
             //}
             var result3 = DalSeckill.UpdateSeckillToToApprove(acid, 2);
             if (result3 <= 0)
             {
                 dbHelper.Rollback();
                 return(-1);
             }
             dbHelper.Commit();
             return(1);
         }
         catch (Exception e)
         {
             dbHelper.Rollback();
             throw new Exception(e.Message);;
         }
     }
 }
Esempio n. 2
0
 public static int UpdateSeckillToToApprove(string acid)
 {
     return(DalSeckill.UpdateSeckillToToApprove(acid));
 }