public bool InsertRebateApplyPageConfig(RebateApplyPageConfig data, string user) { var result = false; try { dbScopeManager.CreateTransaction(conn => { var pkid = DALRebateConfig.InsertRebateApplyPageConfig(conn, data.BackgroundImg, data.ActivityRules, user); if (data.ImgList != null && data.ImgList.Any()) { foreach (var item in data.ImgList) { DALRebateConfig.InsertRebateImgConfig(conn, pkid, item.ImgUrl, ImgSource.PageImg, item.Remarks); } } result = true; }); } catch (Exception ex) { logger.Error(ex); } return(result); }
public static int InsertRebateApplyPageConfig(SqlConnection conn, RebateApplyPageConfig config, string user) { const string sql = @" INSERT INTO Activity..RebateApplyPageConfig ( BackgroundImg , CreateUser , ActivityRules , RebateSuccessMsg , RedBagRemark , CreateTime , UpdateTime ) OUTPUT Inserted.PKID VALUES ( @BackgroundImg , @CreateUser , @ActivityRules , @RebateSuccessMsg , @RedBagRemark , GETDATE() , GETDATE() )"; return(Convert.ToInt32(conn.ExecuteScalar(sql, new { BackgroundImg = config.BackgroundImg, ActivityRules = config.ActivityRules, CreateUser = user, RebateSuccessMsg = config.RebateSuccessMsg, RedBagRemark = config.RedBagRemark }, commandType: CommandType.Text))); }
public JsonResult InsertRebateApplyPageConfig(RebateApplyPageConfig data) { RebateConfigManager manager = new RebateConfigManager(); var result = manager.InsertRebateApplyPageConfig(data, User.Identity.Name); return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取返现申请页面配置 /// </summary> /// <returns></returns> public static RebateApplyPageConfig SelectRebateApplyPageConfig() { RebateApplyPageConfig result = null; try { using (var client = new ActivityClient()) { var getResult = client.SelectRebateApplyPageConfig(); getResult.ThrowIfException(true); result = getResult.Result; } } catch (Exception ex) { logger.Error(ex); } return(result); }