/// <summary> /// 绑定工程下的归档目录 /// </summary> /// <param name="SingleProjectID">工程ID</param> /// <param name="PID">PID=0</param> /// <param name="DataValueField">绑定主键</param> public void DataBindEx(int SingleProjectID, string PID, string DataValueField, string bh = null) { BLL.T_FileList_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL(); DataSet ds = new DataSet(); string strWhere = "SingleProjectID=" + SingleProjectID; if (!string.IsNullOrWhiteSpace(PID)) { strWhere += " AND PID=" + PID;; } if (bh != null) { strWhere += " AND IsFolder=1 and BH like '" + bh + "%'"; } ds = bll.GetList(strWhere); if (ds.Tables.Count > 0) { DropDownList1.DataTextField = "title"; DropDownList1.DataValueField = DataValueField; DropDownList1.DataSource = ds; DropDownList1.DataBind(); } DropDownList1.Items.Insert(0, new ListItem("无", "0")); }
public void DataBindEx(int SingleProjectID, bool IsFolder) { BLL.T_FileList_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL(); DataSet ds = new DataSet(); string strWhere2 = "SingleProjectID=" + SingleProjectID; if (IsFolder == true) { strWhere2 += " AND IsFolder='True'"; } ds = bll.GetList(strWhere2); if (ds.Tables.Count > 0) { DataTable outDT = ds.Tables[0].Copy(); outDT.Clear(); Recursion(ds.Tables[0], 0, 0, ref outDT); ds.Tables.Clear(); ds.Tables.Add(outDT); BLL.T_SingleProject_BLL spBLL = new T_SingleProject_BLL(); Model.T_SingleProject_MDL spMDL = spBLL.GetModel(SingleProjectID); string strWhere = "1=1"; if (Common.Session.GetSession("SuperAdmin").ToLower() == "true") {//Leo 超级管理员看全部 } else if (spMDL != null && spMDL.CompanyUserID == Common.ConvertEx.ToInt(Common.Session.GetSession("UserID"))) {//Leo 工程管理员也看全部 } else { strWhere += " and OperateUserID=" + Common.Session.GetSession("UserID"); } if (strWhere != "1=1") { if (ds.Tables.Count > 0) { DataView dv = ds.Tables[0].Copy().DefaultView; dv.RowFilter = strWhere; if (dv.Count != ds.Tables[0].Rows.Count) { ds.Tables[0].Clear(); ds.Tables.RemoveAt(0); ds.Tables.Add(dv.ToTable()); } } } } DropDownList1.DataTextField = "TitleNew"; DropDownList1.DataValueField = "FileListID"; DropDownList1.DataSource = ds; DropDownList1.DataBind(); //DropDownList1.Items.Insert(0, new ListItem("无", "0")); }
/// <summary> /// 绑定工程下的归档目录 /// </summary> /// <param name="SingleProjectID">工程ID</param> /// <param name="PID">PID=0</param> public void DataBindEx(int SingleProjectID, string PID) { BLL.T_FileList_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL(); DataSet ds = new DataSet(); ds = bll.GetList("SingleProjectID=" + SingleProjectID + " AND PID=" + PID); if (ds.Tables.Count > 0) { DropDownList1.DataTextField = "title"; DropDownList1.DataValueField = "recID"; DropDownList1.DataSource = ds; DropDownList1.DataBind(); } DropDownList1.Items.Insert(0, new ListItem("无", "0")); }