/// <summary> /// Prepare paged registered customers report list model /// </summary> /// <param name="searchModel">Registered customers report search model</param> /// <returns>Registered customers report list model</returns> public virtual RegisteredCustomersReportListModel PrepareRegisteredCustomersReportListModel(RegisteredCustomersReportSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get report items var reportItems = new List <RegisteredCustomersReportModel> { new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.7days"), Customers = _customerReportService.GetRegisteredCustomersReport(7) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.14days"), Customers = _customerReportService.GetRegisteredCustomersReport(14) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.month"), Customers = _customerReportService.GetRegisteredCustomersReport(30) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.year"), Customers = _customerReportService.GetRegisteredCustomersReport(365) } }; //prepare list model var model = new RegisteredCustomersReportListModel { Data = reportItems.PaginationByRequestModel(searchModel), Total = reportItems.Count }; return(model); }
/// <summary> /// Prepare registered customers report search model /// </summary> /// <param name="searchModel">Registered customers report search model</param> /// <returns>Registered customers report search model</returns> protected virtual RegisteredCustomersReportSearchModel PrepareRegisteredCustomersReportSearchModel(RegisteredCustomersReportSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //prepare page parameters searchModel.SetGridPageSize(); return(searchModel); }
/// <summary> /// Prepare paged registered customers report list model /// </summary> /// <param name="searchModel">Registered customers report search model</param> /// <returns>Registered customers report list model</returns> public virtual RegisteredCustomersReportListModel PrepareRegisteredCustomersReportListModel(RegisteredCustomersReportSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get report items var reportItems = new List <RegisteredCustomersReportModel> { new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.7days"), Customers = _customerReportService.GetRegisteredCustomersReport(7) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.14days"), Customers = _customerReportService.GetRegisteredCustomersReport(14) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.month"), Customers = _customerReportService.GetRegisteredCustomersReport(30) }, new RegisteredCustomersReportModel { Period = _localizationService.GetResource("Admin.Reports.Customers.RegisteredCustomers.Fields.Period.year"), Customers = _customerReportService.GetRegisteredCustomersReport(365) } }; var pagedList = reportItems.ToPagedList(searchModel); //prepare list model var model = new RegisteredCustomersReportListModel().PrepareToGrid(searchModel, pagedList, () => { return(pagedList); }); return(model); }
/// <summary> /// Prepare registered customers report search model /// </summary> /// <param name="searchModel">Registered customers report search model</param> /// <returns>Registered customers report search model</returns> protected virtual Task <RegisteredCustomersReportSearchModel> PrepareRegisteredCustomersReportSearchModelAsync(RegisteredCustomersReportSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //prepare page parameters searchModel.SetGridPageSize(); return(Task.FromResult(searchModel)); }
public CustomerReportsSearchModel() { BestCustomersByOrderTotal = new BestCustomersReportSearchModel(); BestCustomersByNumberOfOrders = new BestCustomersReportSearchModel(); RegisteredCustomers = new RegisteredCustomersReportSearchModel(); }
public CustomerReportsSearchModel() { RegisteredCustomers = new RegisteredCustomersReportSearchModel(); }