public void ExecuteAsync(string command)
        {
            // The command can contain some long running operation
            // we run as async by queing the action on a separate thread
            AsyncManager.QueueAction(() =>
            {
                UserAccount user = null;
                if (Session[SessionHelper.UserData] != null && ((UserAccount)Session[SessionHelper.UserData]).Username == User.Identity.Name)
                {
                    user = (UserAccount)Session[SessionHelper.UserData];
                }
                else
                {
                    user = UserAccountServiceFacade.GetUserByName(User.Identity.Name);
                }

                if (user == null)
                {
                    throw new InvalidOperationException("User is null");
                }
                else
                {
                    Session[SessionHelper.UserData] = user;
                }

                var result = CommandInvoker.InvokeFromCompositeString(command, HttpContext);

                AsyncManager.Parameters["ViewName"] = result.ViewName;
                AsyncManager.Parameters["ViewData"] = result.ViewData;
            });
        }
Beispiel #2
0
        public void Execute()
        {
            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 contactId = 0;

            if (InputParameters.ContainsKey("ContactId"))
            {
                int.TryParse(InputParameters["ContactId"].ToString(), out contactId);
            }

            Guid loanId = Guid.Empty;

            if (InputParameters.ContainsKey("LoanId"))
            {
                Guid.TryParse(InputParameters["LoanId"].ToString(), out loanId);
            }

            var tempDetails = LoanServiceFacade.RetrieveWorkQueueItemDetails(loanId, contactId, -1);
            LoanDetailsViewModel loanDetails = new LoanDetailsViewModel();

            string emptyField = "-";

            if (tempDetails == null)
            {
                tempDetails = new WorkQueueItemDetails();
            }
            else
            {
                CommonHelper.RetreiveLoanDetailsFromWorkQueueItemDetails(tempDetails, loanDetails, user, emptyField);
            }

            if (loanDetails != null)
            {
                _viewName  = "_loanpurposeoncontact";
                _viewModel = loanDetails;
            }
            else
            {
                _viewName  = string.Empty;
                _viewModel = null;
            }
        }
Beispiel #3
0
        public void Execute()
        {
            String searchValue = CommonHelper.GetSearchValue(_httpContext);

            AlertsViewModel alertsViewModel = _httpContext.Session[SessionHelper.AlertViewModel] != null ?
                                              new AlertsViewModel().FromXml(_httpContext.Session[SessionHelper.AlertViewModel].ToString()) :
                                              new AlertsViewModel();


            AlertsListState alertsListState = _httpContext.Session[SessionHelper.AlertsListState] != null ?
                                              (AlertsListState)_httpContext.Session[SessionHelper.AlertsListState] :
                                              new AlertsListState();

            if (!InputParameters.ContainsKey("LoanPurposeFilter"))
            {
                throw new ArgumentException("LoanPurposeFilter was expected!");
            }

            alertsListState.LoanPurposeFilter = InputParameters["LoanPurposeFilter"].ToString() == "0" ? "" : InputParameters["LoanPurposeFilter"].ToString();

            UserAccount user = _httpContext.Session[SessionHelper.UserData] != null && ((UserAccount)_httpContext.Session[SessionHelper.UserData]).Username == _httpContext.User.Identity.Name
                                   ? (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
            alertsListState.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();
            }

            alertsViewModel = AlertsDataHelper.RetrieveAlertViewModel(alertsListState,
                                                                      _httpContext.Session[SessionHelper.UserAccountIds] != null
                                                                            ? (List <int>)_httpContext.Session[SessionHelper.UserAccountIds]
                                                                            : new List <int> {
            }, alertsListState.BoundDate, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue);


            _viewName  = "Queues/_alerts";
            _viewModel = alertsViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.AlertViewModel]  = alertsViewModel.ToXml();
            _httpContext.Session[SessionHelper.AlertsListState] = alertsListState;
        }
Beispiel #4
0
        public void Execute()
        {
            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 contactId = 0;

            if (!InputParameters.ContainsKey("ContactId"))
            {
                throw new ArgumentException("ContactId was expected!");
            }
            else
            {
                contactId = Convert.ToInt32(InputParameters["ContactId"]);
            }

            Int32 newOwnerAccountId;

            if (!InputParameters.ContainsKey("NewOwnerAccountId"))
            {
                throw new ArgumentException("NewOwnerAccountId was expected!");
            }
            else
            {
                newOwnerAccountId = Convert.ToInt32(InputParameters["NewOwnerAccountId"]);
            }

            /* Command processing */
            var result = ContactServiceFacade.UpdateContactOwner(contactId, newOwnerAccountId, user.UserAccountId);

            if (result == true)
            {
                _viewName  = string.Empty;
                _viewModel = null;
            }
            else
            {
                // return Error View?
                throw new ApplicationException("Prospect owner was not updated");
            }
        }
        public void Execute()
        {
            var searchValue = CommonHelper.GetSearchValue(_httpContext);

            CompletedLoansListState completedLoansListState = _httpContext.Session[SessionHelper.CompletedLoansListState] != null ?
                                                              (CompletedLoansListState)_httpContext.Session[SessionHelper.CompletedLoansListState] :
                                                              new CompletedLoansListState();

            if (!InputParameters.ContainsKey("BorroweStatusFilter"))
            {
                throw new ArgumentException("BorroweStatusFilter was expected!");
            }

            completedLoansListState.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
            completedLoansListState.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();
            }

            CompletedLoansViewModel completedLoansViewModel = CompletedLoansDataHelper.RetrieveCompletedLoansViewModel(completedLoansListState,
                                                                                                                       _httpContext.Session[SessionHelper.UserAccountIds] != null
                                                                              ? (List <int>)
                                                                                                                       _httpContext.Session[SessionHelper.UserAccountIds]
                                                                              : new List <int> {
            },
                                                                                                                       user.UserAccountId, searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId);

            _viewName  = "Queues/_completedloans";
            _viewModel = completedLoansViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.CompletedLoansViewModel] = completedLoansViewModel.ToXml();
            _httpContext.Session[SessionHelper.CompletedLoansListState] = completedLoansListState;
        }
Beispiel #6
0
        private bool SubmitToAUS(string eventName, Guid loanId, string caseId)
        {
            var user          = new UserAccount();
            var userAccountId = -1;

            user = Session[SessionHelper.UserData] != null && ((UserAccount)Session[SessionHelper.UserData]).Username == User.Identity.Name ?
                   (UserAccount)Session[SessionHelper.UserData] : UserAccountServiceFacade.GetUserByName(User.Identity.Name);

            if (user != null)
            {
                userAccountId = user.UserAccountId;
            }

            var impEvent = new Event(eventName, UserAccountServiceFacade.GetUserFullNameByUserAccountId(userAccountId), loanId);

            impEvent.RelatedData.Add("CaseId", caseId.Trim());
            return(EventsServiceFacade.CreateEvent(impEvent));
        }
        public void Execute()
        {
            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 taskId = 0;

            if (!InputParameters.ContainsKey("TaskId"))
            {
                throw new ArgumentException("TaskId was expected!");
            }
            else
            {
                taskId = Convert.ToInt32(InputParameters["TaskId"]);
            }

            /* Command processing */
            var result = MML.Web.Facade.TaskServiceFacade.GetTaskView(taskId, user.UserAccountId);

            if (result != null)
            {
                _viewName  = "_loanpurpose";
                _viewModel = result;
            }
            else
            {
                _viewName  = string.Empty;
                _viewModel = null;
            }
        }
