Ejemplo n.º 1
0
        public ViewResult ViewStudents(int classId, string className)
        {
            IEnumerable <Student> students = GetHelper <Student> .GetAll("students").Where(s => s.@class != null && [email protected] == classId);

            SetClassName(classId);
            ViewData["classId"] = classId;
            return(View("Students", students));
        }
Ejemplo n.º 2
0
        // GET: Subjects
        public ViewResult Index()
        {
            IEnumerable <Subject> subjects = GetHelper <Subject> .GetAll("subjects");

            subjects = subjects.OrderBy(s => s.id);
            if (subjects == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }
            return(View(subjects));
        }
Ejemplo n.º 3
0
        // GET: Classes
        public ViewResult Index()
        {
            IEnumerable <Class> classes = GetHelper <Class> .GetAll("classes");

            classes = classes.OrderBy(c => c.id);
            if (classes == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }
            return(View(classes));
        }
Ejemplo n.º 4
0
        // GET: Attractions
        public ActionResult Index()
        {
            IEnumerable <Attraction> attractions = GetHelper <Attraction> .GetAll("attractions");

            attractions = attractions.OrderBy(a => a.id);
            if (attractions == null)
            {
                ModelState.AddModelError(string.Empty, "Server error - no data in database.");
            }

            return(View(attractions));
        }
Ejemplo n.º 5
0
        // GET: Countries
        public ActionResult Index()
        {
            IEnumerable <Country> countries = GetHelper <Country> .GetAll("countries");

            countries = countries.OrderBy(c => c.id);
            if (countries == null)
            {
                ModelState.AddModelError(string.Empty, "Server error - no data in database.");
            }

            return(View(countries));
        }
Ejemplo n.º 6
0
        // GET: Teachers

        public ViewResult Index()
        {
            IEnumerable <Teacher> teachers = GetHelper <Teacher> .GetAll("teachers");

            teachers = teachers.OrderBy(t => t.id);
            if (teachers == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }

            return(View(teachers));
        }
Ejemplo n.º 7
0
        // GET: User
        public ActionResult Index()
        {
            IEnumerable <UserModel> users = GetHelper <UserModel> .GetAll(Globals.USER_API_LINK);

            users = users.OrderBy(s => s.id);
            if (users == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }

            return(View(users));
        }
Ejemplo n.º 8
0
        private IEnumerable <SelectListItem> GetCityList()
        {
            var citiesList = GetHelper <City> .GetAll(Globals.CITIES_API_LINK).ToList();

            var cities = (from city in citiesList
                          select new SelectListItem
            {
                Text = city.name,
                Value = city.id.ToString()
            }).ToList();

            IList <SelectListItem> items = new List <SelectListItem>();

            foreach (var city in cities)
            {
                items.Add(city);
            }

            return(items);
        }
Ejemplo n.º 9
0
        private IEnumerable <SelectListItem> GetTeachersList()
        {
            var teachersList = GetHelper <Teacher> .GetAll(Globals.TEACHERS_API_LINK).ToList();

            var teachers = (from teach in teachersList
                            select new SelectListItem
            {
                Text = teach.forename + " " + teach.surname,
                Value = teach.id.ToString()
            }).ToList();

            IList <SelectListItem> items = new List <SelectListItem>();

            foreach (var teacher in teachers)
            {
                items.Add(teacher);
            }

            return(items);
        }
Ejemplo n.º 10
0
        private IEnumerable <SelectListItem> GetStudentsList()
        {
            var studentsList = GetHelper <Student> .GetAll(Globals.STUDENTS_API_LINK).ToList();

            var students = (from stud in studentsList
                            select new SelectListItem
            {
                Text = stud.forename + " " + stud.surname,
                Value = stud.id.ToString()
            }).ToList();

            IList <SelectListItem> items = new List <SelectListItem>();

            foreach (var student in students)
            {
                items.Add(student);
            }

            return(items);
        }