public async Task <ActionResult> Create(Sale sale)
        {
            if (sale.ManagerId == 0 || sale.ProductId == 0 || sale.CustomerId == 0)
            {
                ModelState.AddModelError("", "All fields must be filled");

                return(View("Create", SaleCreateViewModel.Create()));
            }

            await Task.Run(() => SaleService.CreateSale(sale));

            return(View("Index"));
        }
        public async Task <ActionResult> Edit(Sale sale)
        {
            if (sale.ManagerId == 0 || sale.ProductId == 0 || sale.CustomerId == 0)
            {
                ModelState.AddModelError("", "All fields must be filled");

                var model = SaleCreateViewModel.Create();

                model.Sale = sale;

                return(View(model));
            }

            await Task.Run(() => SaleService.EditSale(sale));

            return(RedirectToAction("Index"));
        }