Beispiel #8
0
        public void Execute()
        {
            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 */
            Guid loanId = Guid.Empty;

            if (!InputParameters.ContainsKey("LoanId"))
            {
                throw new ArgumentException("LoanId was expected!");
            }
            else
            {
                loanId = Guid.Parse(InputParameters["LoanId"].ToString());
            }

            /* Command processing */
            var result = ExceptionItemServiceFacade.GetExceptionItems(loanId, -1);

            if (result != null)
            {
                _viewName  = "_exceptionItemTooltip";
                _viewModel = result.Where(ex => !ex.DateCured.HasValue).ToList();
            }
            else
            {
                _viewName  = string.Empty;
                _viewModel = null;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private int GetUserID()
        {
            UserAccount user;

            if (Session[SessionHelper.UserData] != null &&
                ((UserAccount)Session[SessionHelper.UserData]).Username == User.Identity.Name)
            {
                user = (UserAccount)Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(User.Identity.Name);
            }
            if (user != null)
            {
                Session[SessionHelper.UserData] = user;
            }
            return(user != null ? user.UserAccountId : -1);
        }
        public virtual void Execute()
        {
            if (HttpContext == null || HttpContext.Session == null)
            {
                throw new NullReferenceException("Session is empty!");
            }

            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");
            }
        }
Beispiel #11
0
        public bool InitiateDisclosure(Guid loanId)
        {
            bool retVal = false;

            Int32       userAccountId = -1;
            UserAccount user          = new UserAccount();

            if (Session[SessionHelper.UserData] != null && (( UserAccount )Session[SessionHelper.UserData]).Username == User.Identity.Name)
            {
                user = ( UserAccount )Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(User.Identity.Name);
            }

            if (user != null)
            {
                userAccountId = user.UserAccountId;
            }

            bool useDigitalDocsImpIntegration = GeneralSettingsServiceFacade.IsIMPIntegrationForDigitalDocsEnabled();

            DigitalDocsServiceFacade.RequestReDisclosuresPackage(loanId, userAccountId);

            if (useDigitalDocsImpIntegration)
            {
                var eventContentDisclosures = new EventContentDisclosures();
                eventContentDisclosures.UserAccountId = userAccountId;
                string contentXml = Event.ContentObjectSerialize(eventContentDisclosures);

                var impEvent = new Event("Event.Integration.Disclosures.ExecuteRules", User.Identity.Name, loanId, contentXml);
                retVal = EventsServiceFacade.CreateEvent(impEvent);
            }

            return(retVal);
        }
        public override void Execute()
        {
            base.Execute();

            var searchValue = CommonHelper.GetSearchValue(base.HttpContext);

            FilterViewModel filterViewModel = null;

            if (base.HttpContext.Session[SessionHelper.FilterViewModel] != null)
            {
                filterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderException;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderException;
            }

            OrderExceptionListState orderExceptionListState;

            if (base.HttpContext.Session[SessionHelper.OrderExceptionListState] != null)
            {
                orderExceptionListState = ( OrderExceptionListState )base.HttpContext.Session[SessionHelper.OrderExceptionListState];
            }
            else
            {
                orderExceptionListState = new OrderExceptionListState();
            }

            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }

            /* parameter processing */
            if (InputParameters == null || !InputParameters.ContainsKey("Page"))
            {
                throw new ArgumentException("Page number was expected!");
            }

            var newPageNumber = Convert.ToInt32(InputParameters["Page"]);

            orderExceptionListState.CurrentPage = newPageNumber;

            OrderExceptionViewModel orderExceptionViewModel = OrderExceptionDataHelper.RetrieveOrderExceptionViewModel(orderExceptionListState,
                                                                                                                       base.HttpContext.Session[SessionHelper.UserAccountIds] != null
                                                              ? (List <int>)base.HttpContext.Session[SessionHelper.UserAccountIds]
                                                              : new List <int> {
            }, user.UserAccountId, filterViewModel.CompanyId, filterViewModel.ChannelId, filterViewModel.DivisionId,
                                                                                                                       filterViewModel.BranchId, searchValue);


            ViewName = "Queues/_orderException";
            ViewData = orderExceptionViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderExceptionViewModel] = orderExceptionViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderExceptionListState] = orderExceptionListState;
        }
Beispiel #13
0
        public void Execute()
        {
            String searchValue = CommonHelper.GetSearchValue(_httpContext);
            /* State retrieval */
            NewLoanApplicationViewModel newLoanApplicationViewModel = null;

            if (_httpContext.Session[SessionHelper.NewLoanApplicationViewModel] != null)
            {
                newLoanApplicationViewModel = new NewLoanApplicationViewModel().FromXml(_httpContext.Session[SessionHelper.NewLoanApplicationViewModel].ToString());
            }
            else
            {
                newLoanApplicationViewModel = new NewLoanApplicationViewModel();
            }

            NewLoanApplicationListState newLoanApplicationListState = null;

            if (_httpContext.Session[SessionHelper.NewLoanApplicationListState] != null)
            {
                newLoanApplicationListState = ( NewLoanApplicationListState )_httpContext.Session[SessionHelper.NewLoanApplicationListState];
            }
            else
            {
                newLoanApplicationListState = new NewLoanApplicationListState();
            }

            if (!InputParameters.ContainsKey("LoanPurposeFilter"))
            {
                throw new ArgumentException("LoanPurposeFilter was expected!");
            }

            if (InputParameters["LoanPurposeFilter"].ToString() == "0")
            {
                newLoanApplicationListState.LoanPurposeFilter = "";
            }
            else
            {
                newLoanApplicationListState.LoanPurposeFilter = InputParameters["LoanPurposeFilter"].ToString();
            }

            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");
            }


            // on date filter change, reset page number
            FilterViewModel userFilterViewModel = null;

            if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                userFilterViewModel = new FilterViewModel();
            }
            newLoanApplicationListState.CurrentPage = 1;

            newLoanApplicationViewModel = NewLoanApplicationDataHelper.RetrieveNewApplicationViewModel(newLoanApplicationListState,
                                                                                                       _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/_newLoanApplication";
            _viewModel = newLoanApplicationViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.NewLoanApplicationViewModel] = newLoanApplicationViewModel.ToXml();
            _httpContext.Session[SessionHelper.NewLoanApplicationListState] = newLoanApplicationListState;
        }
