SHARE
TWEET

Untitled

a guest Aug 20th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public ActionResult Create(Registration registration)
  2. {
  3.     if (ModelState.IsValid)
  4.     {
  5.         registration.ConfirmPassword = EncryptionLibrary.EncryptText(registration.ConfirmPassword);
  6.         registration.Password= EncryptionLibrary.EncryptText(registration.Password);
  7.         registration.Created_Date = DateTime.Now;
  8.  
  9.         if (ModelState.IsValid)
  10.         {
  11.             db.Registration.Add(registration);
  12.             db.SaveChanges();
  13.             ViewBag.teacher = "Teacher account has been created Successfully";
  14.             return RedirectToAction("Create");
  15.         }
  16.  
  17.         TempData["Faculty"] = "";
  18.         var result = _IRegistration.AddFaculty(registration);
  19.  
  20.         if (result > 0)
  21.         {
  22.             TempData["Success"] = "Faculty Added Successfully";
  23.             ModelState.Clear();
  24.             return RedirectToAction("Create");
  25.         }
  26.     }
  27.     return View(registration);
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top