/// <summary> /// 编辑项目 /// </summary> public void Project_Edit() { if (!EX_Admin.Power("admin_project", "项目列表")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); Lebi_Project model = B_Lebi_Project.GetModel(id); if (model == null) { model = new Lebi_Project(); B_Lebi_Project.SafeBindForm(model); model.Supplier_ids = RequestTool.RequestSafeString("Supplier_ids"); model.Site_ids = RequestTool.RequestSafeString("Site_ids"); model.Pro_Type_ids = RequestTool.RequestSafeString("Pro_Type_ids"); B_Lebi_Project.Add(model); Log.Add("添加项目", "Project", model.id.ToString(), CurrentAdmin, model.Name); } else { B_Lebi_Project.SafeBindForm(model); model.Supplier_ids = RequestTool.RequestString("Supplier_ids"); model.Site_ids = RequestTool.RequestString("Site_ids"); model.Pro_Type_ids = RequestTool.RequestSafeString("Pro_Type_ids"); B_Lebi_Project.Update(model); Log.Add("编辑项目", "Project", model.id.ToString(), CurrentAdmin, model.Name); } Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 删除管理员 /// </summary> public void Project_Del() { if (!EX_Admin.Power("admin_project", "项目列表")) { AjaxNoPower(); return; } string ids = RequestTool.RequestString("id"); B_Lebi_Project.Delete("id in (lbsql{" + ids + "})"); Log.Add("删除项目", "Project", ids, CurrentAdmin, ids); Response.Write("{\"msg\":\"OK\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("admin_project", "项目列表")) { PageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Project.GetModel(id); if (model == null) { model = new Lebi_Project(); } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("admin_project", "项目列表")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); string where = "1=1"; models = B_Lebi_Project.GetList(where, "Sort desc", PageSize, page); int recordCount = B_Lebi_Project.Counts(where); PageString = Pager.GetPaginationString("?page={0}", page, PageSize, recordCount); }
public static Lebi_Project Project() { Lebi_Project project = new Lebi_Project(); if (!string.IsNullOrEmpty(CurrentAdmin().Project_ids)) { project = B_Lebi_Project.GetModel("id in(" + CurrentAdmin().Project_ids + ")"); if (project == null) { project = new Lebi_Project(); } } else { project.Pro_Type_ids = CurrentAdmin().Pro_Type_ids; project.Site_ids = CurrentAdmin().Site_ids; } return(project); }
/// <summary> /// 管理项目选择 /// </summary> /// <param name="InputName"></param> /// <param name="ids"></param> /// <param name="lang"></param> /// <returns></returns> public string ProjectCheckbox(string InputName, string ids) { List <Lebi_Project> models = B_Lebi_Project.GetList("", "Sort desc"); string str = ""; foreach (Lebi_Project model in models) { string sel = ""; if (("," + ids + ",").IndexOf("," + model.id + ",") > -1) { sel = "checked"; } if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim())) { str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"" + InputName + "" + model.id + "\" name=\"" + InputName + "\" value=\"" + model.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">" + model.Name + "</span></label>"; } else { str += "<label><input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + ">" + model.Name + " </label>"; } } return(str); }