public ActionResult DeleteConfirmed(string id) { MarketingCoordinator marketingCoordinator = db.MarketingCoordinators.Find(id); db.MarketingCoordinators.Remove(marketingCoordinator); db.SaveChanges(); AuthenController.DeleteAccount(marketingCoordinator.UserName); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { Guest guest = db.Guests.Find(id); db.Guests.Remove(guest); db.SaveChanges(); AuthenController.DeleteAccount(guest.UserName); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(string id) { Student student = db.Students.Find(id); db.Students.Remove(student); db.SaveChanges(); AuthenController.DeleteAccount(student.UserName); return(RedirectToAction("Index")); }
public ActionResult Create(Guest guest) { if (ModelState.IsValid) { db.Guests.Add(guest); db.SaveChanges(); AuthenController.CreateAccount(guest.UserName, "123456", "Guest"); return(RedirectToAction("Index")); } return(View(guest)); }
public ActionResult Create([Bind(Include = "MCEmail,MCID,MCName,MCAddress,MCPhone,FacultyID,UserName")] MarketingCoordinator marketingCoordinator) { if (ModelState.IsValid) { db.MarketingCoordinators.Add(marketingCoordinator); db.SaveChanges(); AuthenController.CreateAccount(marketingCoordinator.UserName, "123456", "MarketingCoordinator"); return(RedirectToAction("Index")); } ViewBag.CTTagID = new SelectList(db.Faculties, "FacultyID", "FacultyName", marketingCoordinator.FacultyID); return(View(marketingCoordinator)); }
public ActionResult Create(MarketingManager marketingmanager) { if (ModelState.IsValid) { db.MarketingManagers.Add(marketingmanager); db.SaveChanges(); AuthenController.CreateAccount(marketingmanager.UserName, "123456", "ManagerMarketing"); return(RedirectToAction("Index", "Home")); } return(View(marketingmanager)); }
public ActionResult Create([Bind(Include = "StudentEmail,StudentID,StudentName,StudentAddress,DOB,UserName,FacultyID")] Student student) { if (ModelState.IsValid) { db.Students.Add(student); db.SaveChanges(); AuthenController.CreateAccount(student.UserName, "123456", "Student"); return(RedirectToAction("Index")); } ViewBag.FacultyID = new SelectList(db.Faculties, "FacultyID", "FacultyName", student.FacultyID); return(View(student)); }