public ActionResult client_dashboard(string PersonName = "", string SearchDocumentType = "", string SearchYear = "", string SearchMonthly = "", string SearchQuaterly = "", int UserId = 0) { var model = new ClientEntity(); if (Session["UserId"] == null) { return(RedirectToAction("client_login", "Client")); } int ClientId = Convert.ToInt32(Session["UserId"]); List <tblClientDocument> result = new List <tblClientDocument>(); if (SearchMonthly != "") { SearchQuaterly = ""; } if (SearchQuaterly != "") { SearchMonthly = ""; } if (PersonName != "" && SearchDocumentType != "") { result = clientBLL.SearchDocumentByQuery(ClientId, PersonName, SearchDocumentType, SearchYear, SearchMonthly, SearchQuaterly); ViewBag.Search = "1"; } else { result = clientBLL.selectAllDocumentForClient(ClientId); ViewBag.Search = "0"; } model = clientBLL.GetAllClient(ClientId); var PersonList = pablaAccountsEntities.tblClientDocuments.Where(x => x.UserId == ClientId && x.IsDeleted == false).Select(x => x.PersonName).Distinct().ToList(); PersonList.Add("Other"); IEnumerable <SelectListItem> selectPersonList = from Person in PersonList select new SelectListItem { Text = Convert.ToString(Person), Value = Convert.ToString(Person) }; ViewBag.PersonName = new SelectList(selectPersonList, "Text", "Value"); var resultList = clientBLL.GetRequest(ClientId); foreach (var item in resultList) { item.CreatedOn = Convert.ToDateTime(item.CreatedOn).AddMinutes(-570); item.CreatedOn = Convert.ToDateTime(item.CreatedOn).AddDays(7); } var date = DateTime.Now; ViewBag.CurrentDays = date; ViewBag.Request = resultList; ViewBag.TotalDocument = result; return(View(model)); }