Beispiel #14
0
        public void Execute()
        {
            /* State retrieval */
            ContactViewModel contactViewModel = null;

            if (_httpContext.Session["ContactViewModel"] != null)
            {
                contactViewModel = new ContactViewModel().FromXml(_httpContext.Session["ContactViewModel"].ToString());
            }
            else
            {
                contactViewModel = new ContactViewModel();
            }

            ContactListState contactListState = null;

            if (_httpContext.Session["ContactListState"] != null)
            {
                contactListState = ( ContactListState )_httpContext.Session["ContactListState"];
            }
            else
            {
                contactListState = new ContactListState();
            }

            if (!InputParameters.ContainsKey("LoanPurposeFilter"))
            {
                throw new ArgumentException("LoanPurposeFilter was expected!");
            }

            if (InputParameters["LoanPurposeFilter"].ToString() == "0")
            {
                contactListState.LoanPurposeFilter = "";
            }
            else
            {
                contactListState.LoanPurposeFilter = InputParameters["LoanPurposeFilter"].ToString();
            }

            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");
            }


            // on date filter change, reset page number
            FilterViewModel userFilterViewModel = null;

            if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                userFilterViewModel = new FilterViewModel();
            }
            contactListState.CurrentPage = 1;

            contactViewModel = ContactDataHelper.RetrieveContactViewModel(contactListState, _httpContext.Session["UserAccountIds"] != null ? (List <int>)_httpContext.Session["UserAccountIds"] : new List <int> {
            }, user.UserAccountId, _httpContext, CommonHelper.GetSearchValue(_httpContext));

            _viewName  = "Queues/_contact";
            _viewModel = contactViewModel;

            /* Persist new state */
            _httpContext.Session["ContactViewModel"] = contactViewModel.ToXml();
            _httpContext.Session["ContactListState"] = contactListState;
        }
Beispiel #15
0
        public override void Execute()
        {
            base.Execute();

            var searchValue = CommonHelper.GetSearchValue(base.HttpContext);

            FilterViewModel filterViewModel = null;

            if (base.HttpContext.Session[SessionHelper.FilterViewModel] != null)
            {
                filterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderException;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderException;
            }

            /* State retrieval */
            var orderExceptionViewModel =
                base.HttpContext.Session[SessionHelper.OrderExceptionViewModel] != null ?
                new OrderExceptionViewModel().FromXml(base.HttpContext.Session[SessionHelper.OrderExceptionViewModel].ToString()) :
                new OrderExceptionViewModel();

            OrderExceptionListState orderExceptionListState;

            if (base.HttpContext.Session[SessionHelper.OrderExceptionListState] != null)
            {
                orderExceptionListState = ( OrderExceptionListState )base.HttpContext.Session[SessionHelper.OrderExceptionListState];
            }
            else
            {
                orderExceptionListState = new OrderExceptionListState();
            }

            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new NullReferenceException("User is null");
            }

            /* parameter processing */
            OrderExceptionAttribute newSortColumn;

            if (InputParameters == null || !InputParameters.ContainsKey("Column"))
            {
                throw new ArgumentException("Column value was expected!");
            }

            newSortColumn = ( OrderExceptionAttribute )Enum.Parse(typeof(OrderExceptionAttribute), InputParameters["Column"].ToString());

            // switch direction
            if (orderExceptionListState.SortColumn == newSortColumn && orderExceptionListState.SortDirection == "ASC")
            {
                orderExceptionListState.SortDirection = "DESC";
            }
            else
            {
                orderExceptionListState.SortDirection = "ASC";
            }

            orderExceptionListState.SortColumn  = newSortColumn;
            orderExceptionListState.CurrentPage = 1;

            /* Command processing */

            var orderExceptionViewData = OrderExceptionDataHelper.RetrieveOrderExceptionViewModel(orderExceptionListState,
                                                                                                  base.HttpContext.Session[SessionHelper.UserAccountIds] != null
                                                                                    ? (List <int>)base.HttpContext.Session[SessionHelper.UserAccountIds]
                                                                                    : new List <int> {
            }, user.UserAccountId, filterViewModel.CompanyId, filterViewModel.ChannelId, filterViewModel.DivisionId, filterViewModel.BranchId, searchValue);


            if (orderExceptionViewModel != null)
            {
                orderExceptionViewModel.Exceptions = orderExceptionViewData.Exceptions;
                orderExceptionViewModel.PageCount  = orderExceptionViewData.PageCount;
                orderExceptionViewModel.TotalItems = orderExceptionViewData.TotalItems;

                OrderExceptionGridHelper.ProcessPagingOptions(orderExceptionListState, orderExceptionViewModel);
            }


            ViewName = "Queues/_orderException";
            ViewData = orderExceptionViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderExceptionViewModel] = orderExceptionViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderExceptionListState] = orderExceptionListState;
        }
Beispiel #16
0
        public override void Execute()
        {
            base.Execute();
            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }

            ManageProspectsViewModel manageProspectViewModel = null;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.ManageProspects] != null))
            {
                manageProspectViewModel = new ManageProspectsViewModel().FromXml(base.HttpContext.Session[SessionHelper.ManageProspects].ToString());
            }
            else
            {
                // possible state retrieval?
                manageProspectViewModel = new ManageProspectsViewModel();
            }

            /* parameter processing */
            Guid companyId = Guid.Empty;

            if (!InputParameters.ContainsKey("CompanyId"))
            {
                throw new ArgumentException("CompanyId was expected!");
            }

            bool channelResetOccurred = false;

            if (InputParameters["CompanyId"].ToString().Equals("0") || InputParameters["CompanyId"].ToString().Equals("-1"))
            {
                channelResetOccurred = true;
            }
            else
            {
                companyId = Guid.Parse(InputParameters["CompanyId"].ToString());
            }

            manageProspectViewModel.CompanyId = companyId.ToString();

            manageProspectViewModel.Channels.Clear();
            manageProspectViewModel.Channels.Add(_viewAllItem);
            manageProspectViewModel.ChannelId = 0;

            manageProspectViewModel.Divisions.Clear();
            manageProspectViewModel.Divisions.Add(_viewAllItem);
            manageProspectViewModel.DivisionId = 0;

            manageProspectViewModel.Branches.Clear();
            manageProspectViewModel.Branches.Add(_viewAllItem);
            manageProspectViewModel.BranchId = Guid.Empty;

            manageProspectViewModel.ConciergeInfoList.Clear();
            manageProspectViewModel.SelectedConcierge = null;


            var isLoa = false;

            if (user.Roles != null && user.Roles.Any(r => r.RoleName == RoleName.LoanOfficerAssistant && r.IsActive))
            {
                isLoa = true;
            }


            /* Command processing */
            Guid _compId;

            Guid.TryParse(manageProspectViewModel.CompanyId, out _compId);


            var conciergeList = !WebCommonHelper.LicensingEnabled() ?
                                UserAccountServiceFacade.RetrieveConciergeInfo(null, null, null, null, _compId, null, null, null) :
                                UserAccountServiceFacade.RetrieveConciergeInfo(manageProspectViewModel.LoanId, null, isLoa, user.UserAccountId, _compId, null, null, null);

            if (conciergeList != null && !conciergeList.Any(d => d.ConciergeName == "Select One"))
            {
                conciergeList.Insert(0, new ConciergeInfo()
                {
                    NMLSNumber = "", ConciergeName = "Select One", UserAccountId = 0
                });
            }

            manageProspectViewModel.ConciergeInfoList = conciergeList;



            var loaList = UserAccountServiceFacade.RetrieveLOAInfo(_compId, null, null, null, true);

            if (loaList != null && !loaList.Any(d => d.ConciergeName == "Select One"))
            {
                loaList.Insert(0, new ConciergeInfo()
                {
                    NMLSNumber = "", ConciergeName = "Select One", UserAccountId = 0
                });
            }

            manageProspectViewModel.LoaInfoList = loaList;

            if (!channelResetOccurred)
            {
                /* Command processing */
                var result = UserAccountServiceFacade.GetChannels(companyId);
                if (result != null)
                {
                    foreach (Channel channel in result.OrderBy(r => r.Name))
                    {
                        manageProspectViewModel.Channels.Add(new DropDownItem()
                        {
                            Text     = channel.Name,
                            Value    = channel.ChannelId.ToString(),
                            Selected = false
                        });
                    }
                }
            }

            manageProspectViewModel.Statuses = new Collection <KeyValuePair <String, String> >();
            foreach (ContactStatus contactStatus in Enum.GetValues(typeof(ContactStatus)))
            {
                if (contactStatus != ContactStatus.None)
                {
                    manageProspectViewModel.Statuses.Add(new KeyValuePair <String, String>((( int )contactStatus).ToString(),
                                                                                           MML.Web.LoanCenter.Helpers.LoanCenterEnumHelper.ContactStatusToString(contactStatus)));
                }
            }

            manageProspectViewModel.Statuses = new Collection <KeyValuePair <String, String> >(manageProspectViewModel.Statuses.OrderBy(s => s.Value).ToList());

            ViewName = "Commands/_manageprospects";
            ViewData = manageProspectViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.ManageProspects] = manageProspectViewModel.ToXml();
        }
