public ActionResult Contact() { HomeContactVM VM = new HomeContactVM(); var repo = new ContactRepositoryADO(); return(View(VM)); }
public ActionResult Contact(HomeContactVM model) { if (ModelState.IsValid) { return(RedirectToAction("Index")); } else { return(View(model)); } }
public ActionResult Contact(HomeContactCM form) { if (ModelState.IsValid) { Contact contact = new Contact(); var repo = new ContactRepositoryADO(); contact.VehicleId = form.VehicleId; contact.Vin = form.Vin; contact.Email = form.Email; contact.Name = form.Name; contact.PhoneNumber = form.PhoneNumber; contact.Message = form.Message; repo.CreateContact(contact); return(RedirectToAction("Index")); } else { HomeContactVM VM = new HomeContactVM(); var repo = new ContactRepositoryADO(); VM.Form = form; return(View(VM)); } }
public ActionResult Contact() { HomeContactVM model = new HomeContactVM(); return(View(model)); }