public ActionResult Contact(Contact model) { if (ModelState.IsValid) { CustomerRepoADO cRepo = new CustomerRepoADO(); cRepo.AddContact(model); return(View("ContactConfirm")); } return(View("Contact", model)); }
public ActionResult SellCar(int CarID) { CarRepoADO repoc = new CarRepoADO(); PromotionRepoADO repop = new PromotionRepoADO(); CustomerRepoADO custrep = new CustomerRepoADO(); SoldCar carsold = new SoldCar(); carsold.Car = repoc.GetCarByID(CarID); SellCarVM model = new SellCarVM(); model.CarSold = carsold; Promotion promo = repop.GetPromotionByDate(DateTime.Now); //need null promo model.promo = promo; model.SoldBy = User.Identity.GetUserName(); List <State> states = custrep.GetStates(); List <PaymentType> pay = custrep.GetPaymentTypes(); model.FillSelectLists(pay, states); //fill in select lists return(View(model)); }