Beispiel #17
0
        public override void Execute()
        {
            base.Execute();

            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }

            AssignLoanInfoViewModel assignLoanInfoViewModel = null;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.AssignLoanInfo] != null))
            {
                assignLoanInfoViewModel = new AssignLoanInfoViewModel().FromXml(base.HttpContext.Session[SessionHelper.AssignLoanInfo].ToString());
            }
            else
            {
                // possible state retrieval?
                assignLoanInfoViewModel = new AssignLoanInfoViewModel();
            }

            /* parameter processing */
            Guid branchId = Guid.Empty;

            if (!InputParameters.ContainsKey("BranchId"))
            {
                throw new ArgumentException("BranchId was expected!");
            }

            if (InputParameters["BranchId"].ToString() != "-1" && InputParameters["BranchId"].ToString() != "0")
            {
                branchId = Guid.Parse(InputParameters["BranchId"].ToString());
            }

            assignLoanInfoViewModel.BranchId = branchId;

            assignLoanInfoViewModel.ConciergeList.Clear();
            assignLoanInfoViewModel.ConciergeId = null;


            var isLoa = false;

            if (user.Roles != null && user.Roles.Any(r => r.RoleName == RoleName.LoanOfficerAssistant && r.IsActive))
            {
                isLoa = true;
            }

            /* Command processing */
            Guid _compId;

            Guid.TryParse(assignLoanInfoViewModel.CompanyId, out _compId);


            var conciergeList = !WebCommonHelper.LicensingEnabled() ?
                                UserAccountServiceFacade.RetrieveConciergeInfo(null, null, null, null, _compId, assignLoanInfoViewModel.ChannelId, assignLoanInfoViewModel.DivisionId, assignLoanInfoViewModel.BranchId) :
                                UserAccountServiceFacade.RetrieveConciergeInfo(assignLoanInfoViewModel.LoanId, null, isLoa, user.UserAccountId, _compId, assignLoanInfoViewModel.ChannelId, assignLoanInfoViewModel.DivisionId, assignLoanInfoViewModel.BranchId);

            if (conciergeList != null && !conciergeList.Any(d => d.ConciergeName == "Select One"))
            {
                conciergeList.Insert(0, new ConciergeInfo()
                {
                    NMLSNumber = "", ConciergeName = "Select One", UserAccountId = 0
                });
            }

            assignLoanInfoViewModel.ConciergeList = conciergeList;



            var loaList = UserAccountServiceFacade.RetrieveLOAInfo(_compId, assignLoanInfoViewModel.ChannelId, assignLoanInfoViewModel.DivisionId, assignLoanInfoViewModel.BranchId, true);

            if (loaList != null && !loaList.Any(d => d.ConciergeName == "Select One"))
            {
                loaList.Insert(0, new ConciergeInfo()
                {
                    NMLSNumber = "", ConciergeName = "Select One", UserAccountId = 0
                });
            }

            assignLoanInfoViewModel.LoaList = loaList;

            ViewName = "_assignloaninfo";
            ViewData = assignLoanInfoViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.AssignLoanInfo] = assignLoanInfoViewModel.ToXml();
            //base.HttpContext.Session[ SessionHelper.UserAccountIds ] = new List<int>();
        }
        public void Execute()
        {
            String searchValue = CommonHelper.GetSearchValue(_httpContext);

            /* State retrieval */
            PendingApprovalViewModel pendingApprovalViewModel = null;

            if (_httpContext.Session[SessionHelper.PendingApprovalViewModel] != null)
            {
                pendingApprovalViewModel = new PendingApprovalViewModel().FromXml(_httpContext.Session[SessionHelper.PendingApprovalViewModel].ToString());
            }
            else
            {
                pendingApprovalViewModel = new PendingApprovalViewModel();
            }

            PendingApprovalListState pendingApprovalListState = null;

            if (_httpContext.Session[SessionHelper.PendingApprovalListState] != null)
            {
                pendingApprovalListState = ( PendingApprovalListState )_httpContext.Session[SessionHelper.PendingApprovalListState];
            }
            else
            {
                pendingApprovalListState = new PendingApprovalListState();
            }

            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"]);
            }

            pendingApprovalListState.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();
            }

            pendingApprovalViewModel = PendingApprovalDataHelper.RetrievePendingApprovalViewModel(pendingApprovalListState,
                                                                                                  _httpContext.Session[SessionHelper.UserAccountIds] != null
                                                              ? (List <int>)_httpContext.Session[SessionHelper.UserAccountIds]
                                                              : new List <int> {
            }, user.UserAccountId,
                                                                                                  searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId);


            _viewName  = "Queues/_pendingapproval";
            _viewModel = pendingApprovalViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.PendingApprovalViewModel] = pendingApprovalViewModel.ToXml();
            _httpContext.Session[SessionHelper.PendingApprovalListState] = pendingApprovalListState;
        }
        public void Execute()
        {
            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 contactId = 0;

            if (!InputParameters.ContainsKey("ContactId"))
            {
                throw new ArgumentException("ContactId was expected!");
            }
            else
            {
                contactId = Convert.ToInt32(InputParameters["ContactId"]);
            }

            Guid loanId = Guid.Empty;

            if (InputParameters.ContainsKey("LoanId"))
            {
                Guid.TryParse(InputParameters["LoanId"].ToString(), out loanId);
            }

            WorkQueueItemDetails result = LoanServiceFacade.RetrieveWorkQueueItemDetails(loanId, contactId, -1);

            if (result == null)
            {
                result = new WorkQueueItemDetails();
            }
            else
            {
                PhoneNumberType borrowerPreferredPhoneType;
                if (!Enum.TryParse(result.BorrowerPreferredPhoneType, out borrowerPreferredPhoneType))
                {
                    borrowerPreferredPhoneType = PhoneNumberType.Home;
                }

                PhoneNumberType borrowerAlternatePhoneType;
                if (!Enum.TryParse(result.BorrowerAlternatePhoneType, out borrowerAlternatePhoneType))
                {
                    borrowerAlternatePhoneType = PhoneNumberType.Home;
                }

                PhoneNumberType coBorrowerPreferredPhoneType;
                if (!Enum.TryParse(result.CoBorrowerPreferredPhoneType, out coBorrowerPreferredPhoneType))
                {
                    coBorrowerPreferredPhoneType = PhoneNumberType.Home;
                }

                PhoneNumberType coBorrowerAlternatePhoneType;
                if (!Enum.TryParse(result.CoBorrowerAlternatePhoneType, out coBorrowerAlternatePhoneType))
                {
                    coBorrowerAlternatePhoneType = PhoneNumberType.Home;
                }

                result.BorrowerPreferredPhoneType   = borrowerPreferredPhoneType.ToString();
                result.BorrowerAlternatePhoneType   = borrowerAlternatePhoneType.ToString();
                result.CoBorrowerPreferredPhoneType = coBorrowerPreferredPhoneType.ToString();
                result.CoBorrowerAlternatePhoneType = coBorrowerAlternatePhoneType.ToString();
            }

            if (result != null)
            {
                _viewName  = "_contacttooltiponcontact";
                _viewModel = result;
            }
            else
            {
                _viewName  = string.Empty;
                _viewModel = null;
            }
        }
