/// <summary> /// 编辑权限-编辑过滤页面 /// </summary> public void url_Edit() { if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); int gid = RequestTool.RequestInt("gid", 0); string url = RequestTool.RequestString("Url"); Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(gid); if (url == "") { Response.Write("{\"msg\":\"" + Tag("地址不能为空") + "\"}"); return; } if (group == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } Lebi_Supplier_Power p = B_Lebi_Supplier_Power.GetModel(id); if (p == null) { p = B_Lebi_Supplier_Power.GetList("Admin_Group_id=" + group.id + " and Url=lbsql{'" + url + "'}", "").FirstOrDefault(); if (p != null) { Response.Write("{\"msg\":\"" + Tag("地址已经存在") + "\"}"); return; } p = new Lebi_Supplier_Power(); p.Supplier_Group_id = group.id; p.Url = url; B_Lebi_Supplier_Power.Add(p); string action = Tag("添加过滤页面"); string description = url; Log.Add(action, "Supplier_Group", p.id.ToString(), CurrentAdmin, description); } else { p.Url = url; B_Lebi_Supplier_Power.Update(p); string action = Tag("编辑过滤页面"); string description = url; Log.Add(action, "Supplier_Group", p.id.ToString(), CurrentAdmin, description); } Response.Write("{\"msg\":\"OK\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组")) { PageNoPower(); } int id = RequestTool.RequestInt("id", 0); int gid = RequestTool.RequestInt("gid", 0); model = B_Lebi_Supplier_Power.GetModel(id); if (model == null) { model = new Lebi_Supplier_Power(); } else { gid = model.Supplier_Group_id; } group = B_Lebi_Supplier_Group.GetModel(gid); }
/// <summary> /// 编辑权限-删除过滤页面 /// </summary> public void url_Del() { if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组")) { AjaxNoPower(); return; } string id = RequestTool.RequestString("uid"); if (id == "") { Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_Power.Delete("id in (lbsql{" + id + "})"); string action = Tag("删除过滤页面"); string description = id; Log.Add(action, "Supplier_Group", id, CurrentAdmin, description); Response.Write("{\"msg\":\"OK\"}"); }
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 + ""); //未分组 } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组")) { PageReturnMsg = PageNoPowerMsg(); } models = GetLimit(0); int id = RequestTool.RequestInt("id", 0); group = B_Lebi_Supplier_Group.GetModel(id); if (group == null) { PageError(); } ps = B_Lebi_Supplier_Power.GetList("Supplier_Group_id=" + group.id + " and Url=''", ""); purls = 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 + ""); //未分组 } }
/// <summary> /// 保存权限 /// </summary> public void SavePower() { if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组")) { AjaxNoPower(); return; } string ids = RequestTool.RequestString("id"); int gid = RequestTool.RequestInt("gid", 0); Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(gid); if (group == null) { Response.Write("{\"msg" + Tag("参数错误") + "\"}"); return; } B_Lebi_Supplier_Power.Delete("Supplier_Group_id=" + group.id + ""); List <Lebi_Supplier_Limit> models = B_Lebi_Supplier_Limit.GetList("id in (lbsql{" + ids + "})", ""); if (models != null) { Lebi_Supplier_Power p = new Lebi_Supplier_Power(); foreach (Lebi_Supplier_Limit model in models) { p.Supplier_Group_id = group.id; p.Supplier_Limit_Code = model.Code; p.Supplier_Limit_id = model.id; B_Lebi_Supplier_Power.Add(p); } } string action = Tag("编辑权限"); string description = Shop.Bussiness.Language.Content(group.Name, "CN"); Log.Add(action, "Supplier_Group", gid.ToString(), CurrentAdmin, description); Response.Write("{\"msg\":\"OK\"}"); }