private HealthPlanRevenueEventListModel SelectHealthPlanRevenueEventList(long healthPlanId, int pageNumber = 1) { int pageSize = 10; int totalRecords; var filter = new HealthPlanRevenueEventModelFilter(); filter.HealthPlanId = healthPlanId; var model = _healthPlanRevenueService.GetEventListByHealthPlan(filter, pageNumber, pageSize, out totalRecords); if (model == null) { model = new HealthPlanRevenueEventListModel(); } var currentAction = "HealthPlanEventInfo"; Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.HealthPlanId }); model.PagingModel = new PagingModel(pageNumber, pageSize, totalRecords, urlFunc); return(model); }
public HealthPlanRevenueEventListModel GetEventListByHealthPlan(IEnumerable <Event> events, IEnumerable <Host> hosts, IEnumerable <OrderedPair <long, int> > customersAttended) { var model = new HealthPlanRevenueEventListModel(); var healthPlanRevenueEventInfoList = new List <HealthPlanRevenueEventInfoModel>(); events.ToList().ForEach(e => { var host = hosts.Where(h => h.Id == e.HostId).FirstOrDefault(); var screenedCustomersCount = customersAttended.Where(bs => bs.FirstValue == e.Id).FirstOrDefault().SecondValue; var healthPlanRevenueEventInfo = new HealthPlanRevenueEventInfoModel { EventId = e.Id, Location = host != null ? host.Address : null, ScreenedCustomers = screenedCustomersCount, }; healthPlanRevenueEventInfoList.Add(healthPlanRevenueEventInfo); }); model.Collection = healthPlanRevenueEventInfoList; return(model); }