public List <Lebi_Supplier_Limit> GetLimit(int pid) { List <Lebi_Supplier_Limit> ls = B_Lebi_Supplier_Limit.GetList("parentid=" + pid + "", "Sort desc"); if (ls == null) { ls = new List <Lebi_Supplier_Limit>(); } return(ls); }
/// <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\"}"); }
public List <Lebi_Supplier_Limit> GetLimit(int pid, string pcode = "") { string where = ""; where = "parentid=" + pid + ""; if (pcode != "") { where = "parentid in (select id from [Lebi_Supplier_Limit] where Code='" + pcode + "')"; } if (pid == 0) { where += " and Code<>'default'"; } List <Lebi_Supplier_Limit> ls = B_Lebi_Supplier_Limit.GetList(where, "Sort desc"); if (ls == null) { ls = new List <Lebi_Supplier_Limit>(); } return(ls); }
/// <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\"}"); }