コード例 #1
0
        /// <summary>
        /// Based on Type calls different methods for retreiving data
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="listState"></param>
        /// <param name="userAccounts"></param>
        /// <param name="userId"></param>
        /// <param name="searchValue"></param>
        /// <returns></returns>
        private object HandleRetrieveQueueLoans <T>(T listState, List <int> userAccounts, int userId, String searchValue)
        {
            FilterViewModel userFilterViewModel = null;

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

            if (listState is NewLoanApplicationListState)
            {
                return(( object )NewLoanApplicationDataHelper.RetrieveNewApplicationViewModel((listState as NewLoanApplicationListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is OrderExceptionListState)
            {
                return(( object )OrderExceptionDataHelper.RetrieveOrderExceptionViewModel((listState as OrderExceptionListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is OrderDeliveredForReviewListState)
            {
                return(( object )OrderDeliveredForReviewDataHelper.RetrieveOrderDeliveredForReviewViewModel((listState as OrderDeliveredForReviewListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is OrderProcessedListState)
            {
                return(( object )OrderProcessedDataHelper.RetrieveOrderProcessedViewModel((listState as OrderProcessedListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is OrderRequestedListState)
            {
                return(( object )OrderRequestedDataHelper.RetrieveOrderRequestedViewModel((listState as OrderRequestedListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is CompletedLoansListState)
            {
                return(( object )CompletedLoansDataHelper.RetrieveCompletedLoansViewModel((listState as CompletedLoansListState), userAccounts, userId, searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId));
            }
            if (listState is CancelLoanListState)
            {
                return(( object )CancelDataHelper.RetrieveCancelViewModel((listState as CancelLoanListState), userAccounts,
                                                                          ((listState as CancelLoanListState)).BoundDate, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }
            if (listState is AlertsListState)
            {
                return(( object )AlertsDataHelper.RetrieveAlertViewModel((listState as AlertsListState), userAccounts,
                                                                         (listState as AlertsListState).BoundDate, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId));
            }
            if (listState is PendingApprovalListState)
            {
                return(( object )PendingApprovalDataHelper.RetrievePendingApprovalViewModel((listState as PendingApprovalListState), userAccounts, userId, searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId
                                                                                            ));
            }
            if (listState is PreApprovalListState)
            {
                return(( object )PreApprovalDataHelper.RetrievePreApprovalViewModel((listState as PreApprovalListState), userAccounts, userId, searchValue, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId));
            }
            if (listState is PipelineListState)
            {
                return(( object )PipelineDataHelper.RetrievePipelineViewModel((listState as PipelineListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }

            if (listState is MailRoomListState)
            {
                return(( object )MailRoomDataHelper.RetrieveMailRoomViewModel((listState as MailRoomListState), userAccounts, userId, userFilterViewModel.CompanyId, userFilterViewModel.ChannelId, userFilterViewModel.DivisionId, userFilterViewModel.BranchId, searchValue));
            }

            return(null);
        }
        public override void Execute()
        {
            String serarchValue = CommonHelper.GetSearchValue(base.HttpContext);

            OrderDeliveredForReviewListState orderDeliveredForReviewListState = null;

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

            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.OrderDeliveredForReview;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderDeliveredForReview;
            }

            Boolean refresh = InputParameters != null && InputParameters.ContainsKey("Refresh") && InputParameters["Refresh"].ToString().Trim() == "true";

            if (!refresh)
            {
                orderDeliveredForReviewListState.CurrentPage = 1;
            }

            UserAccount user = null;

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

            OrderDeliveredForReviewViewModel orderDeliveredForReviewViewModel = new OrderDeliveredForReviewViewModel();

            orderDeliveredForReviewViewModel = OrderDeliveredForReviewDataHelper.RetrieveOrderDeliveredForReviewViewModel(orderDeliveredForReviewListState,
                                                                                                                          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, serarchValue);

            OrderDeliveredForReviewGridHelper.ProcessPagingOptions(orderDeliveredForReviewListState, orderDeliveredForReviewViewModel);
            OrderDeliveredForReviewGridHelper.ApplyClassCollection(orderDeliveredForReviewViewModel);

            ViewName = "Queues/_orderDeliveredForReview";
            ViewData = orderDeliveredForReviewViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewViewModel] = orderDeliveredForReviewViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewListState] = orderDeliveredForReviewListState;
            base.HttpContext.Session[SessionHelper.FilterViewModel] = filterViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.CurrentTab]      = LoanCenterTab.OrderDeliveredForReview;
        }
コード例 #3
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.OrderDeliveredForReview;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderDeliveredForReview;
            }

            OrderDeliveredForReviewListState orderDeliveredForReviewListState;

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

            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());

            orderDeliveredForReviewListState.BoundDate = newDateFilterValue;

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

            /* Command processing */
            OrderDeliveredForReviewViewModel orderDeliveredForReviewViewModel = OrderDeliveredForReviewDataHelper.RetrieveOrderDeliveredForReviewViewModel(orderDeliveredForReviewListState,
                                                                                                                                                           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/_orderDeliveredForReview";
            ViewData = orderDeliveredForReviewViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewViewModel] = orderDeliveredForReviewViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewListState] = orderDeliveredForReviewListState;
        }
コード例 #4
0
        public override void Execute()
        {
            var searchValue = CommonHelper.GetSearchValue(base.HttpContext);

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

            OrderDeliveredForReviewListState orderDeliveredForReviewListState;

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

            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.OrderDeliveredForReview;
            }
            else
            {
                filterViewModel = new FilterViewModel();
                filterViewModel.FilterContext = Helpers.Enums.FilterContextEnum.OrderDeliveredForReview;
            }

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

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

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

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

            orderDeliveredForReviewListState.SortColumn  = newSortColumn;
            orderDeliveredForReviewListState.CurrentPage = 1;

            /* Command processing */

            var orderDeliveredForReviewViewData = OrderDeliveredForReviewDataHelper.RetrieveOrderDeliveredForReviewViewModel(orderDeliveredForReviewListState,
                                                                                                                             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 (orderDeliveredForReviewViewModel != null)
            {
                orderDeliveredForReviewViewModel.DeliveredForReviewOrders = orderDeliveredForReviewViewData.DeliveredForReviewOrders;
                orderDeliveredForReviewViewModel.PageCount  = orderDeliveredForReviewViewData.PageCount;
                orderDeliveredForReviewViewModel.TotalItems = orderDeliveredForReviewViewData.TotalItems;

                OrderDeliveredForReviewGridHelper.ProcessPagingOptions(orderDeliveredForReviewListState, orderDeliveredForReviewViewModel);
            }


            ViewName = "Queues/_orderDeliveredForReview";
            ViewData = orderDeliveredForReviewViewModel;

            /* Persist new state */
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewViewModel] = orderDeliveredForReviewViewModel.ToXml();
            base.HttpContext.Session[SessionHelper.OrderDeliveredForReviewListState] = orderDeliveredForReviewListState;
        }