public async Task <IActionResult> Create(CreateBillModel model)
        {
            if (!LogedIn())
            {
                return(RedirectToRoute("Home"));
            }

            if (ModelState.IsValid)
            {
                Vehicle v    = _context.Vehicles.Find(model.SelectedVehicle);
                Service s    = _context.Service.Find(model.SelectedService);
                Bill    bill = new Bill
                {
                    Service  = s.Name,
                    Vehicle  = v,
                    DateTime = model.DateTime,
                    Provider = model.Provider,
                    Cost     = model.Cost
                };

                _context.Add(bill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            model.FillVehiclesAndServices(_context, CompanyId);
            return(View(model));
        }
        // GET: Bills/Create
        public IActionResult Create()
        {
            if (!LogedIn())
            {
                return(RedirectToRoute("Home"));
            }
            CreateBillModel model = new CreateBillModel();

            model.FillVehiclesAndServices(_context, CompanyId);
            return(View(model));
        }