public void RemoveVehicleFromInShopList(int locationId, InvoiceModel vehicle)
 {
     GetVehiclesInShop(locationId).RemoveAll(x => x.Id == vehicle.Id);
 }
 public void AddVehicleToInShopList(int locationId, InvoiceModel vehicle)
 {
     GetVehiclesInShop(locationId).Add(Mapper.Map<Models.InvoiceModel, Models.InvoiceNavigationModel>(vehicle));
 }
 public void RemoveVehicleFromCompletedTodayList(int locationId, InvoiceModel vehicle)
 {
     GetVehiclesCompletedToday(locationId).RemoveAll(x => x.Id == vehicle.Id);
 }
Example #4
0
        protected override void BuildSubMenus()
        {
            var model = Model as ShopFloorModel;
            if (model != null) CurrentInvoice = model.Invoice;

            SubMenu.Add(new MenuItem("new-vehicle-menuitem", "New Vehicle")
            {
                HelpText = "Log a new vehicle into the current location",
                Controller = ShopFloorController,
                Action = "NewVehicle",
                IsSelected = (ActionName == "NewVehicle")
            });
            SubMenu.Add(new MenuItem("print-invoice-menuitem", "Print Invoice")
            {
                HelpText = "Open an invoice report for the current vehicle",
                Controller = ReportController,
                Action = "InvoiceReport",
                IsEnabled = (CurrentInvoice != null)
            });
            SubMenu.Add(new MenuItem("complete-vehicle-menuitem", "Complete Vehicle")
            {
                HelpText = "Flag the current vehicle as completed",
                Controller = ShopFloorController,
                Action = "CompleteVehicle",
                IsEnabled = (CurrentInvoice != null),
                IsVisible = (CurrentInvoice != null && !CurrentInvoice.IsComplete)
            });
            SubMenu.Add(new MenuItem("recall-vehicle-menuitem", "Recall Vehicle")
            {
                HelpText = "Recall the current vehicle back to the shop",
                Controller = ShopFloorController,
                Action = "RecallVehicle",
                IsEnabled = (CurrentInvoice != null),
                IsVisible = (CurrentInvoice != null && CurrentInvoice.IsComplete)
            });
            SubMenu.Add(new MenuItem("add-history-menuitem", "Add Note")
            {
                HelpText = "Add a note to the history of the current vehicle",
                Controller = ShopFloorController,
                Action = "AddHistory",
                IsEnabled = (CurrentInvoice != null && !string.IsNullOrEmpty(CurrentInvoice.StockNumber))
            });
            SubMenu.Add(new MenuItem("delete-invoice-menuitem", "Delete Invoice")
            {
                HelpText = "Permanently delete the current invoice",
                Controller = ShopFloorController,
                Action = "DeleteInvoice",
                IsEnabled = (CurrentInvoice != null),
                IsVisible = (RoleName == "Administrator")
            });
            SubMenu.Add(new MenuItem("find-invoice-menuitem", "Search")
            {
                HelpText = "Find a vehicle by invoice number or stock number",
                Controller = ShopFloorController,
                Action = "FindInvoice"
            });
            SubMenu.Add(new MenuItem("sign-in-menuitem", "Sign In")
            {
                HelpText = "Sign in to the shop at the current location",
                Controller = ShopFloorController,
                Action = "SignIn"
            });
            SubMenu.Add(new MenuItem("sign-out-menuitem", "Sign Out")
            {
                HelpText = "Sign out of the shop at the current location",
                Controller = ShopFloorController,
                Action = "SignOut"
            });
        }
 public void AddVehicleToCompletedTodayList(int locationId, InvoiceModel vehicle)
 {
     GetVehiclesCompletedToday(locationId).Add(Mapper.Map<Models.InvoiceModel, Models.InvoiceNavigationModel>(vehicle));
 }
Example #6
0
        private List<LaborTypeModel> GetAvailableLaborTypes(InvoiceModel invoice)
        {
            if (invoice == null) return new List<LaborTypeModel>();

            var serviceTypes = invoice.ServiceList.Select(s => s.ServiceTypeDescription);
            return AvailableLaborTypes
                .Where(l => serviceTypes.Contains(l.ServiceTypeDescription))
                .Select(l => new LaborTypeModel() { Id = l.LaborTypeId, Description = l.LaborTypeDescription }).ToList();
        }
