public string CustomerReportExport(CustomerExportListModelFilter filter, long userId) { var dataGen = new ExportableDataGenerator <CustomerExportModel, CustomerExportListModelFilter>(_eventCustomerReportingService.GetCustomersForExport, Logger); var model = dataGen.GetData(filter); /*var exporter = ExportableDataGeneratorProcessManager<ViewModelBase, ModelFilterBase>.GetCsvExporter<CustomerExportModel>();*/ return(WriteCsvForCustomerExport(GetExportableFileName("CustomerExport"), model.Collection, userId)); }
public ActionResult CustomerExport(CustomerExportListModelFilter filter = null, int pageNumber = 1) { int totalRecords; var model = _eventCustomerReportingService.GetCustomersForExport(pageNumber, _pageSize, filter, out totalRecords); if (model == null) { model = new CustomerExportListModel(); } model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); var routeValueDictionary = GetRouteValueDictionaryForCustomerExport(filter); Func <int, string> urlFunc = pn => Url.Action(currentAction, AddRouteValueDictionary(routeValueDictionary, pn)); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }
private RouteValueDictionary GetRouteValueDictionaryForCustomerExport(CustomerExportListModelFilter filter) { var routeValueDictionary = new RouteValueDictionary { { "FromDate", filter.FromDate }, { "ToDate", filter.ToDate }, { "FirstName", filter.FirstName }, { "LastName", filter.LastName }, { "CustomerId", filter.CustomerId }, { "IsAttendedCustomers", filter.IsAttendedCustomers }, { "IsNotAttendedCustomers", filter.IsNotAttendedCustomers }, { "IsRetailEvent", filter.IsRetailEvent }, { "IsCorporateEvent", filter.IsCorporateEvent }, { "IsPublicEvent", filter.IsPublicEvent }, { "IsPrivateEvent", filter.IsPrivateEvent }, { "Tag", filter.Tag }, { "DoNotContactOnly", filter.DoNotContactOnly }, { "IncludeDoNotContact", filter.IncludeDoNotContact }, { "EligibleStatus", filter.EligibleStatus }, { "HealthPlanId", filter.HealthPlanId }, { "AppointmentFrom", filter.AppointmentFrom }, { "AppointmentTo", filter.AppointmentTo }, { "ProductTypeId", filter.ProductTypeId } }; if (!filter.CustomTags.IsNullOrEmpty()) { var index = 0; foreach (var customtag in filter.CustomTags) { routeValueDictionary.Add(string.Format("CustomTags[{0}]", index), customtag); index++; } } return(routeValueDictionary); }
public ActionResult CustomerExport(CustomerExportListModelFilter filter = null) { return(CreateExportQueue(filter, ExportableReportType.CustomerExport, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId)); }