/// <summary> /// 编辑桌面菜单 /// </summary> public void SaveIndexMenu() { if (!Power("supplier_menu_edit", "编辑分组菜单")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("gid", 0); Lebi_Supplier_UserGroup group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id); if (group == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } if (group.Supplier_id != CurrentSupplier.id) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } group.Menu_ids_index = RequestTool.RequestSafeString("id"); B_Lebi_Supplier_UserGroup.Update(group); Log.Add("编辑分组桌面菜单", "Supplier_User", id.ToString(), CurrentSupplier, "用户:" + CurrentUser.UserName); Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 删除会员分组 /// </summary> public void Group_Del() { string id = RequestTool.RequestSafeString("id"); if (!Power("supplier_group_del", "删除用户分组")) { AjaxNoPower(); return; } if (id != "") { List <Lebi_Supplier_UserGroup> models = B_Lebi_Supplier_UserGroup.GetList("Supplier_id=" + CurrentSupplier.id + " and id in (lbsql{" + id + "})", ""); foreach (Lebi_Supplier_UserGroup model in models) { int Level_id = 1; Lebi_Supplier_UserGroup tmodel = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and Sort>" + model.Sort + " order by Sort asc"); if (tmodel == null) { Level_id = 0; } else { Level_id = tmodel.id; } Common.ExecuteSql("Update Lebi_Supplier_User set Supplier_UserGroup_id = " + Level_id + " where Supplier_UserGroup_id = " + model.id + ""); B_Lebi_Supplier_UserGroup.Delete(model.id); } Log.Add("删除用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, id.ToString()); } Response.Write("{\"msg\":\"OK\"}"); }
public string GetGroupName(int id) { Lebi_Supplier_UserGroup model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id = " + id); if (model == null) { return(Tag("未分组")); } return(model.Name); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (!Power("supplier_group_edit", "编辑用户分组")) { AjaxNoPower(); } model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { model = new Lebi_Supplier_UserGroup(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_menu_edit", "编辑分组菜单")) { AjaxNoPower(); return; } models = GetMenu(0); int id = RequestTool.RequestInt("id", 0); group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (group == null) { PageError(); } ids = "," + group.Menu_ids + ","; }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_usergroup_list", "用户分组列表")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); key = RequestTool.RequestString("key"); string where = "Supplier_id=" + CurrentSupplier.id; if (key != "") { where += " and Name like lbsql{'%" + key + "%'}"; } models = B_Lebi_Supplier_UserGroup.GetList(where, "Sort desc", PageSize, page); int recordCount = B_Lebi_Supplier_UserGroup.Counts(where); PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&key=" + key, page, PageSize, recordCount); }
/// <summary> /// 编辑分组权限 /// </summary> public void SavePower() { if (!Power("supplier_power_edit", "编辑分组权限")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("gid", 0); Lebi_Supplier_UserGroup group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id); if (group == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } if (group.Supplier_id != CurrentSupplier.id) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } group.Limit_ids = RequestTool.RequestSafeString("id"); string codes = ""; if (group.Limit_ids != "") { List <Lebi_Supplier_Limit> models = B_Lebi_Supplier_Limit.GetList("id in (" + group.Limit_ids + ")", ""); foreach (Lebi_Supplier_Limit model in models) { if (codes == "") { codes = "'" + model.Code + "'"; } else { codes += "," + "'" + model.Code + "'"; } } } group.Limit_Codes = codes; B_Lebi_Supplier_UserGroup.Update(group); Log.Add("编辑分组桌面菜单", "Supplier_User", id.ToString(), CurrentSupplier, "用户:" + CurrentUser.UserName); Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 编辑等级分组 /// </summary> public void Group_Edit() { int id = RequestTool.RequestInt("id", 0); Lebi_Supplier_UserGroup model = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id=" + CurrentSupplier.id + " and id =" + id); if (model == null) { model = new Lebi_Supplier_UserGroup(); } B_Lebi_Supplier_UserGroup.SafeBindForm(model); model.Supplier_id = CurrentSupplier.id; if (model.id == 0) { if (!Power("supplier_group_add", "添加用户分组")) { AjaxNoPower(); return; } model.User_id_Add = CurrentUser.id; B_Lebi_Supplier_UserGroup.Add(model); id = B_Lebi_Supplier_UserGroup.GetMaxId(); Log.Add("添加用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, model.Name); } else { if (!Power("supplier_group_edit", "编辑用户分组")) { AjaxNoPower(); return; } model.User_id_Edit = CurrentUser.id; model.Time_Edit = System.DateTime.Now; B_Lebi_Supplier_UserGroup.Update(model); Log.Add("编辑用户分组", "Supplier_Group", id.ToString(), CurrentSupplier, model.Name); } string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_power_edit", "编辑分组权限")) { AjaxNoPower(); return; } models = GetLimit(0); int id = RequestTool.RequestInt("id", 0); group = B_Lebi_Supplier_UserGroup.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (group == null) { PageError(); } ps = B_Lebi_Supplier_Power.GetList("Supplier_Group_id=" + group.id + " and Url=''", ""); defaultparent = B_Lebi_Supplier_Limit.GetModel("Code='default'"); if (defaultparent != null) { count = B_Lebi_Supplier_Limit.Counts("parentid = " + defaultparent.id + ""); //未分组 } }