public ActionResult Create([Bind(Include = "ID,CertName,UserID")] CertificationList certificationList) { if (ModelState.IsValid) { db.CertificationLists.Add(certificationList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(certificationList)); }
public ActionResult Create([Bind(Include = "Id,CertificateNo,CompanyName,CompanyAddress,Country,Scope,RegistrationDate,ReRegistrationDate,Standard,Status")] CertificateInfo certificateInfo) { if (ModelState.IsValid) { db.CertificateInfoes.Add(certificateInfo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(certificateInfo)); }
public ActionResult Contact(ContactModel contact) { try { if (ModelState.IsValid) { ContactU cUs = new ContactU(); cUs.Name = contact.Name; cUs.Message = contact.Message; cUs.Subject = contact.Subject; cUs.Email = contact.Email; db.ContactUS.Add(cUs); db.SaveChanges(); ViewBag.ShowMessage = "Thank you! We will reach you soon."; contact.Message = string.Empty; contact.Email = string.Empty; contact.Name = string.Empty; contact.Subject = string.Empty; } } catch (Exception) { throw; } return(View(contact)); }