public IActionResult Add() { AddSaleModel model = new AddSaleModel(); model.AllCars = this.carService.GetAll(); model.AllCustomers = this.customerService.GetAll(OrderType.Ascending); return(this.View(model)); }
public IActionResult Add() { AddSaleModel addSaleModel = new AddSaleModel(); addSaleModel.Cars = this.salesService.GetCarSaleModels(); addSaleModel.Customers = this.salesService.GetCustomerSaleModels(); return(this.View(addSaleModel)); }
public IActionResult Add(AddSaleModel addSaleModel) { this.simpleLoggerService.LogToDb(this.User.Identity.Name, LogType.Add, "Sales"); if (this.ModelState.IsValid) { FinalizeSaleModel finalizeSaleModel = this.salesService.GetFinalizeSaleInfo(addSaleModel.CarId, addSaleModel.CustomerId, addSaleModel.Discount); return(this.RedirectToAction(nameof(ReviewSale), finalizeSaleModel)); } addSaleModel.Cars = this.salesService.GetCarSaleModels(); addSaleModel.Customers = this.salesService.GetCustomerSaleModels(); return(this.View(addSaleModel)); }
public IActionResult AddSale(AddSaleModel addSale) { int saleId = this.salesService.AddSale(addSale.CarId, addSale.CustomerId, addSale.Discount); return(this.Redirect($"/Sales/{saleId}")); }