public async Task <ActionResult> EditSearch(short SearchDefinitionID) { var identity = Thread.CurrentPrincipal.Identity; var accountId = identity.ToAccountID(); var roleId = identity.ToRoleID(); var userId = identity.ToUserID(); var isSTAdmin = identity.IsSTAdmin(); short ItemsPerPage = default(short); short.TryParse(this.Identity.ToItemsPerPage(), out ItemsPerPage); AddCookie("savedsearchpagesize", ItemsPerPage.ToString(), 1); GetSearchResponse response = await advancedSearchService.GetSavedSearchAsync(new GetSearchRequest() { SearchDefinitionID = SearchDefinitionID, IncludeSearchResults = false, Limit = ItemsPerPage, AccountId = accountId, RoleId = roleId, RequestedBy = userId, IsSTAdmin = isSTAdmin }); response.SearchViewModel.CreatedOn = response.SearchViewModel.CreatedOn.ToJSDate(); foreach (var item in response.SearchViewModel.SearchFilters) { if (item.InputTypeId == 2) { DateTime date = DateTime.Parse(item.SearchText.ToString()); item.SearchText = date.ToString(); } } bool gridvisible = false; ViewBag.grid = gridvisible; ViewBag.EmailPermission = cachingService.CheckSendMailPermissions(accountId, roleId); return(View("AddEditSearch", response.SearchViewModel)); }