示例#1
0
        public ActionResult AdminStudentDelete(object sender, EventArgs e)
        {
            Student         student  = new Student();
            AdminStudentDAO students = new AdminStudentDAO();

            student.student_id = Request.Form["Student_Id"];
            Admin removestudent = new Admin();
            int   result        = students.DeleteStudent(student);

            ViewBag.studdel = "failed to delete student";
            if (result == 1)
            {
                ViewBag.studdel = "sucesfully deleted " + student.student_id;
            }

            return(View("AdminHome"));
        }
示例#2
0
        public ActionResult AdminStudentRegistration(object sender, EventArgs e)
        {
            Student         student  = new Student();
            AdminStudentDAO students = new AdminStudentDAO();

            student.student_uname    = Request.Form["username"];
            student.student_password = Request.Form["password"];
            student.student_lab      = Request.Form["student_lab"];
            student.student_pc_no    = Request.Form["student_pc_no"];
            int result = students.AddStudent(student);

            ViewBag.studreg = "failed to register" + student.student_uname;
            if (result == 1)
            {
                ViewBag.studreg = "sucessfully registered " + student.student_uname;
            }

            return(View("AdminHome"));
        }