Пример #1
0
        public ActionResult Contact()
        {
            HomeContactVM VM   = new HomeContactVM();
            var           repo = new ContactRepositoryADO();

            return(View(VM));
        }
Пример #2
0
 public ActionResult Contact(HomeContactVM model)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View(model));
     }
 }
Пример #3
0
        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));
            }
        }
Пример #4
0
        public ActionResult Contact()
        {
            HomeContactVM model = new HomeContactVM();

            return(View(model));
        }