private ShopFloorModel CreateShopFloorModel(int id, string stocknumber) { ShopFloorModel model = new ShopFloorModel(); if (id > 0) { model.Invoice = InvoiceServices.GetInvoice(id); if (model.Invoice == null) { model.NoDataMessage = string.Format("We could not find an invoice with an id = {0}", id); } } else if (!string.IsNullOrEmpty(stocknumber)) { model.Invoice = InvoiceServices.GetInvoice(stocknumber); if (model.Invoice == null) { model.NoDataMessage = string.Format("We could not find an invoice with a stock number = {0}", stocknumber); } } else { model.NoDataMessage = "There are no vehicles logged into the shop at this time"; } model.Services = InvoiceServices.GetServices(base.LocationId, model.Invoice); model.VehiclesInShop = NavigationServices.GetVehiclesInShop(base.LocationId).OrderBy(o => o.Id).ToList(); model.VehiclesCompleted = NavigationServices.GetVehiclesCompletedToday(base.LocationId).OrderBy(o => o.Id).ToList(); return(model); }
public ActionResult InvoiceReport(int id) { InvoiceReportModel model = new InvoiceReportModel(); model.Invoice = InvoiceServices.GetInvoice(id); model.Account = AccountServices.GetAccount(model.Invoice.AccountName); model.Header = new ReportHeaderModel("Invoice"); return(View(model)); }