コード例 #1
0
        public static bool Insert(SE_GiftManageConfigModel model, SE_DictionaryConfigModel log)
        {
            try
            {
                var result   = SE_GiftManageConfigDAL.Insert(ProcessConnection.OpenConfiguration, model);
                var giftFlag = true;
                log.ParentId = result;
                //var reGiftP = SE_GiftManageConfigDAL.DeleteGiftProductConfig(result);
                var giftProductModels = JsonConvert.DeserializeObject <List <GiftStockModel2> >(model.GiftProducts);
                foreach (var g in giftProductModels)
                {
                    g.RuleId     = result;
                    g.IsGiveAway = model.GiveAway;
                    giftFlag     = giftFlag && SE_GiftManageConfigDAL.MergeIntoGiftProductStock(g.Pid, g.Stock, result) > 0;
                    giftFlag     = giftFlag && SE_GiftManageConfigDAL.InsertGiftProductConfig(g) > 0;
                }

                // 按PID配置赠品后刷新牛皮癣缓存
                RefreshGiftPicture(model);
                return(result > 0 && SE_GiftManageConfigDAL.InsertLog(ProcessConnection.OpenConfiguration, log) && giftFlag);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
 public static bool Insert(SE_GiftManageConfigModel model, SE_DictionaryConfigModel log)
 {
     try
     {
         var result = DiscountManageConfigDal.Insert(ProcessConnection.OpenConfiguration, model);
         log.ParentId = result;
         //var reGiftP = SE_GiftManageConfigDAL.DeleteGiftProductConfig(result);
         return(SE_GiftManageConfigDAL.InsertLog(ProcessConnection.OpenConfiguration, log));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }