private void LoadProject() { try { int _typeprof = Utils.CIntDef(ddlTypeProf.SelectedValue); fromDate = pickdate_Begin.returnDate; toDate = new DateTime(pickdate_End.returnDate.Year, pickdate_End.returnDate.Month, pickdate_End.returnDate.Day, 23, 59, 59); if (Utils.CStrDef(Session["Grouptype"]) == "3") { var list = _ProjectData.GetListByName(txtKeyword.Value) .Where(a => a.USER_ID == Utils.CIntDef(Session["Userid"]) && (a.PROF_DATE <= toDate && a.PROF_DATE >= fromDate) && (a.PROF_TYPE == _typeprof || 0 == _typeprof) && (chkViewDebt.Checked ? a.PROF_COST1 != a.PROF_COST2 : "" == "")) .OrderByDescending(n => n.PROF_DATE).OrderBy(n => n.PROF_STATUS == 12); HttpContext.Current.Session["listProj"] = list; ASPxGridView1_project.DataSource = list; ASPxGridView1_project.DataBind(); } else { var list = _ProjectData.GetListByName(txtKeyword.Value) .Where(a => (a.PROF_DATE <= toDate && a.PROF_DATE >= fromDate) && (a.PROF_TYPE == _typeprof || 0 == _typeprof) && (chkViewDebt.Checked ? a.PROF_COST1 != a.PROF_COST2 : "" == "")) .OrderByDescending(n => n.PROF_DATE).OrderBy(n => n.PROF_STATUS == 12); HttpContext.Current.Session["listProj"] = list; ASPxGridView1_project.DataSource = list; ASPxGridView1_project.DataBind(); } } catch //(Exception) { //throw; } }