public ActionResult EventCustomers(HospitalPartnerCustomerListModelFilter filter, int pageNumber = 1) { int totalRecords = 0; var model = _eventService.GetEventSummary(filter.EventId); if (_sessionContext.UserSession.CurrentOrganizationRole.RoleId == (long)Roles.HospitalPartnerCoordinator) { filter.HospitalPartnerId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId; } else if (_sessionContext.UserSession.CurrentOrganizationRole.RoleId == (long)Roles.HospitalFacilityCoordinator) { filter.HospitalFacilityId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId; filter.HospitalPartnerId = 0; } model.Customers = _hospitalPartnerService.GetHospitalPartnerEventCustomers(pageNumber, _pageSize, filter, out totalRecords) ?? new HospitalPartnerCustomerListModel(); model.Customers.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.EventId, filter.HospitalPartnerId, filter.HospitalFacilityId, filter.SortingColumn, filter.SortingOrder }); model.Customers.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }
public ActionResult CustomerAggregateResultSummary(HospitalPartnerCustomerListModelFilter filter = null, int pageNumber = 1) { var filterValidator = IoC.Resolve <HospitalPartnerCustomerListModelFilterValidator>(); var result = filterValidator.Validate(filter); if (!result.IsValid) { var propertyNames = result.Errors.Select(e => e.PropertyName).Distinct(); var htmlString = propertyNames.Aggregate("", (current, property) => current + (result.Errors.Where(e => e.PropertyName == property).FirstOrDefault().ErrorMessage + "<br />")); return(View(new HospitalPartnerCustomerListModel { Filter = filter, FeedbackMessage = FeedbackMessageModel.CreateFailureMessage(htmlString) })); } int totalRecords = 0; var model = _hospitalPartnerService.GetCustomerAggregateResultSummary(pageNumber, _pageSize, filter, out totalRecords) ?? new HospitalPartnerCustomerListModel(); model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.FromDate, filter.ToDate, filter.HospitalPartnerId, filter.CustomerId, filter.CustomerName, filter.Pod, filter.CorporateAccountId, filter.IsRetailEvent, filter.IsCorporateEvent, filter.IsHospitalPartnerAttached, filter.IsPublicEvent, filter.IsPrivateEvent, filter.ResultSummary, filter.Status, filter.DateType, filter.PhoneNumber, filter.SortingColumn, filter.SortingOrder }); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }
public void SearchCustomersAsync(string id = null, HospitalPartnerCustomerListModelFilter filter = null) { if (id == null) { return; } AsyncManager.OutstandingOperations.Increment(); var dataGen = new ExportableDataGenerator <HospitalPartnerCustomerViewModel, HospitalPartnerCustomerListModelFilter>( _hospitalPartnerService.GetHospitalPartnerCustomers); var processmanager = new ExportableDataGeneratorProcessManager <HospitalPartnerCustomerViewModel, HospitalPartnerCustomerListModelFilter>(); processmanager.Add(id, dataGen); GetNewProcessStarted(filter, dataGen, id); }
public ActionResult SearchCustomers(HospitalPartnerCustomerListModelFilter filter = null, int pageNumber = 1) { var filterValidator = IoC.Resolve <HospitalPartnerCustomerListModelFilterValidator>(); var result = filterValidator.Validate(filter); if (!result.IsValid) { var propertyNames = result.Errors.Select(e => e.PropertyName).Distinct(); var htmlString = propertyNames.Aggregate("", (current, property) => current + (result.Errors.Where(e => e.PropertyName == property).FirstOrDefault().ErrorMessage + "<br />")); return(View(new HospitalPartnerCustomerListModel { Filter = filter, FeedbackMessage = FeedbackMessageModel.CreateFailureMessage(htmlString) })); } int totalRecords = 0; if (_sessionContext.UserSession.CurrentOrganizationRole.GetSystemRoleId == (long)Roles.HospitalPartnerCoordinator) { if (filter == null) { filter = new HospitalPartnerCustomerListModelFilter { HospitalPartnerId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId } } ; else { filter.HospitalPartnerId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId; } } else if (_sessionContext.UserSession.CurrentOrganizationRole.CheckRole((long)Roles.HospitalFacilityCoordinator)) { if (filter == null) { filter = new HospitalPartnerCustomerListModelFilter { HospitalFacilityId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId, HospitalPartnerId = 0 } } ; else { filter.HospitalFacilityId = _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId; filter.HospitalPartnerId = 0; } } var model = _hospitalPartnerService.GetHospitalPartnerCustomers(pageNumber, _pageSize, filter, out totalRecords) ?? new HospitalPartnerCustomerListModel(); model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.FromDate, filter.ToDate, filter.HospitalPartnerId, filter.HospitalFacilityId, filter.CustomerId, filter.CustomerName, filter.Pod, filter.ResultSummary, filter.Status, filter.DateType, filter.PhoneNumber, filter.CriticalMarkedByTechnician, filter.SortingColumn, filter.SortingOrder }); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }