예제 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            MarketingCoordinator marketingCoordinator = db.MarketingCoordinators.Find(id);

            db.MarketingCoordinators.Remove(marketingCoordinator);
            db.SaveChanges();
            AuthenController.DeleteAccount(marketingCoordinator.UserName);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Guest guest = db.Guests.Find(id);

            db.Guests.Remove(guest);
            db.SaveChanges();
            AuthenController.DeleteAccount(guest.UserName);
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public ActionResult DeleteConfirmed(string id)
        {
            Student student = db.Students.Find(id);

            db.Students.Remove(student);
            db.SaveChanges();
            AuthenController.DeleteAccount(student.UserName);
            return(RedirectToAction("Index"));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #7
0
        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));
        }