private void BindEWFCC() { DataTable dt = EWF_Task_JobCCBLL.GetListByRecipientStaff((int)Session["UserID"], DateTime.Now.AddDays(-7), DateTime.Now); dt.DefaultView.RowFilter = "ReadFlag='N' OR (ReadTime>'" + DateTime.Today + "')"; gv_EWFCCList.DataSource = dt.DefaultView; gv_EWFCCList.DataBind(); }
private void BindGrid() { DateTime dtBegin = DateTime.Parse(tbx_begin.Text); DateTime dtEnd = DateTime.Parse(tbx_end.Text).AddDays(1); DataTable dt = EWF_Task_JobCCBLL.GetListByRecipientStaff((int)Session["UserID"], dtBegin, dtEnd); string condition = " 1 = 1 "; if (ddl_App.SelectedValue != "0") { condition += " AND App = '" + ddl_App.SelectedValue + "'"; } if (tbx_MessageSubject.Text != "") { condition += " AND (Title LIKE '%" + tbx_MessageSubject.Text + "%' OR MessageSubject LIKE '%" + tbx_MessageSubject.Text + "%')"; } #region 判断当前可查询的范围 string orgcitys = ""; if (tr_OrganizeCity.SelectValue != "1" && tr_OrganizeCity.SelectValue != "0") { Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true); orgcitys = orgcity.GetAllChildNodeIDs(); if (orgcitys != "") { orgcitys += ","; } orgcitys += tr_OrganizeCity.SelectValue; condition += " AND OrganizeCity IN (" + orgcitys + ")"; } #endregion if (tbx_InitiatorStaffName.Text != "") { condition += " AND ApplyStaffName LIKE '%" + tbx_InitiatorStaffName.Text + "%'"; } if (ddl_ReadFlag.SelectedValue != "0") { condition += "AND ReadFlag='" + ddl_ReadFlag.SelectedValue + "'"; } dt.DefaultView.RowFilter = condition; dt.DefaultView.Sort = " TaskID desc "; gv_List.DataSource = dt.DefaultView; gv_List.TotalRecordCount = dt.DefaultView.Count; gv_List.PageIndex = (int)ViewState["PageIndex"]; gv_List.DataBind(); }