Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "DesignationId,DesignationName")] Designation designation)
        {
            if (ModelState.IsValid)
            {
                db.Designations.Add(designation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(designation));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "SemesterId,SemesterName")] Semester semester)
        {
            if (ModelState.IsValid)
            {
                db.Semesters.Add(semester);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(semester));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "UserId,UserName,Password,UserRole")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "ShiftId,ShiftName")] Shift shift)
        {
            if (ModelState.IsValid)
            {
                db.Shifts.Add(shift);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(shift));
        }
        public ActionResult Create([Bind(Include = "DepartmentId,DepartmentName")] Department department)
        {
            if (ModelState.IsValid)
            {
                db.Departments.Add(department);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(department));
        }
Ejemplo n.º 6
0
        public ActionResult Create([Bind(Include = "TeacherId,TeacherName,DesignationID,PhoneNo,Address")] Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                db.Teachers.Add(teacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DesignationID = new SelectList(db.Designations, "DesignationId", "DesignationName", teacher.DesignationID);
            return(View(teacher));
        }
Ejemplo n.º 7
0
        public ActionResult Create([Bind(Include = "Id,StudentId,SubjectCode,Marks,ExamName,SemesterId,Session,DepartmentId,AddedDate,AddedBy")] ExamMark examMark)
        {
            if (ModelState.IsValid)
            {
                db.ExamMarks.Add(examMark);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DepartmentId = new SelectList(db.Departments, "DepartmentId", "DepartmentName", examMark.DepartmentId);
            ViewBag.AddedBy      = new SelectList(db.Users, "UserId", "UserName", examMark.AddedBy);
            ViewBag.SemesterId   = new SelectList(db.Semesters, "SemesterId", "SemesterName", examMark.SemesterId);
            ViewBag.StudentId    = new SelectList(db.Students, "StudentId", "StudentName", examMark.StudentId);
            return(View(examMark));
        }
        public ActionResult Create([Bind(Include = "StudentId,StudentName,Gender,Address,Phone,Session,DepartmentId,SemesterId,ShiftId,RegNo,AddedDate,AddedBy")] Student student)
        {
            if (ModelState.IsValid)
            {
                db.Students.Add(student);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DepartmentId = new SelectList(db.Departments, "DepartmentId", "DepartmentName", student.DepartmentId);
            ViewBag.SemesterId   = new SelectList(db.Semesters, "SemesterId", "SemesterName", student.SemesterId);
            ViewBag.ShiftId      = new SelectList(db.Shifts, "ShiftId", "ShiftName", student.ShiftId);
            ViewBag.AddedBy      = new SelectList(db.Users, "UserId", "UserName", student.AddedBy);
            return(View(student));
        }