Beispiel #20
0
        private void RetrieveContacts(List <int> newUserAccountIds, String searchValue)
        {
            ContactListState contactListState = null;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.ContactListState] != null))
            {
                contactListState = ( ContactListState )base.HttpContext.Session[SessionHelper.ContactListState];
            }
            else
            {
                contactListState = new ContactListState();
            }

            // reset page to 1st on user change
            FilterViewModel userFilterViewModel = null;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
                userFilterViewModel.FilterContext = FilterContextEnum.Contact;
            }
            else
            {
                // possible state retrieval?
                userFilterViewModel = new FilterViewModel();
                userFilterViewModel.FilterContext = FilterContextEnum.Contact;
            }

            contactListState.CurrentPage = 1;

            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }

            var contactViewData = ContactServiceFacade.RetrieveContactsView(newUserAccountIds,
                                                                            contactListState.BoundDate,
                                                                            contactListState.CurrentPage,
                                                                            EnumHelper.GetStringValue(contactListState.SortColumn),
                                                                            contactListState.SortDirection, user.UserAccountId, searchValue, contactListState.ContactStatusFilter,
                                                                            userFilterViewModel.CompanyId,
                                                                            userFilterViewModel.ChannelId,
                                                                            userFilterViewModel.DivisionId,
                                                                            contactListState.LoanPurposeFilter,
                                                                            userFilterViewModel.BranchId,
                                                                            contactListState.ConciergeFilter
                                                                            );



            ContactViewModel contactViewModel = new ContactViewModel();

            if (contactViewData != null)
            {
                contactViewModel.Contacts   = contactViewData.ContactsItems;
                contactViewModel.PageCount  = contactViewData.TotalPages;
                contactViewModel.TotalItems = contactViewData.TotalItems;
                ContactGridHelper.ApplyClassCollection(contactViewModel);
                ContactGridHelper.ProcessPagingOptions(contactListState, contactViewModel);
            }

            contactViewModel.ProspectLOConciergeList = ContactViewModelHelper.PopulateProspectLoanOfficers(userFilterViewModel, base.HttpContext);

            // populate prospect statuses
            ContactViewModelHelper.PopulateProspectStatuses(contactViewModel);

            contactViewModel.ProspectStatusList = ContactViewModelHelper.PopulateProspectStatusList(contactViewModel);
            contactViewModel.LoanPurposeList    = new List <LoanTransactionType>(Enum.GetValues(typeof(LoanTransactionType)).Cast <LoanTransactionType>().Skip(1));

            ContactDataHelper contactDataHelper = new ContactDataHelper();

            contactDataHelper.PopulateConciergeFilterList(contactListState, base.HttpContext, contactViewModel);

            base.ViewName = "Queues/_contact";
            base.ViewData = contactViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.ContactViewModel] = contactViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.ContactListState] = contactListState;
            base.HttpContext.Session[SessionHelper.FilterViewModel]  = userFilterViewModel.ToXml();
        }
        public override void Execute()
        {
            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }

            FilterViewModel userFilterViewModel;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                // possible state retrieval?
                userFilterViewModel = new FilterViewModel();
            }

            /* parameter processing */
            Int32 channelId = 0;

            if (!InputParameters.ContainsKey("ChannelId"))
            {
                throw new ArgumentException("ChannelId was expected!");
            }

            bool divisionResetOccurred = false;

            if (InputParameters["ChannelId"].ToString() == "0" || InputParameters["ChannelId"].ToString().Equals("-1"))
            {
                divisionResetOccurred = true;
            }
            else
            {
                channelId = Int32.Parse(InputParameters["ChannelId"].ToString());
            }

            userFilterViewModel.ChannelId = channelId;

            userFilterViewModel.Divisions.Clear();
            userFilterViewModel.Divisions.Add(_viewAllItem);
            userFilterViewModel.DivisionId = 0;

            userFilterViewModel.Branches.Clear();
            userFilterViewModel.Branches.Add(_viewAllItemGuid);
            userFilterViewModel.BranchId = Guid.Empty;

            userFilterViewModel.Users.Clear();
            userFilterViewModel.Users.Add(_viewAllItem);
            userFilterViewModel.UserId = 0;

            if (!divisionResetOccurred)
            {
                /* Command processing */
                var result = UserAccountServiceFacade.GetDivisions(channelId);
                if (result != null)
                {
                    foreach (Division division in result.OrderBy(r => r.DivisionName))
                    {
                        userFilterViewModel.Divisions.Add(new SelectListItem()
                        {
                            Text     = division.DivisionName,
                            Value    = division.DivisionId.ToString(),
                            Selected = false
                        });

                        if (base.HttpContext.Session[SessionHelper.CurrentTab] != null &&
                            ((LoanCenterTab)base.HttpContext.Session[SessionHelper.CurrentTab] == LoanCenterTab.OrderRequested ||
                             (LoanCenterTab)base.HttpContext.Session[SessionHelper.CurrentTab] == LoanCenterTab.OrderProcessed ||
                             (LoanCenterTab)base.HttpContext.Session[SessionHelper.CurrentTab] == LoanCenterTab.OrderDeliveredForReview ||
                             (LoanCenterTab)base.HttpContext.Session[SessionHelper.CurrentTab] == LoanCenterTab.OrderException))
                        {
                            var branches = UserAccountServiceFacade.GetBranches(division.DivisionId);
                            foreach (var branch in branches)
                            {
                                var users = UserAccountServiceFacade.GetUsersFullName(branch.BranchId, false);

                                var usersList = new List <int>();

                                foreach (var userAccount in users.OrderBy(r => r.FullName))
                                {
                                    userFilterViewModel.Users.Add(new SelectListItem()
                                    {
                                        Text     = userAccount.FullName,
                                        Value    = userAccount.UserAccountId.ToString(),
                                        Selected = (userAccount.UserAccountId == userFilterViewModel.UserId)
                                    });

                                    usersList.Add(userAccount.UserAccountId);
                                }
                            }
                        }
                    }
                }
                userFilterViewModel.Users.Add(_viewAllItem);
            }

            ViewName = "_userfilter";
            ViewData = userFilterViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.FilterViewModel] = userFilterViewModel.ToXml();
        }
