//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.online_service_group bll = new BLL.online_service_group(); Model.online_service_group model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) bll.UpdateField(id, "is_lock=0"); else bll.UpdateField(id, "is_lock=1"); break; } this.RptBind("", "sort_id asc,id desc"); }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.online_service_group bll = new BLL.online_service_group(); Model.online_service_group model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) { bll.UpdateField(id, "is_lock=0"); } else { bll.UpdateField(id, "is_lock=1"); } break; } this.RptBind("", "sort_id asc,id desc"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_lineservice_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.online_service_group bll = new BLL.online_service_group(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改分组成功排序"); //记录日志 JscriptMsg("保存排序成功!", "group_list.aspx"); }