Esempio n. 1
0
        public List <Course> GetList()
        {
            List <Course> courses = new List <Course>();

            courses = GetAll <Course>(query);
            List <Stream>     streams = new StreamService().SetList();
            List <TypeCourse> types   = new TypeService().SetList();

            foreach (Course c in courses)
            {
                Stream str = streams.FirstOrDefault(x => x.StreamId == c.StreamId);
                if (str is Stream)
                {
                    c.Stream = str.StreamName;
                }
                foreach (TypeCourse type in types)
                {
                    if (c.TypeId == type.TypeId)
                    {
                        c.Type = type.TypeName;
                        break;
                    }
                }
            }
            return(courses);
        }
Esempio n. 2
0
        public int TypeInsert()
        {
            Console.Clear();
            List <TypeCourse> typeCourses = new TypeService().SetList();

            Console.WriteLine($"Choose Type for your Course({Title})");
            typeCourses.ForEach(x => Console.WriteLine($"{x.TypeId}.{x.TypeName}"));
            Console.Write("------\n>");
            int temp = IntegerId <TypeCourse>(typeCourses);

            return(temp);
        }