public ActionResult Create(StudentModel iList)
        {
            if (ModelState.IsValid)
            {
                StudentHandler IHandler = new StudentHandler();
                if (IHandler.InsertStudent(iList))
                {
                    ViewBag.AlertMsg = "Item Added successfully";
                    ModelState.Clear();
                }
                else
                {
                    ViewBag.AlertMsg = "Item Add Failed";
                    ModelState.Clear();
                }
            }

            ClassHandler      gHandler  = new ClassHandler();
            List <ClassModel> classlist = new List <ClassModel>();

            classlist = gHandler.GetClassList().ToList();
            classlist.Insert(0, new ClassModel()
            {
                ClassID = 0, ClassName = "Select"
            });
            ViewBag.ListOfClasses = classlist;

            return(View());
        }
示例#2
0
        public IActionResult Index()
        {
            ViewBag.ItemList = "Class List Page";
            ClassHandler iHandler = new ClassHandler();

            ModelState.Clear();
            return(View(iHandler.GetClassList()));
        }
        public ActionResult Create()
        {
            ClassHandler      gHandler  = new ClassHandler();
            List <ClassModel> classlist = new List <ClassModel>();

            classlist = gHandler.GetClassList().ToList();
            classlist.Insert(0, new ClassModel()
            {
                ClassID = 0, ClassName = "Select"
            });
            ViewBag.ListOfClasses = classlist;

            return(View());
        }
        public ActionResult Edit(int id)
        {
            StudentHandler iHandler    = new StudentHandler();
            StudentModel   studentItem = iHandler.GetStudentList().Find(itemmmodel => itemmmodel.StudentID == id);

            ClassHandler      gHandler  = new ClassHandler();
            List <ClassModel> classlist = new List <ClassModel>();

            classlist = gHandler.GetClassList().ToList();
            classlist.Insert(studentItem.Classes.ClassID, new ClassModel()
            {
                ClassID = 0, ClassName = "Select"
            });
            ViewBag.ListOfClasses = classlist;

            return(View(studentItem));
        }
示例#5
0
        public ActionResult Edit(int id)
        {
            ClassHandler iHandler  = new ClassHandler();
            ClassModel   classItem = iHandler.GetClassList().Find(itemmmodel => itemmmodel.ClassID == id);

            GradeHandler      gHandler  = new GradeHandler();
            List <GradeModel> gradelist = new List <GradeModel>();

            gradelist = gHandler.GetGradeList().ToList();

            gradelist.Insert(classItem.Grade.GradeID, new GradeModel()
            {
                GradeID = 0, GradeName = "Select"
            });
            ViewBag.ListOfGrades = gradelist;

            return(View(classItem));
        }
        public IActionResult Index(int ClassID)
        {
            ViewBag.ItemList = "Attendance List Page";
            AttendanceHandler iHandler = new AttendanceHandler();

            ClassHandler      gHandler  = new ClassHandler();
            List <ClassModel> classlist = new List <ClassModel>();

            classlist = gHandler.GetClassList().ToList();
            classlist.Insert(0, new ClassModel()
            {
                ClassID = 0, ClassName = "Select"
            });
            ViewBag.ListOfClasses = classlist;

            ModelState.Clear();
            return(View(iHandler.GetAttendanceList(ClassID)));
        }