Beispiel #22
0
        public void Execute()
        {
            TraceHelper.Information(TraceCategory.LoanCenter, "UserFilterLoadUsersCommand Execute started!");

            Stopwatch swatch = Stopwatch.StartNew();

            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");
            }

            FilterViewModel userFilterViewModel = null;

            if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                // possible state retrieval?
                userFilterViewModel = new FilterViewModel();
            }

            /* parameter processing */
            Guid branchId = Guid.Empty;

            if (!InputParameters.ContainsKey("BranchId"))
            {
                throw new ArgumentException("BranchId was expected!");
            }

            bool branchesResetOccurred = false;

            if (InputParameters["BranchId"].ToString() == "0" || InputParameters["BranchId"].ToString().Equals("-1"))
            {
                branchesResetOccurred = true;
                _httpContext.Session[SessionHelper.BranchId] = null;
            }
            else
            {
                branchId = Guid.Parse(InputParameters["BranchId"].ToString());
                _httpContext.Session[SessionHelper.BranchId] = branchId;
            }

            // select company
            userFilterViewModel.BranchId = branchId;

            userFilterViewModel.Users.Clear();
            userFilterViewModel.Users.Add(_viewAllItem);
            userFilterViewModel.UserId = 0;

            userFilterViewModel.UsersForProspect.Clear();
            userFilterViewModel.UsersForProspect.Add(_emptyItem);

            if (!branchesResetOccurred)
            {
                /* Command processing */
                var result = UserAccountServiceFacade.GetUsersFullName(branchId, false);

                var usersList = new List <int>();

                foreach (var userAccount in result.OrderBy(r => r.FullName))
                {
                    userFilterViewModel.Users.Add(new SelectListItem()
                    {
                        Text     = userAccount.FullName,
                        Value    = userAccount.UserAccountId.ToString(),
                        Selected = (userAccount.UserAccountId == userFilterViewModel.UserId)
                    });

                    userFilterViewModel.UsersForProspect.Add(new SelectListItem()
                    {
                        Text  = userAccount.FullName,
                        Value = userAccount.UserAccountId.ToString()
                    });

                    usersList.Add(userAccount.UserAccountId);
                }



                _httpContext.Session[SessionHelper.UserAccountIds] = usersList;
            }
            else
            {
                bool hasPrivilegeForManagingQueues = (_httpContext.Session[SessionHelper.PrivilegeForManagingQueues] is bool && ( bool )_httpContext.Session[SessionHelper.PrivilegeForManagingQueues]);

                if (user.Roles != null && !user.Roles.Any(r => r.RoleName.Equals(RoleName.Administrator)) &&
                    !user.Roles.Any(r => r.RoleName.Equals(RoleName.BranchManager)) &&
                    !user.Roles.Any(r => r.RoleName.Equals(RoleName.TeamLeader)) &&
                    !user.Roles.Any(r => r.RoleName.Equals(RoleName.DivisionManager)) &&
                    !hasPrivilegeForManagingQueues)
                {
                    // Show only records where user is assigned to (either if it's as LO/Concierge, LOA or Loan Processor )
                    _httpContext.Session[SessionHelper.UserAccountIds] = new List <int> {
                        user.UserAccountId
                    };
                }
                else
                {
                    // Don't filter result list
                    _httpContext.Session[SessionHelper.UserAccountIds] = null;
                }
            }

            _viewName  = "_userfilter";
            _viewModel = userFilterViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.FilterViewModel] = userFilterViewModel.ToXml();

            swatch.Stop();
            TraceHelper.Information(TraceCategory.LoanCenter, "UserFilterLoadUsersCommand Execute completed! Time elapsed (ms): " + swatch.ElapsedMilliseconds);
        }
        public void Execute()
        {
            var searchValue = CommonHelper.GetSearchValue(_httpContext);

            /* State retrieval */
            var completedLoansViewModel =
                _httpContext.Session[SessionHelper.CompletedLoansViewModel] != null ?
                new CompletedLoansViewModel().FromXml(_httpContext.Session[SessionHelper.CompletedLoansViewModel].ToString()) :
                new CompletedLoansViewModel();

            CompletedLoansListState completedLoansListState;

            if (_httpContext.Session[SessionHelper.CompletedLoansListState] != null)
            {
                completedLoansListState = ( CompletedLoansListState )_httpContext.Session[SessionHelper.CompletedLoansListState];
            }
            else
            {
                completedLoansListState = new CompletedLoansListState();
            }

            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 */
            CompletedLoansAttribute newSortColumn;

            if (!InputParameters.ContainsKey("Column"))
            {
                throw new ArgumentException("Column value was expected!");
            }

            newSortColumn = ( CompletedLoansAttribute )Enum.Parse(typeof(CompletedLoansAttribute), InputParameters["Column"].ToString());

            // switch direction
            if (completedLoansListState.SortColumn == newSortColumn && completedLoansListState.SortDirection == "ASC")
            {
                completedLoansListState.SortDirection = "DESC";
            }
            else
            {
                completedLoansListState.SortDirection = "ASC";
            }

            completedLoansListState.SortColumn  = newSortColumn;
            completedLoansListState.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();
            }

            var completedLoansViewData = CompletedLoansDataHelper.RetrieveCompletedLoansViewModel(completedLoansListState,
                                                                                                  _httpContext.Session[SessionHelper.UserAccountIds] !=
                                                                                                  null
                                                                                    ? (List <int>)
                                                                                                  _httpContext.Session[
                                                                                                      SessionHelper.UserAccountIds]
                                                                                    : new List <int> {
            },
                                                                                                  user.UserAccountId, searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId);


            if (completedLoansViewModel != null)
            {
                completedLoansViewModel.CompletedLoansItems = completedLoansViewData.CompletedLoansItems;
                completedLoansViewModel.PageCount           = completedLoansViewData.PageCount;
                completedLoansViewModel.TotalItems          = completedLoansViewData.TotalItems;

                CompletedLoansGridHelper.ProcessPagingOptions(completedLoansListState, completedLoansViewModel);
            }


            _viewName  = "Queues/_completedloans";
            _viewModel = completedLoansViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.CompletedLoansViewModel] = completedLoansViewModel.ToXml();
            _httpContext.Session[SessionHelper.CompletedLoansListState] = completedLoansListState;
        }
