public void Execute() { PipelineListState pipelineListState = _httpContext.Session["PipelineListState"] != null ? (PipelineListState)_httpContext.Session["PipelineListState"] : new PipelineListState(); if (!InputParameters.ContainsKey("BorroweStatusFilter")) { throw new ArgumentException("BorroweStatusFilter was expected!"); } pipelineListState.BorrowerStatusFilter = InputParameters["BorroweStatusFilter"].ToString() == "0" ? null : InputParameters["BorroweStatusFilter"].ToString(); UserAccount user = _httpContext.Session[SessionHelper.UserData] != null && ((UserAccount)_httpContext.Session[SessionHelper.UserData]).Username == _httpContext.User.Identity.Name ? user = (UserAccount)_httpContext.Session[SessionHelper.UserData] : UserAccountServiceFacade.GetUserByName(_httpContext.User.Identity.Name); if (user == null) { throw new InvalidOperationException("User is null"); } // on date filter change, reset page number pipelineListState.CurrentPage = 1; FilterViewModel userFilterViewModel = null; if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null)) { userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString()); } else { userFilterViewModel = new FilterViewModel(); } PipelineViewModel pipelineViewModel = PipelineDataHelper.RetrievePipelineViewModel(pipelineListState, _httpContext.Session["UserAccountIds"] != null ? (List <int>)_httpContext.Session["UserAccountIds"] : new List <int> { }, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, CommonHelper.GetSearchValue(_httpContext)); _viewName = "Queues/_pipeline"; _viewModel = pipelineViewModel; /* Persist new state */ _httpContext.Session["PipelineViewModel"] = pipelineViewModel.ToXml(); _httpContext.Session["PipelineListState"] = pipelineListState; }
public void Execute() { String searchValue = CommonHelper.GetSearchValue(_httpContext); /* State retrieval */ PipelineListState pipelineListState; if (_httpContext.Session[SessionHelper.PipelineListState] != null) { pipelineListState = ( PipelineListState )_httpContext.Session[SessionHelper.PipelineListState]; } else { pipelineListState = new PipelineListState(); } UserAccount user; if (_httpContext.Session[SessionHelper.UserData] != null && ((UserAccount)_httpContext.Session[SessionHelper.UserData]).Username == _httpContext.User.Identity.Name) { user = ( UserAccount )_httpContext.Session[SessionHelper.UserData]; } else { user = UserAccountServiceFacade.GetUserByName(_httpContext.User.Identity.Name); } if (user == null) { throw new InvalidOperationException("User is null"); } /* parameter processing */ if (!InputParameters.ContainsKey("DateFilter")) { throw new ArgumentException("DateFilter value was expected!"); } var newDateFilterValue = ( GridDateFilter )Enum.Parse(typeof(GridDateFilter), InputParameters["DateFilter"].ToString()); pipelineListState.BoundDate = newDateFilterValue; // on date filter change, reset page number pipelineListState.CurrentPage = 1; /* Command processing */ FilterViewModel userFilterViewModel = null; if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null)) { userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString()); } else { userFilterViewModel = new FilterViewModel(); } PipelineViewModel pipelineViewModel = PipelineDataHelper.RetrievePipelineViewModel(pipelineListState, _httpContext.Session[SessionHelper.UserAccountIds] != null ? (List <int>)_httpContext.Session[SessionHelper.UserAccountIds] : new List <int> { }, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue); _viewName = "Queues/_pipeline"; _viewModel = pipelineViewModel; /* Persist new state */ _httpContext.Session[SessionHelper.PipelineViewModel] = pipelineViewModel.ToXml(); _httpContext.Session[SessionHelper.PipelineListState] = pipelineListState; }
public void Execute() { String searchValue = CommonHelper.GetSearchValue(_httpContext); PipelineListState pipelineListState = null; if ((_httpContext != null) && (_httpContext.Session[SessionHelper.PipelineListState] != null)) { pipelineListState = ( PipelineListState )_httpContext.Session["PipelineListState"]; } else { pipelineListState = new PipelineListState(); } FilterViewModel userFilterViewModel = null; if ((_httpContext != null) && (_httpContext.Session["FilterViewModel"] != null)) { userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session["FilterViewModel"].ToString()); userFilterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.Pipeline; } else { // possible state retrieval? userFilterViewModel = new FilterViewModel(); userFilterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.Pipeline; } Boolean refresh = InputParameters != null && InputParameters.ContainsKey("Refresh") && InputParameters["Refresh"].ToString().Trim() == "true"; // reset Page Number to 1st on Tab change if (!refresh) { pipelineListState.CurrentPage = 1; } UserAccount user = null; if (_httpContext.Session[SessionHelper.UserData] != null) { user = ( UserAccount )_httpContext.Session[SessionHelper.UserData]; } else { throw new InvalidOperationException("UserData is null"); } PipelineViewModel pipelineViewModel = new PipelineViewModel(); pipelineViewModel = PipelineDataHelper.RetrievePipelineViewModel(pipelineListState, _httpContext.Session["UserAccountIds"] != null ? (List <int>)_httpContext.Session["UserAccountIds"] : new List <int> { }, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue); _viewName = "Queues/_pipeline"; _viewModel = pipelineViewModel; /* Persist new state */ _httpContext.Session[SessionHelper.PipelineViewModel] = pipelineViewModel.ToXml(); _httpContext.Session[SessionHelper.PipelineListState] = pipelineListState; _httpContext.Session[SessionHelper.FilterViewModel] = userFilterViewModel.ToXml(); _httpContext.Session[SessionHelper.CurrentTab] = LoanCenterTab.Pipeline; }
public void Execute() { String searchValue = CommonHelper.GetSearchValue(_httpContext); /* State retrieval */ PipelineListState pipelineListState = null; if (_httpContext.Session["PipelineListState"] != null) { pipelineListState = ( PipelineListState )_httpContext.Session["PipelineListState"]; } else { pipelineListState = new PipelineListState(); } UserAccount user = null; if (_httpContext.Session[SessionHelper.UserData] != null && ((UserAccount)_httpContext.Session[SessionHelper.UserData]).Username == _httpContext.User.Identity.Name) { user = (UserAccount)_httpContext.Session[SessionHelper.UserData]; } else { user = UserAccountServiceFacade.GetUserByName(_httpContext.User.Identity.Name); } if (user == null) { throw new InvalidOperationException("User is null"); } /* parameter processing */ Int32 newPageNumber = 0; if (!InputParameters.ContainsKey("Page")) { throw new ArgumentException("Page number was expected!"); } else { newPageNumber = Convert.ToInt32(InputParameters["Page"]); } pipelineListState.CurrentPage = newPageNumber; FilterViewModel userFilterViewModel = null; if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null)) { userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString()); } else { userFilterViewModel = new FilterViewModel(); } PipelineViewModel pipelineViewModel = PipelineDataHelper.RetrievePipelineViewModel(pipelineListState, _httpContext.Session["UserAccountIds"] != null ? (List <int>)_httpContext.Session["UserAccountIds"] : new List <int> { }, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue); //ContactViewModelHelper.PopulateProspectStatuses( contactViewModel ); _viewName = "Queues/_pipeline"; _viewModel = pipelineViewModel; /* Persist new state */ _httpContext.Session[SessionHelper.PipelineViewModel] = pipelineViewModel.ToXml(); _httpContext.Session[SessionHelper.PipelineListState] = pipelineListState; }