Example #1
0
        public ActionResult Trending()
        {
            var Lists = new ShowLists();

            Lists.allMovies  = DBProject.Models.CRUD.GetTrendingMovies();
            Lists.allTVShows = DBProject.Models.CRUD.GetTrendingTVShows();
            return(View(Lists));
        }
Example #2
0
        public ActionResult Shows()
        {
            //Passing Multiple lists to VIEW
            var Lists = new ShowLists();

            Lists.allShows   = DBProject.Models.CRUD.getShows();
            Lists.allMovies  = DBProject.Models.CRUD.getMovies();
            Lists.allTVShows = DBProject.Models.CRUD.getTVShows();
            return(View(Lists));
        }
Example #3
0
        static public void Album(List <IViewModel> input)
        {
            List <IAlbumViewModel> output = new List <IAlbumViewModel>();

            foreach (var model in input)
            {
                output.Add(model as IAlbumViewModel);
            }

            ShowLists.Album(output);
        }
Example #4
0
        static public void Izvodjac(List <IViewModel> input)
        {
            List <IIzvodjacViewModel> output = new List <IIzvodjacViewModel>();

            foreach (var model in input)
            {
                output.Add(model as IIzvodjacViewModel);
            }

            ShowLists.Izvodjac(output);
        }
Example #5
0
        static public void Fonogram(List <IViewModel> input)
        {
            List <IFonogramViewModel> output = new List <IFonogramViewModel>();

            foreach (var model in input)
            {
                output.Add(model as IFonogramViewModel);
            }

            ShowLists.Fonogram(output);
        }
        public static void AddAssignmentInCourse()
        {
            Console.Clear();
            AssignmentDb aDB = new AssignmentDb();
            CourseDb     cDB = new CourseDb();

            List <Course>     courses     = cDB.GetCourses();
            List <Assignment> assignments = aDB.GetAssignments();

            if (courses.Count != 0 && assignments.Count != 0)
            {
                Console.WriteLine("Select an assignment to add by using its number on the list: \n");
                ShowLists.ShowList(assignments, "Students");

                bool result = Int32.TryParse(Console.ReadLine(), out int assignmentID);
                while (!result || (assignmentID < 1 || assignmentID > assignments.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {assignments.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out assignmentID);
                }
                Console.Clear();

                Console.WriteLine("Select a course by using its number on the list: \n");
                ShowLists.ShowList(courses, "Courses");

                result = Int32.TryParse(Console.ReadLine(), out int courseID);
                while (!result || (courseID < 1 || courseID > courses.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {courses.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out courseID);
                }
                Console.Clear();
                AssignmentsPerCourseDb.AddAssignmentToCourse(assignmentID, courseID);

                Console.WriteLine("Assignment added successfully to Course!");
            }
            else
            {
                Console.WriteLine("There aren't neither Students nor Courses yet");
            }
        }
        public static void AddStudentInCourse()
        {
            Console.Clear();
            StudentDb sDB = new StudentDb();
            CourseDb  cDB = new CourseDb();

            List <Course>  courses  = cDB.GetCourses();
            List <Student> students = sDB.GetStudents();

            if (courses.Count != 0 && students.Count != 0)
            {
                Console.WriteLine("Select a student to add by using its number on the list: \n");
                ShowLists.ShowList(students, "Students");

                bool result = Int32.TryParse(Console.ReadLine(), out int studentID);
                while (!result || (studentID < 1 || studentID > students.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {students.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out studentID);
                }
                Console.Clear();

                Console.WriteLine("Select a course by using its number on the list: \n");
                ShowLists.ShowList(courses, "Courses");

                result = Int32.TryParse(Console.ReadLine(), out int courseID);
                while (!result || (courseID < 1 || courseID > courses.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {courses.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out courseID);
                }
                Console.Clear();
                StudentsPerCourseDb.AddStudentToCourse(studentID, courseID);
                Console.WriteLine("Student enrolled to course successfully!");
            }
            else
            {
                Console.WriteLine("There aren no Students or Courses yet");
            }
        }
Example #8
0
        public static void AddTrainerInCourse()
        {
            Console.Clear();
            TrainerDb tDB = new TrainerDb();
            CourseDb  cDB = new CourseDb();

            List <Course>  courses  = cDB.GetCourses();
            List <Trainer> trainers = tDB.GetTrainers();

            if (courses.Count != 0 && trainers.Count != 0)
            {
                Console.WriteLine("Select a trainer to add by using its number on the list: \n");
                ShowLists.ShowList(trainers, "Trainers");

                bool result = Int32.TryParse(Console.ReadLine(), out int trainerID);
                while (!result || (trainerID < 1 || trainerID > trainers.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {trainers.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out trainerID);
                }
                Console.Clear();

                Console.WriteLine("Select a course by using its number on the list: \n");
                ShowLists.ShowList(courses, "Courses");

                result = Int32.TryParse(Console.ReadLine(), out int courseID);
                while (!result || (courseID < 1 || courseID > courses.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {courses.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out courseID);
                }
                Console.Clear();
                TrainersPerCourseDb.AddTrainerToCourse(trainerID, courseID);
                Console.WriteLine("Trainer added to course successfully!");
            }
            else
            {
                Console.WriteLine("There aren no Trainers or Courses yet");
            }
        }
        private static void SystemMenu()
        {
            Console.WriteLine("\n-----What do you want to do?-----\n");
            Console.WriteLine("ENTER 1 to Area calculator\n ");
            Console.WriteLine("ENTER 2 to Show animation\n ");
            Console.WriteLine("ENTER 3 Out of the system\n ");
            Console.WriteLine("ENTER 4 to show lists\n ");
            var userAnswer = int.Parse(Console.ReadLine());

            switch (userAnswer)
            {
            case 1:
                AreaCalculator(); SystemMenu();
                break;

            case 2:
                RunAnimation.StartAnimation();
                SystemMenu();
                break;

            case 3:
                ShowLists.RunLists();
                SystemMenu();
                break;

            case 4:
                Console.Clear();
                Console.WriteLine("Finishing...");
                Thread.Sleep(1842);
                return;

            default:
                Console.WriteLine("Type a valid number to proceed");
                break;
            }
        }
Example #10
0
        public static void AddAssignmentToStudent()
        {
            Console.Clear();
            AssignmentDb aDB = new AssignmentDb();
            StudentDb sDB = new StudentDb();            

            List<Assignment> assignments = aDB.GetAssignments();
            List<Student> students = sDB.GetStudents();

            if (assignments.Count != 0 && students.Count != 0)
            {
                Console.WriteLine("Select an assignment by using its number on the list: \n");
                ShowLists.ShowList(assignments, "Assignments");

                bool result = Int32.TryParse(Console.ReadLine(), out int assignmentID);
                while (!result || (assignmentID < 1 || assignmentID > assignments.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {assignments.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out assignmentID);
                }

                Console.WriteLine("Select a student to add by using its number on the list: \n");
                ShowLists.ShowList(students, "Students");

                result = Int32.TryParse(Console.ReadLine(), out int studentID);
                while (!result || (studentID < 1 || studentID > students.Count))
                {
                    Console.Write($"Wrong input! Please select using numbers from 1 to {students.Count} ");
                    result = Int32.TryParse(Console.ReadLine(), out studentID);
                }
                Console.Clear();
                AssignmentsPerStudentDb.AddΑssignmentToStudent(assignmentID, studentID);
                Console.WriteLine("Assignment added to Student successfully!");
            }
            else Console.WriteLine("There aren no Students or Assignments yet");
        }