Beispiel #24
0
        public override void Execute()
        {
            var searchValue = CommonHelper.GetSearchValue(base.HttpContext);

            FilterViewModel filterViewModel = null;

            if (base.HttpContext != null && base.HttpContext.Session[SessionHelper.FilterViewModel] != null)
            {
                filterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderRequested;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderRequested;
            }

            OrderRequestedListState orderRequestedListState;

            if (base.HttpContext.Session[SessionHelper.OrderRequestedListState] != null)
            {
                orderRequestedListState = ( OrderRequestedListState )base.HttpContext.Session[SessionHelper.OrderRequestedListState];
            }
            else
            {
                orderRequestedListState = new OrderRequestedListState();
            }

            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.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());

            orderRequestedListState.BoundDate = newDateFilterValue;

            // on date filter change, reset page number
            orderRequestedListState.CurrentPage = 1;

            /* Command processing */
            OrderRequestedViewModel orderRequestedViewModel = OrderRequestedDataHelper.RetrieveOrderRequestedViewModel(orderRequestedListState,
                                                                                                                       base.HttpContext.Session[SessionHelper.UserAccountIds] != null
                                                                              ? (List <int>)
                                                                                                                       base.HttpContext.Session[SessionHelper.UserAccountIds]
                                                                              : new List <int> {
            },
                                                                                                                       user.UserAccountId, filterViewModel.CompanyId, filterViewModel.ChannelId, filterViewModel.DivisionId, filterViewModel.BranchId, searchValue);

            ViewName = "Queues/_orderRequested";
            ViewData = orderRequestedViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderRequestedViewModel] = orderRequestedViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderRequestedListState] = orderRequestedListState;
        }
Beispiel #25
0
        public void Execute()
        {
            /* State retrieval */
            ContactViewModel contactViewModel = null;

            if (_httpContext.Session["ContactViewModel"] != null)
            {
                contactViewModel = new ContactViewModel().FromXml(_httpContext.Session["ContactViewModel"].ToString());
            }
            else
            {
                contactViewModel = new ContactViewModel();
            }

            ContactListState contactListState = null;

            if (_httpContext.Session["ContactListState"] != null)
            {
                contactListState = (ContactListState)_httpContext.Session["ContactListState"];
            }
            else
            {
                contactListState = new ContactListState();
            }

            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 */
            ContactViewAttribute newSortColumn;

            if (!InputParameters.ContainsKey("Column"))
            {
                throw new ArgumentException("Column value was expected!");
            }
            else
            {
                newSortColumn = (ContactViewAttribute)Enum.Parse(typeof(ContactViewAttribute), InputParameters["Column"].ToString());
            }

            // switch direction
            if (contactListState.SortColumn == newSortColumn)
            {
                if (contactListState.SortDirection == "DESC")
                {
                    contactListState.SortDirection = "ASC";
                }
                else
                {
                    contactListState.SortDirection = "DESC";
                }
            }
            else if (String.IsNullOrEmpty(contactListState.SortDirection))
            {
                contactListState.SortDirection = "DESC";
            }

            contactListState.SortColumn = newSortColumn;

            String searchValue = CommonHelper.GetSearchValue(_httpContext);

            /* Command processing */
            contactViewModel = ContactDataHelper.RetrieveContactViewModel(contactListState, _httpContext.Session["UserAccountIds"] != null ? (List <int>)_httpContext.Session["UserAccountIds"] : new List <int> {
            }, user.UserAccountId, _httpContext, searchValue);

            _viewName  = "Queues/_contact";
            _viewModel = contactViewModel;

            /* Persist new state */
            _httpContext.Session["ContactViewModel"] = contactViewModel.ToXml();
            _httpContext.Session["ContactListState"] = contactListState;
        }
        public void Execute()
        {
            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");
            }

            FilterViewModel userFilterViewModel;

            if ((_httpContext != null) && (_httpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(_httpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                // possible state retrieval?
                userFilterViewModel = new FilterViewModel();
            }

            /* parameter processing */
            Int32 divisionId = 0;

            if (!InputParameters.ContainsKey("DivisionId"))
            {
                throw new ArgumentException("DivisionId was expected!");
            }

            bool regionsResetOccurred = false;

            if (InputParameters["DivisionId"].ToString() == "0" || InputParameters["DivisionId"].ToString().Equals("-1"))
            {
                regionsResetOccurred = true;
            }
            else
            {
                divisionId = Int32.Parse(InputParameters["DivisionId"].ToString());
            }

            // Select region
            userFilterViewModel.DivisionId = divisionId;

            userFilterViewModel.Branches.Clear();
            userFilterViewModel.Branches.Add(_genericItemGuid);
            userFilterViewModel.BranchId = Guid.Empty;

            userFilterViewModel.Users.Clear();
            userFilterViewModel.Users.Add(_genericItem);
            userFilterViewModel.UserId = 0;

            if (!regionsResetOccurred)
            {
                /* Command processing */
                var result = UserAccountServiceFacade.GetBranches(divisionId);
                if (result != null)
                {
                    foreach (Branch branch in result.OrderBy(r => r.Name))
                    {
                        userFilterViewModel.Branches.Add(new SelectListItem()
                        {
                            Text     = branch.Name,
                            Value    = branch.BranchId.ToString(),
                            Selected = (branch.BranchId == userFilterViewModel.BranchId)
                        });
                    }
                }
            }

            _viewName  = "_userfilter";
            _viewModel = userFilterViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.FilterViewModel] = userFilterViewModel.ToXml();
        }
Beispiel #27
0
        public void Execute()
        {
            /* State retrieval */
            OfficerTasksViewModel taskViewModel = null;

            if (_httpContext.Session["OfficerTaskViewModel"] != null)
            {
                taskViewModel = new OfficerTasksViewModel().FromXml(_httpContext.Session["OfficerTaskViewModel"].ToString());
            }
            else
            {
                taskViewModel = new OfficerTasksViewModel();
            }

            OfficerTaskListState taskListState = null;

            if (_httpContext.Session["OfficerTaskListState"] != null)
            {
                taskListState = (OfficerTaskListState)_httpContext.Session["OfficerTaskListState"];
            }
            else
            {
                taskListState = new OfficerTaskListState();
            }

            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 */
            OfficerTaskAttribute newSortColumn;

            if (!InputParameters.ContainsKey("Column"))
            {
                throw new ArgumentException("Column value was expected!");
            }
            else
            {
                newSortColumn = (OfficerTaskAttribute)Enum.Parse(typeof(OfficerTaskAttribute), InputParameters["Column"].ToString());
            }

            if (taskListState.SortColumn == newSortColumn)
            {
                // switch direction
                if (taskListState.SortDirection == "DESC")
                {
                    taskListState.SortDirection = "ASC";
                }
                else
                {
                    taskListState.SortDirection = "DESC";
                }
            }

            taskListState.SortColumn = newSortColumn;

            /* Command processing */
            var result = TaskServiceFacade.GetTasks(_httpContext.Session[SessionHelper.UserAccountIds] != null ? (List <int>)_httpContext.Session[SessionHelper.UserAccountIds] : new List <int> {
            },
                                                    taskListState.BoundDate,
                                                    taskListState.CurrentPage,
                                                    EnumHelper.GetStringValue(taskListState.SortColumn),
                                                    taskListState.SortDirection,
                                                    user.UserAccountId
                                                    );

            if (result != null)
            {
                taskViewModel.OfficerTasks = result.OfficerTasks;
                taskViewModel.PageCount    = result.TotalPages;
                taskViewModel.TotalItems   = result.TotalItems;
            }

            OfficerTaskGridHelper.ProcessPagingOptions(taskListState, taskViewModel);

            OfficerTaskGridHelper.ApplyClassCollection(taskViewModel);

            _viewName  = "_officertask";
            _viewModel = taskViewModel;

            /* Persist new state */
            _httpContext.Session["OfficerTaskViewModel"] = taskViewModel.ToXml();
            _httpContext.Session["OfficerTaskListState"] = taskListState;
        }
        public void Execute()
        {
            String searchValue = CommonHelper.GetSearchValue(_httpContext);

            AlertsListState alertListState = null;

            if (_httpContext.Session[SessionHelper.AlertsListState] != null)
            {
                alertListState = ( AlertsListState )_httpContext.Session[SessionHelper.AlertsListState];
            }
            else
            {
                alertListState = new AlertsListState();
            }

            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 */
            var newPageNumber = 0;

            if (!InputParameters.ContainsKey("Page"))
            {
                throw new ArgumentException("Page number was expected!");
            }
            else
            {
                newPageNumber = Convert.ToInt32(InputParameters["Page"]);
            }

            alertListState.CurrentPage = newPageNumber;

            /* 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();
            }
            var alertViewModel = AlertsDataHelper.RetrieveAlertViewModel(alertListState,
                                                                         _httpContext.Session[SessionHelper.UserAccountIds] != null ? (List <int>)_httpContext.Session[SessionHelper.UserAccountIds] : new List <int> {
            },
                                                                         alertListState.BoundDate, user.UserAccountId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue);

            _viewName  = "Queues/_alerts";
            _viewModel = alertViewModel;

            /* Persist new state */
            _httpContext.Session[SessionHelper.AlertViewModel]  = alertViewModel.ToXml();
            _httpContext.Session[SessionHelper.AlertsListState] = alertListState;
        }
        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;
        }
