public MTDViewModel(int userID, DateTime startDate, DateTime endDate, int dealerID, List <MTDFilterObj> filters) : base(userID) { this.StartDate = startDate.Date; this.EndDate = endDate.Date; this.Filters = filters; this.Dealerships = new List <DealerShip>(); this.VehicleTypes = new List <VehicleType>(); this.DealStatuses = new List <DealStatu>(); this.VehicleKinds = new List <Vehicle>(); this.BusinessSources = new List <BUSINESSSOURCE>(); this.SalesCategories = new List <SalesCategory>(); this.FinanceManagers = new List <FinanceManager>(); this.SalesManagers = new List <SalesManager>(); this.SalesPeople = new List <SalesPerson>(); MTDRecapBiz biz = new MTDRecapBiz(DealerIDs, StartDate, EndDate, dealerID, Filters); this.MTDReport = biz.BuildMTDReport(); this.Dealerships = biz.Dealerships; this.Dealership = biz.Dealership; this.VehicleTypes = biz.VehicleTypes; this.DealStatuses = biz.DealStatuses; this.VehicleType = biz.VehicleType; this.VehicleKinds = biz.VehicleKinds; this.BusinessSources = biz.BusinessSources.Where(b => (b.DisableDate == null || b.DisableDate > this.StartDate)).ToList(); this.SalesCategories = biz.SalesCategories; this.FinanceManagers = biz.FinanceManagers.Where(f => (f.DisableDate == null || f.DisableDate >= this.StartDate)).ToList(); this.SalesManagers = biz.SalesManagers.Where(sm => (sm.DisableDate == null || sm.DisableDate > this.StartDate)).ToList(); this.SalesPeople = biz.SalesPeople.Where(sp => (sp.DisableDate == null || sp.DisableDate > this.StartDate)).ToList(); this.VehicleTypes.Add(new VehicleType { VehicleTypeId = 0, VehicleType1 = "All" }); this.DealStatuses.Add(new DealStatu { StatusId = 0, StatusName = "All" }); this.VehicleKinds.Add(new Vehicle { VehicleId = 0, Vehicle1 = "All" }); this.SalesCategories.Add(new SalesCategory { SalesCategoryId = 0, SalesCategory1 = "All" }); this.FinanceManagers.Add(new FinanceManager { FMId = 0, FMName = "All" }); this.SalesManagers.Add(new SalesManager { SMId = 0, SMName = "All" }); this.SalesPeople.Add(new SalesPerson { ID = 0, SPName = "[All]" }); this.BusinessSources.Add(new BUSINESSSOURCE { BusinessSourceID = 0, BusinessSource1 = "All" }); }
public List <MTDReportObject> BuildMTDREport(List <int> DealerIDs) { MTDRecapBiz biz = new MTDRecapBiz(DealerIDs, StartDate, EndDate, DealerID, VehicleType); this.Dealerships = biz.Dealerships; this.Dealership = biz.Dealership; this.MTDReport = biz.BuildMTDReport(); return(MTDReport); }