private DataTable searchResult() { DataTable dt = new DataTable(); string searchKey = this.searchKey.Text; //if (!String.IsNullOrEmpty(searchKey) && !String.IsNullOrEmpty(searchKey.Trim())) //{ string decodeKey = HttpUtility.HtmlDecode(searchKey); //dt = _bc.getCoursesByFreetext(decodeKey) as DataTable; string startDttmTxt = this.tbStartDttm.Text; string endDttmTxt = this.tbEndDttm.Text; if (!String.IsNullOrEmpty(startDttmTxt) && !String.IsNullOrEmpty(startDttmTxt.Trim())) { DateTime startDttm = DateTimeUtil.parseToDateTime(startDttmTxt); DateTime endDttm = DateTime.Now; if (!String.IsNullOrEmpty(endDttmTxt) && !String.IsNullOrEmpty(endDttmTxt.Trim())) { endDttm = DateTimeUtil.parseToDateTime(endDttmTxt); } dt = _bc.getCoursesByCriteria(decodeKey, startDttmTxt, endDttmTxt, HttpContext.Current.User.Identity.Name) as DataTable; } return(dt); }
protected void btnSearch_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); string searchKey = this.searchKey.Text; string decodeKey = HttpUtility.HtmlDecode(searchKey); string startDttmTxt = this.tbStartDttm.Text; string endDttmTxt = this.tbEndDttm.Text; if (!String.IsNullOrEmpty(startDttmTxt) && !String.IsNullOrEmpty(startDttmTxt.Trim())) { DateTime startDttm = DateTimeUtil.parseToDateTime(startDttmTxt); DateTime endDttm = DateTime.Now; if (!String.IsNullOrEmpty(endDttmTxt) && !String.IsNullOrEmpty(endDttmTxt.Trim())) { endDttm = DateTimeUtil.parseToDateTime(endDttmTxt); } dt = _bc.getCoursesByCriteria(decodeKey, startDttmTxt, endDttmTxt, HttpContext.Current.User.Identity.Name) as DataTable; } this.gvwDash.DataSource = dt; this.gvwDash.DataBind(); }