public int AddButtonGroup(ButtonGroup model) { string cmdText = "INSERT INTO [ButtonGroup] ( ButtonName,BtnCode,Icon,Sort,Remark) VALUES (@ButtonName,@BtnCode,@Icon,@Sort,@Remark)"; SqlParameter[] parameters = { SqlParamHelper.MakeInParam("@ButtonName",SqlDbType.VarChar,50,model.ButtonName), SqlParamHelper.MakeInParam("@BtnCode",SqlDbType.VarChar,50,model.BtnCode), SqlParamHelper.MakeInParam("@Icon",SqlDbType.VarChar,50,model.Icon), SqlParamHelper.MakeInParam("@Sort",SqlDbType.Int,4,model.Sort), SqlParamHelper.MakeInParam("@Remark",SqlDbType.VarChar,100,model.Remark) }; return SqlHelper.ExecuteNonQuery(WriteConnectionString,CommandType.Text,cmdText,parameters); }
private void AddButtonGroup() { int Id = GetRequestString("Id").ToInt32(); string Name = GetRequestString("Name"); string Code = GetRequestString("Code"); string Icon = GetRequestString("Icon"); int sort = GetRequestString("sort").ToInt32(); string remark = GetRequestString("remark"); ButtonGroup model = new ButtonGroup(); model.ButtonName = Name; model.BtnCode = Code; model.Remark = remark; int maxSort = _AuthorizeService.GetMaxSortButtonGroupSort(); model.Icon = Icon; if(sort > maxSort){ model.Sort = maxSort; } else{ model.Sort = sort; } _AuthorizeService.AddButtonGroup(model); }
public int AddButtonGroup(ButtonGroup model) { return _AuthorizeRepository.AddButtonGroup(model); }
public int UpdateButtonGroup(ButtonGroup model) { return _AuthorizeRepository.UpdateButtonGroup(model); }
public int UpdateButtonGroup(ButtonGroup model) { string cmdText = "UPDATE [ButtonGroup] SET ButtonName=@ButtonName,BtnCode=@BtnCode,Icon=@Icon,Sort=@Sort,Remark=@Remark WHERE Id=@Id"; SqlParameter[] parameters = { SqlParamHelper.MakeInParam("@ButtonName",SqlDbType.VarChar,50,model.ButtonName), SqlParamHelper.MakeInParam("@BtnCode",SqlDbType.VarChar,50,model.BtnCode), SqlParamHelper.MakeInParam("@Icon",SqlDbType.VarChar,50,model.Icon), SqlParamHelper.MakeInParam("@Sort",SqlDbType.Int,4,model.Sort), SqlParamHelper.MakeInParam("@Remark",SqlDbType.VarChar,100,model.Remark), SqlParamHelper.MakeInParam("@Id",SqlDbType.Int,4,model.Id) }; return SqlHelper.ExecuteNonQuery(WriteConnectionString,CommandType.Text,cmdText,parameters); }