public static bool UpdatePersonalCenterCouponConfig(PersonalCenterCouponConfig model) { const string sql = @"DECLARE @Count INT SELECT @Count = COUNT(0) FROM Configuration.dbo.[SE_PersonalCenterCouponConfig] WHERE Sort = @Sort AND Id = @Id IF @Count > 0 BEGIN SELECT 0 END ELSE BEGIN UPDATE Configuration.dbo.[SE_PersonalCenterCouponConfig] SET [Sort] = @Sort WHERE Id = @Id SELECT 1 END "; var sqlParameter = new SqlParameter[] { new SqlParameter("@Id", model.Id), new SqlParameter("@Sort", model.Sort) }; int i = Convert.ToInt32(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql, sqlParameter)); return(i > 0); }
public ActionResult UpdateSort(PersonalCenterCouponConfig model) { if (ExchangeCenterConfigManager.UpdatePersonalCenterCouponConfig(model)) { AutoReloadCache(); LoggerManager.InsertOplog(new ConfigHistory() { ObjectID = model.Id.ToString(), AfterValue = JsonConvert.SerializeObject(model), Author = User.Identity.Name, BeforeValue = "", ObjectType = "PCCPLoger", ChangeDatetime = DateTime.Now, Operation = "编辑优惠券顺序" + model.Id }); return(Json(true)); } else { return(Json(false)); } }
public bool UpdatePersonalCenterCouponConfig(PersonalCenterCouponConfig model) { try { return(DALExchangeCenterConfig.UpdatePersonalCenterCouponConfig(model)); } catch (TuhuBizException) { throw; } catch (Exception ex) { var exception = new ExchangeCenterConfigException(1, "InsertPersonalCenterCouponConfig", ex); Logger.Log(Level.Error, exception, "InsertPersonalCenterCouponConfig"); throw ex; } }
public static int InsertPersonalCenterCouponConfig(PersonalCenterCouponConfig model) { const string sql = @" INSERT INTO Configuration.dbo.[SE_PersonalCenterCouponConfig] ( [ExchangeCenterId] ,[HomePageModuleId] ,[Sort] ) VALUES ( @ExchangeCenterId , @HomePageModuleId, @Sort )SELECT @@IDENTITY "; var sqlParameter = new SqlParameter[] { new SqlParameter("@HomePageModuleId", model.HomePageModuleId), new SqlParameter("@ExchangeCenterId", model.ExchangeCenterId), new SqlParameter("@Sort", model.Sort), }; return(Convert.ToInt32(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql, sqlParameter))); }
public ActionResult EidtSort(PersonalCenterCouponConfig model) { return(View(model)); }