Beispiel #30
0
        public override void Execute()
        {
            base.Execute();

            FilterViewModel userFilterViewModel;

            if ((base.HttpContext != null) && (base.HttpContext.Session[SessionHelper.FilterViewModel] != null))
            {
                userFilterViewModel = new FilterViewModel().FromXml(base.HttpContext.Session[SessionHelper.FilterViewModel].ToString());
            }
            else
            {
                // possible state retrieval?
                userFilterViewModel = new FilterViewModel();
            }
            UserAccount user;

            if (base.HttpContext.Session[SessionHelper.UserData] != null && (( UserAccount )base.HttpContext.Session[SessionHelper.UserData]).Username == base.HttpContext.User.Identity.Name)
            {
                user = ( UserAccount )base.HttpContext.Session[SessionHelper.UserData];
            }
            else
            {
                user = UserAccountServiceFacade.GetUserByName(base.HttpContext.User.Identity.Name);
            }

            if (user == null)
            {
                throw new InvalidOperationException("User is null");
            }
            /* parameter processing */
            Int32 selectedUserId;

            if (!InputParameters.ContainsKey("UserId"))
            {
                throw new ArgumentException("UserId was expected!");
            }
            else
            {
                selectedUserId             = Convert.ToInt32(InputParameters["UserId"]);
                userFilterViewModel.UserId = selectedUserId;
            }

            var newUserAccountIds = selectedUserId > 0 ? new List <int> {
                selectedUserId
            } : AccountHelper.PopulateUserAccountIdsList(user);

            HttpContext.Session[SessionHelper.UserAccountIds] = newUserAccountIds;

            String searchValue = CommonHelper.GetSearchValue(base.HttpContext);

            switch (userFilterViewModel.FilterContext)
            {
            case FilterContextEnum.OfficerTask:
                RetrieveTasks(base.User, newUserAccountIds);
                break;

            case FilterContextEnum.Contact:
                RetrieveContacts(newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.Pipeline:
                RetrieveQueueLoans <PipelineListState, PipelineViewModel>(new PipelineListState(), new PipelineViewModel(), SessionHelper.PipelineListState,
                                                                          "Queues/_pipeline", SessionHelper.PipelineViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.NewLoanApplication:
                RetrieveQueueLoans <NewLoanApplicationListState, NewLoanApplicationViewModel>(new NewLoanApplicationListState(), new NewLoanApplicationViewModel(), SessionHelper.NewLoanApplicationListState,
                                                                                              "Queues/_newLoanApplication", SessionHelper.NewLoanApplicationViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.Alerts:
                RetrieveQueueLoans <AlertsListState, AlertsViewModel>(new AlertsListState(), new AlertsViewModel(), SessionHelper.AlertsListState,
                                                                      "Queues/_alerts", SessionHelper.AlertViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.PendingApproval:
                RetrieveQueueLoans <PendingApprovalListState, AlertsViewModel>(new PendingApprovalListState(), new AlertsViewModel(), SessionHelper.PendingApprovalListState,
                                                                               "Queues/_pendingapproval", SessionHelper.PendingApprovalViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.CompletedLoans:
                RetrieveQueueLoans <CompletedLoansListState, CompletedLoansViewModel>(new CompletedLoansListState(), new CompletedLoansViewModel(), SessionHelper.CompletedLoansListState,
                                                                                      "Queues/_completedloans", SessionHelper.CompletedLoansViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.Cancel:
                RetrieveQueueLoans <CancelLoanListState, CancelViewModel>(new CancelLoanListState(), new CancelViewModel(), SessionHelper.CancelListState,
                                                                          "Queues/_cancel", SessionHelper.CancelViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.PreApproval:
                RetrieveQueueLoans <PreApprovalListState, PreApprovalViewModel>(new PreApprovalListState(), new PreApprovalViewModel(), SessionHelper.PreApprovalListState,
                                                                                "Queues/_preapproval", SessionHelper.PreApprovalViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.OrderRequested:
                RetrieveQueueLoans <OrderRequestedListState, OrderRequestedViewModel>(new OrderRequestedListState(), new OrderRequestedViewModel(), SessionHelper.OrderRequestedListState,
                                                                                      "Queues/_orderRequested", SessionHelper.OrderRequestedViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.OrderProcessed:
                RetrieveQueueLoans <OrderProcessedListState, OrderProcessedViewModel>(new OrderProcessedListState(), new OrderProcessedViewModel(), SessionHelper.OrderProcessedListState,
                                                                                      "Queues/_orderProcessed", SessionHelper.OrderProcessedViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.OrderDeliveredForReview:
                RetrieveQueueLoans <OrderDeliveredForReviewListState, OrderDeliveredForReviewViewModel>(new OrderDeliveredForReviewListState(), new OrderDeliveredForReviewViewModel(), SessionHelper.OrderDeliveredForReviewListState,
                                                                                                        "Queues/_orderDeliveredForReview", SessionHelper.OrderDeliveredForReviewViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.OrderException:
                RetrieveQueueLoans <OrderExceptionListState, OrderExceptionViewModel>(new OrderExceptionListState(), new OrderExceptionViewModel(), SessionHelper.OrderExceptionListState,
                                                                                      "Queues/_orderException", SessionHelper.OrderExceptionViewModel, newUserAccountIds, searchValue);
                break;

            case FilterContextEnum.MailRoom:
                RetrieveQueueLoans <MailRoomListState, MailRoomViewModel>(new MailRoomListState(), new MailRoomViewModel(), SessionHelper.MailRoomListState,
                                                                          "Queues/_mailRoom", SessionHelper.MailRoomViewModel, newUserAccountIds, searchValue);
                break;

            default:
                base.ViewName = string.Empty;
                base.ViewData = null;
                break;
            }

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.FilterViewModel] = userFilterViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.UserAccountIds]  = newUserAccountIds;
        }