// GET: Group
        public ActionResult AddGroup()
        {
            ViewBag.listParishes = ParishActions.listParishes();
            ViewBag.listGroups   = GroupActions.listGroups();

            return(View());
        }
Ejemplo n.º 2
0
        // GET: Student

        public ActionResult AddStudent()
        {
            var listclasses = ClassActions.listClasses();

            ViewBag.listParishes = ParishActions.listParishes();

            List <SelectListItem> item = new List <SelectListItem>();

            foreach (var i in listclasses)
            {
                item.Add(new SelectListItem {
                    Text = i.class_name, Value = Convert.ToString(i.class_id)
                });
            }
            ViewBag.listClasses = item;
            return(View());
        }
        public ActionResult EditTeacher(int id)
        {
            USERLOGIN user = TeacherActions.findTeacherByID(id);

            ViewBag.listParishes         = ParishActions.listParishes();
            ViewBag.StudentByID          = user;
            ViewBag.ListClassByTeacherID = ClassActions.findListClassByTeacherID(id);

            var liststudent_byclassid = StudentActions.findListStudentByClassID(id);

            if (liststudent_byclassid == null)
            {
                ViewBag.ListStudentByClassID = null;
            }
            else
            {
                ViewBag.ListStudentByClassID = liststudent_byclassid;
            }
            return(View(ParishActions.findParishByUserID(user.userid)));
        }
Ejemplo n.º 4
0
        public ActionResult EditStudent(int id)
        {
            USERLOGIN user = StudentActions.findStudentByID(id);

            ViewBag.listParishes = ParishActions.listParishes();
            ViewBag.StudentByID  = user;

            var listclasses            = ClassActions.listClasses();
            List <SelectListItem> item = new List <SelectListItem>();
            int?selectedclass_id       = null;

            foreach (var i in listclasses)
            {
                if (i.class_id == user.class_id)
                {
                    selectedclass_id = i.class_id;
                    item.Add(new SelectListItem {
                        Text = i.class_name, Value = Convert.ToString(i.class_id), Selected = true
                    });
                }
                else
                {
                    item.Add(new SelectListItem {
                        Text = i.class_name, Value = Convert.ToString(i.class_id)
                    });
                }
            }
            ViewBag.listClasses = item;
            if (selectedclass_id == null)
            {
                ViewBag.findSelectedClassByID = null;
            }
            else
            {
                ViewBag.findSelectedClassByID = ClassActions.findListClassByID(selectedclass_id.Value);
            }
            return(View(ParishActions.findParishByUserID(user.userid)));
        }
 // GET: Teacher
 public ActionResult AddTeacher()
 {
     ViewBag.listParishes = ParishActions.listParishes();
     return(View());
 }
 public ActionResult EditGroup(int id)
 {
     ViewBag.listParishes = ParishActions.listParishes();
     ViewBag.Group        = GroupActions.findGroupByID(id);
     return(View());
 }