Beispiel #1
0
 //method which inserts emails signups into database
 public bool commitInsert(email_signup esignup)
 {
     using (objSignup)
     {
         objSignup.email_signups.InsertOnSubmit(esignup);
         objSignup.SubmitChanges();
         return(true);
     }
 }
 public ActionResult Update(int id, email_signup email)
 {
     ViewBag.Group = "Admin";
     if (ModelState.IsValid)
     {
         try
         {
             objSignup.commitUpdate(id, email.ename, email.elname, email.eemail);
             return(RedirectToAction("AdminShowSignups"));
         }
         catch
         {
             return(View());
         }
     }
     return(View());
 }
 public ActionResult SignupComplete(email_signup valid)
 {
     if (ModelState.IsValid)
     {
         try
         {
             objSignup.commitInsert(valid);
             return(PartialView(valid));
         }
         catch
         {
             return(View("EmailSignup"));
         }
     }
     else
     {
         return(View("EmailSignup"));
     }
 }