Пример #1
0
        public ActionResult LoadPolicy(JQueryDataTablesModel jQueryDataTablesModel)
        {
            SearchParameter param = new SearchParameter();

            param.SearchColumn = new List <string> {
                "Id",
                "InsuredName",
                "InsuredAddress",
                "InsuredPhone",
                "InsuredEmail",
                "ProposalNumber",
                "PersonalProperty",
                "Liability",
                "Premium",
                "EffectiveDate",
                "NoOffInstallments",
                "SendLandLord"
            };
            param.SearchColumnValue = jQueryDataTablesModel.sSearch_;
            param.StartIndex        = jQueryDataTablesModel.iDisplayStart;
            param.PageSize          = jQueryDataTablesModel.iDisplayLength;
            List <QuoteDto> sourceData = _rentalServiceFacade.GetPolicies(param);
            var             quotes     = GenericFilterHelper <QuoteDto> .GetFilteredRecords(
                sourceData : sourceData,
                startIndex : jQueryDataTablesModel.iDisplayStart,
                pageSize : jQueryDataTablesModel.iDisplayLength,
                sortedColumns : jQueryDataTablesModel.GetSortedColumns(string.Empty),
                totalRecordCount : param.TotalRecordCount,
                isSearch : param.IsFilterValue,
                searchString : jQueryDataTablesModel.sSearch,
                searchColumnValues : jQueryDataTablesModel.sSearch_,
                properties : new List <string> {
                "Id",
                "InsuredName",
                "InsuredAddress",
                "InsuredPhone",
                "InsuredEmail",
                "ProposalNumber",
                "PersonalProperty",
                "Liability",
                "Premium",
                "EffectiveDate",
                "NoOffInstallments",
                "SendLandLord"
            });

            return(Json(new JQueryDataTablesResponse <QuoteDto>(
                            items: quotes,
                            totalRecords: param.TotalRecordCount,
                            totalDisplayRecords: param.SearchedCount,
                            sEcho: jQueryDataTablesModel.sEcho)));
        }
Пример #2
0
        public ActionResult Index()
        {
            DashboardViewModel model          = new DashboardViewModel();
            DateTime           sevenDaysPrior = DateTime.Now.AddDays(-7);
            List <Customer>    customerList   = _rentalFacade.GetCustomers(sevenDaysPrior);
            List <QuoteDto>    policyList     = _rentalFacade.GetPolicies(sevenDaysPrior);

            model.NoOfNewCustomersInLast1Week = customerList.Count();
            model.NoOfNewCustomersInLast1Day  = customerList.Where(x => x.CreationDate > DateTime.Now.AddDays(-1)).Count();
            model.NoOfNewCustomersInLast3Days = customerList.Where(x => x.CreationDate > DateTime.Now.AddDays(-3)).Count();

            model.NoOfNewPoliciesGeneratedInLast1Week = policyList.Count();
            model.NoOfNewPoliciesGeneratedInLast1Day  = policyList.Where(x => x.CreationDate > DateTime.Now.AddDays(-1)).Count();
            model.NoOfNewPoliciesGeneratedInLast3Days = policyList.Where(x => x.CreationDate > DateTime.Now.AddDays(-3)).Count();

            model.PremiumChargedInLast1Day  = policyList.Where(x => x.CreationDate > DateTime.Now.AddDays(-1)).Select(x => x.TotalChargedToday).Sum();
            model.PremiumChargedInLast3Days = policyList.Where(x => x.CreationDate > DateTime.Now.AddDays(-3)).Select(x => x.TotalChargedToday).Sum();
            model.PremiumChargedInLast1Week = policyList.Select(x => x.TotalChargedToday).Sum();

            model.IsPaymentProcessorLive = true;
            model.IsAegisServiceLive     = true;
            return(View(model));
        }