コード例 #1
0
 public bool AddAndUpdareTireChangeActInBatch(ActivityItem updateModel, List <string> pkids, List <ActivityItem> activityListToAdd)
 {
     using (var dbHelper = new SqlDbHelper(ConnectionHelper.GetDecryptConn("Gungnir")))
     {
         try
         {
             dbHelper.BeginTransaction();
             if (pkids != null && pkids.Any())
             {
                 if (!DALListActivity.UpdateTireChangedActInBatch(dbHelper, updateModel, pkids))
                 {
                     dbHelper.Rollback();
                     return(false);
                 }
             }
             if (activityListToAdd != null && activityListToAdd.Any())
             {
                 foreach (var actToAdd in activityListToAdd)
                 {
                     if (!DALListActivity.AddTireChangedAct(actToAdd))
                     {
                         dbHelper.Rollback();
                         return(false);
                     }
                 }
             }
             dbHelper.Commit();
             return(true);
         }
         catch (Exception ex)
         {
             dbHelper.Rollback();
             logger.Error("批量生成服务码错误", ex);
             return(false);
         }
     }
 }
コード例 #2
0
 public static bool AddTireChangedAct(ActivityItem model) => DALListActivity.AddTireChangedAct(model);