protected void BindList() { string BoxGuid = Request.QueryString["BoxGuid"]; DataView dvBoxRight = BoxRight.SelectHandleUser(BoxGuid); dvBoxRight.RowFilter = "HandleType='P'";//人员 lstUser.Items.Clear(); string UserGuid = ""; string UserName = ""; string UserGuidList = ""; for (int i = 0; i < dvBoxRight.Count; i++) { UserGuid = dvBoxRight[i]["HandleDetail"].ToString(); UserName = users.GetDetailByUserGuid(UserGuid).DisplayName; lstUser.Items.Add(new ListItem(UserName, UserGuid)); UserGuidList += UserGuid + "★"; } HidUserList.Value = UserGuidList; dvBoxRight.RowFilter = "HandleType='D'";//部门 lstOu.Items.Clear(); string DeptGuid = ""; string DeptName = ""; string DeptGuidList = ""; for (int i = 0; i < dvBoxRight.Count; i++) { DeptGuid = dvBoxRight[i]["HandleDetail"].ToString(); DeptName = depts.GetDetail(DeptGuid).OUName; lstOu.Items.Add(new ListItem(DeptName, DeptGuid)); DeptGuidList += DeptGuid + "★"; } HidOuList.Value = DeptGuidList; }
private void AddTopNodes() { EpointTreeNode node; DataView dv = mana.BoxSelectAll();//选择所有的邮箱 //if (System.Configuration.ConfigurationManager.AppSettings["IfNeedXinFangJu"] != "true") //{//只选择具有权限的信箱 //选择具有权限的信箱 DataView dvRight = mana.SelectHandleUser(); string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } dvRight.RowFilter = FilterStr; //选择所有的组别 DataView dvGroup = mana.BoxGroupSelectAll(); for (int i = 0; i < dvGroup.Count; i++) { //有信箱才添加 for (int j = 0; j < dvRight.Count; j++) // { dv.RowFilter = "BoxGroupID='" + dvGroup[i]["BoxGroupID"] + "' and BoxGuid='" + dvRight[j]["BoxGuid"] + "'"; //选出组下有权限的信箱 if (dv.Count > 0) { node = new EpointTreeNode(); node.Text = dvGroup[i]["BoxGroupName"].ToString(); node.Value = dvGroup[i]["BoxGroupID"].ToString(); if (i == 0) { node.Selected = true; } node.NavigateUrl = "ConsultBoxXinFangListMana.aspx?BoxGroupID=" + dvGroup[i]["BoxGroupID"]; node.PopulateOnDemand = true; TreeView1.Nodes.Add(node); break; } } } }
private bool HaveRightToProcess() { DataView dvRight = BoxMana.SelectHandleUser(treeSendToBox.Value); string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } dvRight.RowFilter = FilterStr; return(dvRight.Count > 0); }
public void BindGrid() { DataView myDt = mana.BoxSelectAll(); if (mGroupID != "") { myDt = mana.BoxSelectByBoxGroupID(mGroupID); } if (BoxGuid != "") { myDt.RowFilter = "BoxGuid='" + BoxGuid + "'"; } else { DataView dvRight = mana.SelectHandleUser(); string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } dvRight.RowFilter = FilterStr; string FilterBox = ""; for (int i = 0; i < dvRight.Count; i++) { FilterBox += "BoxGuid='" + dvRight[i]["BoxGuid"] + "'"; if (i < dvRight.Count - 1) { FilterBox += " or "; } } if (FilterBox != "") { myDt.RowFilter = FilterBox; } else { myDt.RowFilter = "1=2"; } } DataList1.DataSource = myDt; DataList1.DataBind(); }
protected void TreeView1_TreeNodePopulate1(object sender, EpointTreeNodeEventArgs e) { try { EpointTreeNode pNode = e.Node; DataView dv = mana.BoxSelectByBoxGroupID(pNode.Value); //选择组别下所有的邮箱 DataView dvRight = mana.SelectHandleUser(); //选择权限 string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } dvRight.RowFilter = FilterStr; EpointTreeNode node; for (int i = 0; i < dv.Count; i++) { for (int j = 0; j < dvRight.Count; j++) { if (dvRight[j]["BoxGuid"].ToString() == dv[i]["BoxGuid"].ToString()) { node = new EpointTreeNode(); node.Text = dv[i]["BoxName"].ToString(); node.Value = dv[i]["BoxGuid"].ToString(); node.PopulateOnDemand = false; node.NavigateUrl = "ConsultBoxMana.aspx?BoxGuid=" + dv[i]["BoxGuid"]; pNode.ChildNodes.Add(node); break; } } } } catch (Exception er) { Epoint.Common.Log.WriteLog(er.ToString()); } }
public void bindGrid() { DataGrid1.Columns[2].Visible = false; string Sql = " where 1=1 "; switch (jpdProcesstype.SelectedValue) { case "0": //未处理 Sql += " and HandleDate is null and Isdelete=0 and HandleStatus=0 "; DataGrid1.Columns[2].Visible = true; break; case "1": //已处理 Sql += " and HandleDate is not null and Isdelete=0 and (HandleStatus=9 or HandleStatus=8 or HandleStatus=3 or HandleStatus=2) "; break; case "2": //暂不处理 Sql += " and Isdelete=1 and HandleStatus!=3 and HandleBoxGuid='' "; break; case "3": //全部 break; } #region 出可用的信箱过滤 if (Request.QueryString["BoxGuid"] != "" && Request.QueryString["BoxGuid"] != null) { //选择单个信箱的内容 Sql += " and BoxGuid='" + Request.QueryString["BoxGuid"] + "'"; } else { //先选出所有具有权限的信箱 string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } DataView dvRight = BoxMana.SelectHandleUserBySql(FilterStr); if (Request.QueryString["BoxGroupID"] != "" && Request.QueryString["BoxGroupID"] != null) { //选择单个组别下的 DataView dvGroups = BoxMana.BoxSelectByBoxGroupID(Request.QueryString["BoxGroupID"]); //选择组别下所有的邮箱 FilterStr = "("; for (int i = 0; i < dvGroups.Count; i++) { dvRight.RowFilter = "BoxGuid='" + dvGroups[i]["BoxGuid"] + "'"; if (dvRight.Count > 0) { FilterStr += "'" + dvRight[0]["BoxGuid"].ToString() + "',"; } } if (FilterStr != "(") { Sql += " and BoxGuid in " + FilterStr.Substring(0, FilterStr.Length - 1) + ") "; } } else//选择所有的 { if (dvRight.Count == 0)//没有可用的信箱 { Sql += " and 1=2"; } else { if (dvRight.Count == 1) { Sql += " and BoxGuid='" + dvRight[0]["BoxGuid"].ToString() + "'"; } else { //FilterStr = "("; //for (int i = 0; i < dvRight.Count; i++) //{ // FilterStr += "'" + dvRight[i]["BoxGuid"].ToString() + "',"; //} //Sql += " and BoxGuid in " + FilterStr.Substring(0, FilterStr.Length - 1) + ") "; for (int i = 0; i < dvRight.Count; i++) { if (i == 0) { FilterStr = "('" + dvRight[i]["BoxGuid"].ToString() + "'"; } else if (i == dvRight.Count - 1) { FilterStr += ",'" + dvRight[i]["BoxGuid"].ToString() + "')"; } else { FilterStr += ",'" + dvRight[i]["BoxGuid"].ToString() + "'"; } } Sql += " and BoxGuid in " + FilterStr.ToString() + " "; } } } } #endregion if (txtpostuser.Text.Trim().Replace("'", "") != "") { Sql += " and PostUserName like '%" + txtpostuser.Text.Trim().Replace("'", "") + "%'"; } // added by lulj at 2009/4/27 if (this.txtConsultPWD.Text.Trim().Replace("'", "") != "") { Sql += " and ConsultPWD like '%" + txtConsultPWD.Text.Trim().Replace("'", "") + "%'"; } if (this.txtShouLiDept.Text.Trim().Replace("'", "") != "") { Sql += " and OUName like '%" + txtShouLiDept.Text.Trim().Replace("'", "") + "%'"; } int TotalNum = 0; DataView myDt; myDt = mana.GetDataPage( "*", "VIEW_WEBDBCONSULTANDHANDLE",// Sql, " order by OrderNum desc,Row_ID desc", "Row_ID", Pager.PageSize, Pager.CurrentPageIndex, txtTitle.Text, DateFromTo1.FromValue, DateFromTo1.ToValue, out TotalNum ); Pager.RecordCount = TotalNum; Pager.CustomInfoText = "记录总数:<font color=\"blue\"><b>" + Pager.RecordCount.ToString() + "</b></font>"; Pager.CustomInfoText += " 每页:<font color=\"blue\"><b>" + Pager.PageSize.ToString() + "</b></font>"; Pager.CustomInfoText += " 总页数:<font color=\"blue\"><b>" + Pager.PageCount.ToString() + "</b></font>"; Pager.CustomInfoText += " 当前页:<font color=\"red\"><b>" + Pager.CurrentPageIndex.ToString() + "</b></font>"; AspNetPager1.RecordCount = TotalNum; AspNetPager1.CustomInfoText = "记录总数:<font color=\"blue\"><b>" + Pager.RecordCount.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 每页:<font color=\"blue\"><b>" + Pager.PageSize.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 总页数:<font color=\"blue\"><b>" + Pager.PageCount.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 当前页:<font color=\"red\"><b>" + Pager.CurrentPageIndex.ToString() + "</b></font>"; Epoint.Frame.Bizlogic.common.DisplayPagerControl(Pager.PageCount, Pp1, Pp2); DataGrid1.DataSource = myDt; DataGrid1.DataBind(); /// 判断是否现实在网上发布列 if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("Consult_EnablePubAtReply").ConfigValue == "0") { foreach (DataGridColumn column in DataGrid1.Columns) { if (column.HeaderText == "网上发布") { column.Visible = false; } } } if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("IsShowConsultBoxManyidu").ConfigValue == "0") { foreach (DataGridColumn column in DataGrid1.Columns) { if (column.HeaderText == "满意度反馈") { column.Visible = false; } } } }
public void bindGrid() { string Sql = " where HandleBoxGuid='' "; switch (jpdProcesstype.SelectedValue) { case "0": //未分发 Sql += " and (InfoStatus=0 or infostatus=2) and Isdelete='0'"; break; case "1": //已分发 Sql += " and (InfoStatus =1 or infostatus=3) and Isdelete='0'"; break; case "2": //暂不处理 Sql += " and Isdelete='1'"; break; case "4": //待交办、已处理、未处理 Sql += " and Isdelete='0' and (InfoStatus =1 or infostatus=3 or InfoStatus=0 or infostatus=2 or InfoStatus=8)"; break; case "5": //待交办 Sql += " and Isdelete='0' and (InfoStatus =0 or infostatus=2)"; break; case "6": //未处理 Sql += " and Isdelete='0' and (InfoStatus =1 or infostatus=3)"; break; case "7": //已处理 Sql += " and Isdelete='0' and (InfoStatus=8)"; break; case "8": //已办结 Sql += " and Isdelete='0' and (InfoStatus=9)"; break; case "3": //全部 break; } #region 出可用的信箱过滤 if (Request.QueryString["BoxGuid"] != "" && Request.QueryString["BoxGuid"] != null) { //选择单个信箱的内容 Sql += " and UserSendToBoxGuid='" + Request.QueryString["BoxGuid"] + "'"; } else { //先选出所有具有权限的信箱 string FilterStr = "(HandleType='P' and HandleDetail='" + Session["UserGuid"].ToString() + "') "; string OuGuid = Session["OuGuid"].ToString(); while (OuGuid != "") { FilterStr += " or (HandleType='D' and HandleDetail='" + OuGuid + "') "; OuGuid = dept.GetDetail(OuGuid).ParentOUGuid; } DataView dvRight = BoxMana.SelectHandleUserBySql(FilterStr); if (Request.QueryString["BoxGroupID"] != "" && Request.QueryString["BoxGroupID"] != null) { //选择单个组别下的 DataView dvGroups = BoxMana.BoxSelectByBoxGroupID(Request.QueryString["BoxGroupID"]); //选择组别下所有的邮箱 FilterStr = "("; for (int i = 0; i < dvGroups.Count; i++) { dvRight.RowFilter = "BoxGuid='" + dvGroups[i]["BoxGuid"] + "'"; if (dvRight.Count > 0) { FilterStr += "'" + dvRight[0]["BoxGuid"].ToString() + "',"; } } if (FilterStr != "(") { Sql += " and UserSendToBoxGuid in " + FilterStr.Substring(0, FilterStr.Length - 1) + ") "; } } else//选择所有的 { if (dvRight.Count == 0)//没有可用的信箱 { Sql += " and 1=2"; } else { if (dvRight.Count == 1) { Sql += " and UserSendToBoxGuid='" + dvRight[0]["BoxGuid"].ToString() + "'"; } else { for (int i = 0; i < dvRight.Count; i++) { if (i == 0) { FilterStr = "('" + dvRight[i]["BoxGuid"].ToString() + "'"; } else if (i == dvRight.Count - 1) { FilterStr += ",'" + dvRight[i]["BoxGuid"].ToString() + "')"; } else { FilterStr += ",'" + dvRight[i]["BoxGuid"].ToString() + "'"; } } Sql += " and UserSendToBoxGuid in " + FilterStr.ToString() + " "; } } } } #endregion if (txtpostuser.Text.Trim().Replace("'", "") != "") { Sql += " and PostUserName like '%" + txtpostuser.Text.Trim().Replace("'", "") + "%'"; } int TotalNum = 0; DataView myDt; myDt = mana.GetDataPage( "*", "RG_ConsultHistory", Sql, " order by OrderNum desc,InfoKey desc", "InfoKey", Pager.PageSize, Pager.CurrentPageIndex, txtTitle.Text, DateFromTo1.FromValue, DateFromTo1.ToValue, out TotalNum ); Pager.RecordCount = TotalNum; Pager.CustomInfoText = "记录总数:<font color=\"blue\"><b>" + Pager.RecordCount.ToString() + "</b></font>"; Pager.CustomInfoText += " 每页:<font color=\"blue\"><b>" + Pager.PageSize.ToString() + "</b></font>"; Pager.CustomInfoText += " 总页数:<font color=\"blue\"><b>" + Pager.PageCount.ToString() + "</b></font>"; Pager.CustomInfoText += " 当前页:<font color=\"red\"><b>" + Pager.CurrentPageIndex.ToString() + "</b></font>"; AspNetPager1.RecordCount = TotalNum; AspNetPager1.CustomInfoText = "记录总数:<font color=\"blue\"><b>" + Pager.RecordCount.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 每页:<font color=\"blue\"><b>" + Pager.PageSize.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 总页数:<font color=\"blue\"><b>" + Pager.PageCount.ToString() + "</b></font>"; AspNetPager1.CustomInfoText += " 当前页:<font color=\"red\"><b>" + Pager.CurrentPageIndex.ToString() + "</b></font>"; Epoint.Frame.Bizlogic.common.DisplayPagerControl(Pager.PageCount, Pp1, Pp2); DataGrid1.DataSource = myDt; DataGrid1.DataBind(); }