private string CreatSelect(int id) { string str = "<select id=\"Area_" + id + "\" onchange=\"SelectAreaList(" + topid + ",'Area_" + id + "');\">"; Lebi_Area area = B_Lebi_Area.GetModel(id); if (area == null) { return(""); } if (topid == area.id) { return(""); } List <Lebi_Area> models = B_Lebi_Area.GetList("Parentid=" + area.Parentid + "", "Sort asc"); if (models.Count == 0) { return(""); } foreach (Lebi_Area model in models) { if (id == model.id) { str += "<option value=\"" + model.id + "\" selected>" + model.Name + "</option>"; } else { str += "<option value=\"" + model.id + "\">" + model.Name + "</option>"; } } str += "</select> "; str = CreatSelect(area.Parentid) + str; return(str); }
/// <summary> /// 批量添加代理地区 /// </summary> public void AreaAgent_MutiAdd() { int id = RequestTool.RequestInt("id", 0); int Area_id = RequestTool.RequestInt("Area_id", 0); int PArea_id = RequestTool.RequestInt("PArea_id", 0); List <Lebi_Area> areas = B_Lebi_Area.GetList("Parentid=" + PArea_id + "", ""); Lebi_Agent_Area model; foreach (Lebi_Area area in areas) { int count = B_Lebi_Agent_Area.Counts("Area_id=" + area.id + ""); if (count > 0) { continue; } model = new Lebi_Agent_Area(); B_Lebi_Agent_Area.BindForm(model); model.Area_id = area.id; B_Lebi_Agent_Area.Add(model); } Log.Add("批量添加代理区域", "Agent_Area", id.ToString(), CurrentAdmin, ""); string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { notid = RequestTool.RequestString("notid"); if (notid == "") { notid = "0"; } int pid = RequestTool.RequestInt("pid", 0); models = B_Lebi_Area.GetList("parentid=" + pid + " and id not in (lbsql{" + notid + "})", ""); }
/// <summary> /// 编辑配送区域价格 /// </summary> public void Transport_Price_Edit() { if (!Power("supplier_transport_list", "配送方式")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); int tid = RequestTool.RequestInt("tid", 0); Lebi_Transport tmodel = B_Lebi_Transport.GetModel(tid); Lebi_Transport_Price model = B_Lebi_Transport_Price.GetModel("id = " + id + " and Supplier_id = " + CurrentSupplier.id + ""); if (model != null) { int Area_id = model.Area_id; B_Lebi_Transport_Price.SafeBindForm(model); model.Transport_id = tmodel.id; model.Area_id = Area_id; B_Lebi_Transport_Price.Update(model); Log.Add("编辑配送区域", "Transport_Price", id.ToString(), CurrentSupplier, tmodel.Name); } else { string aids = RequestTool.RequestString("Area_ids"); if (aids == "") { aids = "0"; } List <Lebi_Area> areas = B_Lebi_Area.GetList("id in (lbsql{" + aids + "})", ""); model = new Lebi_Transport_Price(); foreach (Lebi_Area area in areas) { //避免重复添加 int count = B_Lebi_Transport_Price.Counts("Transport_id=" + tmodel.id + " and Area_id=" + area.id + " and Supplier_id = " + CurrentSupplier.id + ""); if (count > 0) { continue; } B_Lebi_Transport_Price.SafeBindForm(model); model.Area_id = area.id; model.Transport_id = tmodel.id; model.Supplier_id = CurrentSupplier.id; B_Lebi_Transport_Price.Add(model); } Log.Add("添加配送区域", "Transport_Price", id.ToString(), CurrentSupplier, tmodel.Name); } Response.Write("{\"msg\":\"OK\"}"); }
public string areas(int sid) { List <Lebi_Area> areas = B_Lebi_Area.GetList("Parentid=0", "Sort desc"); string str = ""; foreach (Lebi_Area area in areas) { string sel = ""; if (sid == area.id) { sel = "selected"; } str += "<option " + sel + " value=\"" + area.id + "\">" + area.Name + "</option>"; } return(str); }
//protected List<Lebi_Area> models; public void LoadPage() { topid = RequestTool.RequestInt("topid", 0); area_id = RequestTool.RequestInt("area_id", 0); int Parentid = 0; area_id = area_id == 0 ? topid : area_id; List <Lebi_Area> models = B_Lebi_Area.GetList("Parentid=" + area_id + "", "Sort asc"); Lebi_Area area = B_Lebi_Area.GetModel(area_id); if (models.Count == 0) { Parentid = area.Parentid; models = B_Lebi_Area.GetList("Parentid=" + Parentid + "", "Sort asc"); } else { Parentid = area_id; } string str = "<select id=\"Area_id\" onchange=\"SelectAreaList(" + topid + ",'Area_id');\">"; str += "<option value=\"0\" selected>" + Tag(" 请选择 ") + "</option>"; foreach (Lebi_Area model in models) { if (area_id == model.id) { str += "<option value=\"" + model.id + "\" selected>" + model.Name + "</option>"; } else { str += "<option value=\"" + model.id + "\">" + model.Name + "</option>"; } } str += "</select> "; //if (models.Count > 0) // str += CreatSelect(models.FirstOrDefault().id); str = CreatSelect(Parentid) + str; Response.Write(str); }
public string ThreadGetAreaList(int topid, int area_id, int Parentid) { List <Lebi_Area> models = B_Lebi_Area.GetList("Parentid=" + area_id + "", "Sort desc"); Lebi_Area area = B_Lebi_Area.GetModel(area_id); if (area == null) { area = new Lebi_Area(); } if (models.Count == 0) { Parentid = area.Parentid; models = B_Lebi_Area.GetList("Parentid=" + Parentid + "", "Sort desc"); } else { Parentid = area_id; } string str = "<select id=\"Area_id\" onchange=\"SelectAreaList(" + topid + ",'Area_id');\" class=\"form-control\">"; str += "<option value=\"0\" selected>" + Tag(" 请选择 ") + "</option>"; foreach (Lebi_Area model in models) { if (area_id == model.id) { str += "<option value=\"" + model.id + "\" selected>" + model.Name + "</option>"; } else { str += "<option value=\"" + model.id + "\">" + model.Name + "</option>"; } } str += "</select>"; if (topid != area_id) { str = CreatSelect(Parentid, topid) + str; } return(str); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("area_list", "地区列表")) { PageReturnMsg = PageNoPowerMsg(); } pid = RequestTool.RequestInt("pid", 0); key = RequestTool.RequestString("key"); PageSize = RequestTool.getpageSize(25); string where = "Parentid=" + pid; //if (pid > 0) // where += " and Parentid="+pid; if (key != "") { where += " and [Name] like lbsql{'%" + key + "%'}"; } //PageSize = 5; models = B_Lebi_Area.GetList(where, "Sort desc", PageSize, page); int recordCount = B_Lebi_Area.Counts(where); PageString = Pager.GetPaginationString("?page={0}&pid=" + pid + "&key=" + key, page, PageSize, recordCount); }
public string GetAreas(int pid, int deep, string tag = "") { StringBuilder sb = new StringBuilder(); List <Lebi_Area> areas = B_Lebi_Area.GetList("Parentid=" + pid + "", "Sort desc"); Lebi_Agent_Area model; string where = ""; foreach (Lebi_Area area in areas) { if (!IsShow(area.id)) { continue; } where = "Area_id=" + area.id + ""; //if (key != "") // where += " and User_UserName like '%" + key + "%'"; //if (status > 0) //{ // if (status == 1) // where += " and User_id>0"; // if (status == 2) // where += " and User_id=0"; //} model = B_Lebi_Agent_Area.GetModel(where); if (model == null) { sb.Append("<tr class=\"list\" " + tag + "><td> </td><td colspan=\"10\">" + deepstr(deep) + "<img id=\"img" + area.id + "\" onclick=\"ShowChild(" + area.id + ")\" src=\"" + AdminImage("minus.gif") + "\"/> " + area.Name + "</td></tr>"); string newtag = ""; if (tag == "") { newtag = "t" + area.id + "=\"true\""; } else { newtag = tag + " t" + area.id + "=\"true\""; } sb.Append(GetAreas(area.id, deep + 1, newtag)); } else { string style = ""; if (model.User_id > 0 && model.Time_end > System.DateTime.Now) { style = "style=\"color:red;\""; } sb.Append("<tr class=\"list\" " + tag + " ondblclick=\"Edit(" + model.id + ")\">"); sb.Append("<td class=\"center\"><input type=\"checkbox\" value=\"" + model.id + "\" name=\"sid\" /></td>"); sb.Append("<td " + style + ">" + deepstr(deep) + "<img id=\"img" + area.id + "\" src=\"" + AdminImage("minus.gif") + "\" onclick=\"ShowChild(" + area.id + ")\"/> " + Shop.Bussiness.EX_Area.GetAreaName(model.Area_id, 1) + "</td>"); sb.Append("<td>" + model.User_UserName + "</td>"); sb.Append("<td>" + DefaultCurrency.Msige + " " + model.Price + "</td>"); sb.Append("<td>" + model.Commission_1 + "</td>"); sb.Append("<td>" + model.Commission_2 + "</td>"); sb.Append("<td>" + GetCOrder(model.CardOrder_id) + "</td>"); sb.Append("<td>" + model.Time_add.ToShortDateString() + "</td>"); sb.Append("<td>" + model.Time_end.ToShortDateString() + "</td>"); sb.Append("<td>" + (model.IsFailure == 1 ? Tag("失效") : Tag("正常")) + "</td>"); sb.Append("<td><a href=\"javascript:void(0)\" onclick=\"Edit(" + model.id + ")\">" + Tag("编辑") + "</a>"); sb.Append(" | <a href=\"javascript:void(0)\" onclick=\"AreaAgentUser_Edit(" + model.id + ")\">" + Tag("绑定") + "</a>"); sb.Append(" | <a href=\"agentmoney.aspx?areaid=" + model.Area_id + "\">" + Tag("查看佣金") + "</a>"); sb.Append("</td></tr>"); } } return(sb.ToString()); }