public Lebi_ServicePanel_Group GetGroup(int group_id) { Lebi_ServicePanel_Group group = B_Lebi_ServicePanel_Group.GetModel(group_id); if (group == null) { group = new Lebi_ServicePanel_Group(); } return(group); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (!Power("supplier_servicepanel_list", "客服面板")) { WindowNoPower(); } model = B_Lebi_ServicePanel_Group.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { model = new Lebi_ServicePanel_Group(); } }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (id == 0) { if (!EX_Admin.Power("servicepanel_group_add", "添加客服面板部门")) { WindowNoPower(); } } else { if (!EX_Admin.Power("servicepanel_group_edit", "编辑客服面板部门")) { WindowNoPower(); } } model = B_Lebi_ServicePanel_Group.GetModel(id); if (model == null) { model = new Lebi_ServicePanel_Group(); } }
/// <summary> /// 编辑客服面板部门信息 /// </summary> public void ServicePanel_Group_Edit() { if (!Power("supplier_servicepanel_list", "客服面板")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); bool addflag = false; Lebi_ServicePanel_Group model = B_Lebi_ServicePanel_Group.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { addflag = true; model = new Lebi_ServicePanel_Group(); } model = B_Lebi_ServicePanel_Group.SafeBindForm(model); model.Name = RequestTool.RequestSafeString("Name"); model.Language_ids = RequestTool.RequestSafeString("Language_ids"); model.Sort = RequestTool.RequestInt("Sort", 0); if (addflag) { model.Supplier_id = CurrentSupplier.id; B_Lebi_ServicePanel_Group.Add(model); id = B_Lebi_ServicePanel_Group.GetMaxId(); Log.Add("添加客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name); } else { B_Lebi_ServicePanel_Group.Update(model); Log.Add("编辑客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name); } string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }