public async Task <ActionResult> DepositHistory(string startDate, string endDate, DepositType?depositType, int page = 1) { var memberApi = GetMemberApiProxy(Request); DateTime?startDateTime = null; if (!IsNullOrEmpty(startDate)) { startDateTime = DateTime.Parse(startDate).StartOfTheDay(); } DateTime?endDateTime = null; if (!IsNullOrEmpty(endDate)) { endDateTime = DateTime.Parse(endDate).EndOfTheDay(); } var historyResponse = await memberApi.GetDeposits(page - 1, startDateTime, endDateTime, depositType); ViewBag.StartDate = startDate; ViewBag.EndDate = endDate; ViewBag.DepositType = depositType?.ToString(); var playerHasValidIdDocuments = await memberApi.ArePlayersIdDocumentsValid(); var pagedList = new StaticPagedList <OfflineDeposit>( historyResponse.Deposits, page, historyResponse.PageSize, historyResponse.TotalItemsCount); return(View(new DepositHistoryModel { PagedList = pagedList, PlayerHasValidIdDocuments = playerHasValidIdDocuments })); }