protected void Page_Load(object sender, EventArgs e) { string type = Request["t"]; if (!string.IsNullOrEmpty(type)) { Response.ContentEncoding = Encoding.UTF8; Response.ContentType = "application/json"; if (type.Equals("ListBind")) { Response.Write(ListBind()); } if (type.Equals("GetDwbm")) { EDRS.BLL.XT_ZZJG_DWBM bll = new EDRS.BLL.XT_ZZJG_DWBM(Request); Response.Write(bll.GetDwbm(UserInfo.DWBM, UserInfo.GH)); } if (type.Equals("GetYwbm")) { Response.Write(GetYwbm()); } if (type.Equals("DeriveData")) { Response.Write(DeriveData()); } Response.End(); } }
/// <summary> /// 绑定数据列表 /// </summary> /// <returns></returns> private string ListBindDW() { string where = ""; //switch (this.UserDwbm.DWJB) //{ // case "1": // where = " and sfgjysy='Y'"; // break; // case "2": // where = " and sfsysy='Y'"; // break; // case "3": // where = " and sfsjysy='Y'"; // break; // case "4": // where = " and sfqysy='Y'"; // break; //} EDRS.BLL.XT_ZZJG_DWBM dmbll = new EDRS.BLL.XT_ZZJG_DWBM(Request); //EDRS.Model.XT_ZZJG_DWBM dmmodel = dmbll.GetModel(UserInfo.DWBM); DataSet ds2 = dmbll.GetTreeList("", " DWBM=" + UserInfo.DWBM, false, null); if (ds2 != null && ds2.Tables.Count > 0 && ds2.Tables[0].Rows.Count > 1) { where += " and sfdjy='N' "; } //if (dmmodel != null && dmmodel.FDWBM != null && !string.IsNullOrEmpty(dmmodel.FDWBM)) // where += " and sfdjy='N' "; EDRS.BLL.XT_QX_GNDY bll = new EDRS.BLL.XT_QX_GNDY(Request); DataSet ds = bll.GetListByType(UserInfo.DWBM, where); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataTable dt = ds.Tables[0]; dt.Columns["FLBM"].ColumnName = "ID"; dt.Columns["FFLBM"].ColumnName = "PARENTID"; dt.Columns["FLMC"].ColumnName = "NAME"; dt.Columns.Add("icon"); foreach (DataRow dr in dt.Rows) { if (string.IsNullOrEmpty(dr["PARENTID"].ToString())) { dr["icon"] = "picon"; } else { dr["icon"] = "chicon"; } } return(new TreeJson(dt, "ID", "NAME", "PARENTID", "", "", "", true, true).ResultJson.ToString()); } return(ReturnString.JsonToString(Prompt.error, "未找到功能", null)); }