protected void LoadPage() { string strWrite = ""; string strKeyword = ""; lblQueryResult.Visible = false; DateTime dtStartDate = new DateTime(); DateTime dtEndDate = new DateTime(); string username = Request.Cookies["Speedo"]["UserName"]; if (!string.IsNullOrEmpty(Request.QueryString["DateStart"])) { dtStartDate = DateTime.ParseExact(Request.QueryString["DateStart"].ToString(), "MMMddyyyy", null); } else { dtStartDate = DateTime.Parse("1/1/1990"); } if (!string.IsNullOrEmpty(Request.QueryString["DateEnd"])) { dtEndDate = DateTime.ParseExact(Request.QueryString["DateEnd"].ToString(), "MMMddyyyy", null); } else { dtEndDate = DateTime.Now; } if (!string.IsNullOrEmpty(Request.QueryString["Keyword"])) { strKeyword = Request.QueryString["Keyword"].ToString(); } else { strKeyword = ""; } using (clsPagination objPagination = new clsPagination()) { objPagination.CurrentPage = string.IsNullOrEmpty(Request.QueryString["Page"]) == true ? 1 : Request.QueryString["Page"].ToInt(); objPagination.PagePerForm = 10; objPagination.TotalCount = clsEFormsReport.RFPCountArchives(username, DateTime.Parse(dtStartDate.ToShortDateString() + " 1:00 AM"), DateTime.Parse(dtEndDate.ToShortDateString() + " 11:59 PM"), Request.QueryString["Status"].ToString(), strKeyword); string strDateStart = dtStartDate.ToString("MMMddyyyy"); string strDateEnd = dtEndDate.ToString("MMMddyyyy"); ddlPages.Items.Clear(); for (int i = 1; i <= objPagination.TotalPage(); i++) { ListItem l = new ListItem(i.ToString(), i.ToString(), true); l.Selected = l.Value == objPagination.CurrentPage.ToString() ? true : false; ddlPages.Items.Add(l); } } lblPage.Text = strWrite; }
protected void LoadPage() { string strWrite = ""; DateTime dtStartDate = new DateTime(); DateTime dtEndDate = new DateTime(); string strCategory = ""; string strKeyword = ""; if (!string.IsNullOrEmpty(Request.QueryString["DateStart"])) { dtStartDate = DateTime.ParseExact(Request.QueryString["DateStart"].ToString(), "MMMddyyyy", null); } else { dtStartDate = DateTime.Parse("1/1/1990"); } if (!string.IsNullOrEmpty(Request.QueryString["DateEnd"])) { dtEndDate = DateTime.ParseExact(Request.QueryString["DateEnd"].ToString(), "MMMddyyyy", null); } else { dtEndDate = DateTime.Now; } if (!string.IsNullOrEmpty(Request.QueryString["Category"])) { strCategory = Request.QueryString["Category"].ToString(); } else { strCategory = "ALL"; } if (!string.IsNullOrEmpty(Request.QueryString["Keyword"])) { strKeyword = Request.QueryString["Keyword"].ToString(); } using (clsPagination objPagination = new clsPagination()) { objPagination.CurrentPage = string.IsNullOrEmpty(Request.QueryString["Page"]) == true ? 1 : Request.QueryString["Page"].ToInt(); objPagination.PagePerForm = 10; objPagination.TotalCount = DALThread.GetThreadArchiveCount(strCategory, DateTime.Parse(dtStartDate.ToShortDateString() + " 1:00 AM"), DateTime.Parse(dtEndDate.ToShortDateString() + " 11:59 PM"), strKeyword); string strDateStart = dtStartDate.ToString("MMMddyyyy"); string strDateEnd = dtEndDate.ToString("MMMddyyyy"); //if (objPagination.TotalPage() > 1) //{ // if (objPagination.HasPreviousPage()) // { // strWrite += "<a href='ThreadQueryResult.aspx?Page=" + objPagination.PreviousPage() + "&Category=" + strCategory + "&DateStart=" + strDateStart + "&DateEnd=" + strDateEnd + "'> «Previous</a>"; // } // int i = 0; // for (i = 1; i <= objPagination.TotalPage(); i++) // { // if (i == objPagination.CurrentPage) // { // strWrite += "<span><b>" + i + "</b></span>"; // } // else // { // strWrite += "<a href='ThreadQueryResult.aspx?Page=" + i + "&Category=" + strCategory + "&DateStart=" + strDateStart + "&DateEnd=" + strDateEnd + "'>" + i + "</a> "; // } // } // if (objPagination.HasNextPage()) // { // strWrite += "<a href='ThreadQueryResult.aspx?Page=" + objPagination.NextPage() + "&Category=" + strCategory + "&DateStart=" + strDateStart + "&DateEnd=" + strDateEnd + "'> Next »</a>"; // } //} ddlPages.Items.Clear(); for (int i = 1; i <= objPagination.TotalPage(); i++) { ListItem l = new ListItem(i.ToString(), i.ToString(), true); l.Selected = l.Value == objPagination.CurrentPage.ToString() ? true : false; ddlPages.Items.Add(l); } } //lblPage.Text = strWrite; }
protected void LoadPage() { string strWrite = ""; DateTime dtStartDate = new DateTime(); DateTime dtEndDate = new DateTime(); string strDivisionCode = ""; string strDepartmentCode = ""; string strKeyword = ""; if (!string.IsNullOrEmpty(Request.QueryString["DateStart"])) { dtStartDate = DateTime.ParseExact(Request.QueryString["DateStart"].ToString(), "MMMddyyyy", null); } else { dtStartDate = DateTime.Parse("1/1/1990"); } if (!string.IsNullOrEmpty(Request.QueryString["DateEnd"])) { dtEndDate = DateTime.ParseExact(Request.QueryString["DateEnd"].ToString(), "MMMddyyyy", null); } else { dtEndDate = DateTime.Now; } if (!string.IsNullOrEmpty(Request.QueryString["DivisionCode"])) { strDivisionCode = Request.QueryString["DivisionCode"].ToString(); } else { strDivisionCode = "ALL"; } if (!string.IsNullOrEmpty(Request.QueryString["DepartmentCode"])) { strDepartmentCode = Request.QueryString["DepartmentCode"].ToString(); } else { strDepartmentCode = "ALL"; } if (!string.IsNullOrEmpty(Request.QueryString["Keyword"])) { strKeyword = Request.QueryString["Keyword"].ToString(); } using (clsPagination objPagination = new clsPagination()) { objPagination.CurrentPage = string.IsNullOrEmpty(Request.QueryString["Page"]) == true ? 1 : Request.QueryString["Page"].ToInt(); objPagination.PagePerForm = 10; objPagination.TotalCount = clsGroupUpdate.GetDSGArchives(strDivisionCode, strDepartmentCode, DateTime.Parse(dtStartDate.ToShortDateString() + " 1:00 AM"), DateTime.Parse(dtEndDate.ToShortDateString() + " 11:59 PM"), strKeyword).Rows.Count; string strDateStart = dtStartDate.ToString("MMMddyyyy"); string strDateEnd = dtEndDate.ToString("MMMddyyyy"); ddlPages.Items.Clear(); for (int i = 1; i <= objPagination.TotalPage(); i++) { ListItem l = new ListItem(i.ToString(), i.ToString(), true); l.Selected = l.Value == objPagination.CurrentPage.ToString() ? true : false; ddlPages.Items.Add(l); } } lblPage.Text = strWrite; }