Example #7
0
        private List<ServiceTypeModel> GetAvailableServiceTypes(InvoiceModel invoice)
        {
            if (invoice == null) return new List<ServiceTypeModel>();

            return AvailableServiceTypes
                .Where(s => s.AccountTypeDescription == invoice.AccountType)
                .Select(s => new ServiceTypeModel() { Id = s.ServiceTypeId, Description = s.ServiceTypeDescription }).ToList();
        }
Example #8
0
 public List<HistoryModel> GetStockNumberHistory(InvoiceModel invoice)
 {
     var history = InvoiceRepository.GetInvoiceHistory(invoice.StockNumber);
     return Mapper.Map<IList<Data.Graph.StockNumberHistory>, List<HistoryModel>>(history);
 }
Example #9
0
 public ServicesModel GetServices(int locationId, InvoiceModel invoice)
 {
     ServicesModel model = new ServicesModel();
     model.AvailableLabor = GetAvailableLaborTypes(invoice);
     model.AvailableServices = GetAvailableServiceTypes(invoice);
     model.SignedInEmployees = GetSignedInEmployees(locationId);
     return model;
 }
 public InvoiceAdministrationModel(InvoiceFilterModel filter)
 {
     Filter = filter;
     InvoiceList = new PagedList<int>(new List<int>(), Filter.Page, Filter.Size);
     CurrentInvoice = new InvoiceModel();
 }
 public InvoiceAdministrationModel(InvoiceFilterModel filter)
 {
     Filter         = filter;
     InvoiceList    = new PagedList <int>(new List <int>(), Filter.Page, Filter.Size);
     CurrentInvoice = new InvoiceModel();
 }
Example #12
0
        protected override void BuildSubMenus()
        {
            var model = Model as ShopFloorModel;

            if (model != null)
            {
                CurrentInvoice = model.Invoice;
            }

            SubMenu.Add(new MenuItem("new-vehicle-menuitem", "New Vehicle")
            {
                HelpText   = "Log a new vehicle into the current location",
                Controller = ShopFloorController,
                Action     = "NewVehicle",
                IsSelected = (ActionName == "NewVehicle")
            });
            SubMenu.Add(new MenuItem("print-invoice-menuitem", "Print Invoice")
            {
                HelpText   = "Open an invoice report for the current vehicle",
                Controller = ReportController,
                Action     = "InvoiceReport",
                IsEnabled  = (CurrentInvoice != null)
            });
            SubMenu.Add(new MenuItem("complete-vehicle-menuitem", "Complete Vehicle")
            {
                HelpText   = "Flag the current vehicle as completed",
                Controller = ShopFloorController,
                Action     = "CompleteVehicle",
                IsEnabled  = (CurrentInvoice != null),
                IsVisible  = (CurrentInvoice != null && !CurrentInvoice.IsComplete)
            });
            SubMenu.Add(new MenuItem("recall-vehicle-menuitem", "Recall Vehicle")
            {
                HelpText   = "Recall the current vehicle back to the shop",
                Controller = ShopFloorController,
                Action     = "RecallVehicle",
                IsEnabled  = (CurrentInvoice != null),
                IsVisible  = (CurrentInvoice != null && CurrentInvoice.IsComplete)
            });
            SubMenu.Add(new MenuItem("add-history-menuitem", "Add Note")
            {
                HelpText   = "Add a note to the history of the current vehicle",
                Controller = ShopFloorController,
                Action     = "AddHistory",
                IsEnabled  = (CurrentInvoice != null && !string.IsNullOrEmpty(CurrentInvoice.StockNumber))
            });
            SubMenu.Add(new MenuItem("delete-invoice-menuitem", "Delete Invoice")
            {
                HelpText   = "Permanently delete the current invoice",
                Controller = ShopFloorController,
                Action     = "DeleteInvoice",
                IsEnabled  = (CurrentInvoice != null),
                IsVisible  = (RoleName == "Administrator")
            });
            SubMenu.Add(new MenuItem("find-invoice-menuitem", "Search")
            {
                HelpText   = "Find a vehicle by invoice number or stock number",
                Controller = ShopFloorController,
                Action     = "FindInvoice"
            });
            SubMenu.Add(new MenuItem("sign-in-menuitem", "Sign In")
            {
                HelpText   = "Sign in to the shop at the current location",
                Controller = ShopFloorController,
                Action     = "SignIn"
            });
            SubMenu.Add(new MenuItem("sign-out-menuitem", "Sign Out")
            {
                HelpText   = "Sign out of the shop at the current location",
                Controller = ShopFloorController,
                Action     = "SignOut"
            });
        }