Example #1
0
        public ActionResult Create([Bind(Include = "GradePointStateId,LowerLimit,UpperLimit,TuitionRateFactor")] GradePointState gradePointState)
        {
            if (ModelState.IsValid)
            {
                db.GradePointStates.Add(gradePointState);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gradePointState));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "NextUniqueNumberId,NextAvailableNumber")] NextUniqueNumber nextUniqueNumber)
        {
            if (ModelState.IsValid)
            {
                db.NextUniqueNumbers.Add(nextUniqueNumber);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nextUniqueNumber));
        }
        public ActionResult Create([Bind(Include = "AcademicProgramId,ProgramAcronym,Description")] AcademicProgram academicProgram)
        {
            if (ModelState.IsValid)
            {
                db.AcademicPrograms.Add(academicProgram);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(academicProgram));
        }
        public ActionResult Create([Bind(Include = "StudentCardId,StudentId,CardNumber")] StudentCard studentCard)
        {
            if (ModelState.IsValid)
            {
                db.StudentCards.Add(studentCard);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.StudentId = new SelectList(db.Students, "StudentId", "FullName", studentCard.StudentId);
            return(View(studentCard));
        }
        public ActionResult Create([Bind(Include = "CourseId,AcademicProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes")] Course course)
        {
            if (ModelState.IsValid)
            {
                db.Courses.Add(course);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", course.AcademicProgramId);
            return(View(course));
        }
Example #6
0
        public ActionResult Create([Bind(Include = "CourseId,AcademicProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,AssignmentWeight,MidtermWeight,FinalWeight")] GradedCourse gradedCourse)
        {
            gradedCourse.SetNextCourseNumber();
            if (ModelState.IsValid)
            {
                db.GradedCourses.Add(gradedCourse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", gradedCourse.AcademicProgramId);
            return(View(gradedCourse));
        }
        public ActionResult Create([Bind(Include = "CourseId,AcademicProgramId,CourseNumber,Title,CreditHours,TuitionAmount,Notes,MaximumAttempts")] MasteryCourse masteryCourse)
        {
            masteryCourse.SetNextCourseNumber();

            if (ModelState.IsValid)
            {
                db.MasteryCourses.Add(masteryCourse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", masteryCourse.AcademicProgramId);
            return(View(masteryCourse));
        }
        public ActionResult Create([Bind(Include = "RegistrationId,StudentId,CourseId,RegistrationNumber,RegistrationDate,Grade,Notes")] Registration registration)
        {
            registration.SetNextRegistrationNumber();

            if (ModelState.IsValid)
            {
                db.Registrations.Add(registration);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CourseId  = new SelectList(db.Courses, "CourseId", "Title", registration.CourseId);
            ViewBag.StudentId = new SelectList(db.Students, "StudentId", "FullName", registration.StudentId);
            return(View(registration));
        }
Example #9
0
        public ActionResult Create([Bind(Include = "StudentId,GradePointStateId,AcademicProgramId,StudentNumber,FirstName,LastName,Address,City,Province,PostalCode,DateCreated,GradePointAverage,OutstandingFees,Notes")] Student student)
        {
            student.SetNextStudentNumber();

            if (ModelState.IsValid)
            {
                db.Students.Add(student);
                // Call ChangeState method to modify GradePointState if applicable
                student.ChangeState();
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AcademicProgramId = new SelectList(db.AcademicPrograms, "AcademicProgramId", "ProgramAcronym", student.AcademicProgramId);
            ViewBag.GradePointStateId = new SelectList(db.GradePointStates, "GradePointStateId", "Description", student.GradePointStateId);
            return(View(student));
        }
Example #10
0
        /// <summary>
        /// Checks for an existing RegularState instance.
        /// Instantiates an RegularState and populates it to the database if there is none.
        /// </summary>
        /// <returns>honourState : instance of the RegularState sub class</returns>
        public static RegularState GetInstance()
        {
            if (regularState == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                regularState = db.RegularStates.SingleOrDefault();

                if (regularState == null)
                {
                    RegularState regularState = new RegularState();

                    db.RegularStates.Add(regularState);
                    db.SaveChanges();
                }
            }

            return(regularState);
        }
Example #11
0
        /// <summary>
        /// Checks for an existing ProbationState instance.
        /// Instantiates an ProbationState and populates it to the database if there is none.
        /// </summary>
        /// <returns>honourState : instance of the ProbationState sub class</returns>
        public static ProbationState GetInstance()
        {
            if (probationState == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                probationState = db.ProbationStates.SingleOrDefault();

                if (probationState == null)
                {
                    ProbationState probationState = new ProbationState();

                    db.ProbationStates.Add(probationState);
                    db.SaveChanges();
                }
            }

            return(probationState);
        }
Example #12
0
        /// <summary>
        /// Checks for an existing SuspendedState instance.
        /// Instantiates an SuspendedState and populates it to the database if there is none.
        /// </summary>
        /// <returns>honourState : instance of the SuspendedState sub class</returns>
        public static SuspendedState GetInstance()
        {
            if (suspendedState == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                suspendedState = db.SuspendedStates.SingleOrDefault();

                if (suspendedState == null)
                {
                    SuspendedState suspendedState = new SuspendedState();

                    db.SuspendedStates.Add(suspendedState);
                    db.SaveChanges();
                }
            }

            return(suspendedState);
        }
Example #13
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>nextStudent : instance of the NextStudent sub class</returns>
        public static NextStudent GetInstance()
        {
            if (nextStudent == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                nextStudent = db.NextStudents.SingleOrDefault();


                if (nextStudent == null)
                {
                    NextStudent nextStudent = new NextStudent();

                    db.NextStudents.Add(nextStudent);
                    db.SaveChanges();
                }
            }

            return(nextStudent);
        }
Example #14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>nextMasteryCourse : instance of the NextMasteryCourse sub class</returns>
        public static NextMasteryCourse GetInstance()
        {
            if (nextMasteryCourse == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                nextMasteryCourse = db.NextMasteryCourses.SingleOrDefault();


                if (nextMasteryCourse == null)
                {
                    NextMasteryCourse nextMasteryCourse = new NextMasteryCourse();

                    db.NextMasteryCourses.Add(nextMasteryCourse);
                    db.SaveChanges();
                }
            }

            return(nextMasteryCourse);
        }
Example #15
0
        /// <summary>
        /// Checks for an existing HonoursState instance.
        /// Instantiates an HonoursState and populates it to the database if there is none.
        /// </summary>
        /// <returns>honourState : instance of the HonoursState sub class</returns>
        public static HonoursState GetInstance()
        {
            if (honoursState == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                honoursState = db.HonoursStates.SingleOrDefault();


                if (honoursState == null)
                {
                    HonoursState honoursState = new HonoursState();

                    db.HonoursStates.Add(honoursState);
                    db.SaveChanges();
                }
            }

            return(honoursState);
        }
Example #16
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>nextRegistration : instance of the NextRegistration sub class</returns>
        public static NextRegistration GetInstance()
        {
            if (nextRegistration == null)
            {
                BITCollege_MGContext db = new BITCollege_MGContext();
                nextRegistration = db.NextRegistrations.SingleOrDefault();


                if (nextRegistration == null)
                {
                    NextRegistration nextRegistration = new NextRegistration();

                    db.NextRegistrations.Add(nextRegistration);
                    db.SaveChanges();
                }
            }

            return(nextRegistration);
        }