Exemplo n.º 1
0
        public K205(string K205Name, Teacher teacher)
        {
            this.K205Name = K205Name;
            StudentList   = new List <Student>();
            K205Id++;
            Id          = K205Id;
            ProgList    = new List <Prog>();
            TeacherList = new List <Teacher>();
            ValueList   = new List <Value>();
            Prog design      = new Prog("Design", new DateTime(2020, 09, 09));
            Prog programming = new Prog("Programming", new DateTime(2020, 09, 12));
            Prog gamecreate  = new Prog("GameCreate", new DateTime(2020, 09, 30));

            ProgList.Add(design);
            ProgList.Add(programming);
            ProgList.Add(gamecreate);

            Value C = new Value("70-80", new DateTime(2020, 09, 09));
            Value B = new Value("80-90", new DateTime(2020, 09, 12));
            Value A = new Value("90-100", new DateTime(2020, 09, 30));

            ValueList.Add(C);
            ValueList.Add(B);
            ValueList.Add(A);
        }
Exemplo n.º 2
0
        public void AddProg()
        {
            Console.ForegroundColor = ConsoleColor.Cyan;

            Console.WriteLine("__________***_________");
            Console.Write("Please write Prog name:");

            string proname = Console.ReadLine();

            if (!string.IsNullOrEmpty(proname))
            {
                Prog prg = new Prog(proname, DateTime.Now);
                ProgList.Add(prg);
                Console.ForegroundColor = ConsoleColor.DarkBlue;
                Console.WriteLine("__________***_________");
                Console.WriteLine("Prog name was added successfully:");
                foreach (var pro in ProgList)
                {
                    Console.WriteLine("Prog Name:{0}, Prog Date:{1}", pro.ProgName, pro.Date);
                }
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.Red;
                Console.WriteLine("__________***_________");
                Console.Write("Please fiel Prog name:");
            }
        }
Exemplo n.º 3
0
        public void ShowProgForStudent()
        {
            Prog SelectedProg = null;

            foreach (Prog pro in ProgList)
            {
                Console.WriteLine("Prog's Name: {0}", pro.ProgName, pro.Date);
            }
Start:
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Write("Please,Select Prog by Id:");
            string progName    = Console.ReadLine();
            bool   correctName = false;

            foreach (Prog pro in ProgList)
            {
                if (pro.ProgName == progName)
                {
                    correctName  = true;
                    SelectedProg = pro;
                    break;
                }
            }
            if (correctName)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("Student Name for Prog's name:{0}\n", SelectedProg.ProgName);
                foreach (Student stu in StudentList)
                {
                    if (stu.ProgList.Count == 0)
                    {
                        Console.BackgroundColor = ConsoleColor.Black;
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("\nWarning:Selected Student was not found any Prog...");
                        break;
                    }
                    else if (stu.ProgList.Contains(SelectedProg))
                    {
                        Console.ForegroundColor = ConsoleColor.Gray;
                        Console.WriteLine("Student Id:{0}, Student Name:{1}", stu.Id, stu.Fullname);
                    }
                }
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.Black;
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\nWarning:Please,select a valid id...");
                goto Start;
            }
        }
Exemplo n.º 4
0
        public void ShowProgList(Student selectedStu)
        {
            Prog SelectedProg = null;

            foreach (Prog pro in ProgList)
            {
                Console.WriteLine("Prog's Name: {0}", pro.ProgName, pro.Date);
            }
Start:
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Write("Please,Select Prog by Id:");
            string progName    = Console.ReadLine();
            bool   correctName = false;

            foreach (Prog pro in ProgList)
            {
                if (pro.ProgName == progName)
                {
                    correctName  = true;
                    SelectedProg = pro;
                    break;
                }
            }
            if (correctName)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("Prog's name:{0} was added to student's name{1}\n", SelectedProg.ProgName, selectedStu.Fullname);
                selectedStu.ProgList.Add(SelectedProg);
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.Black;
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\nWarning:Please,select a valid id...");
                goto Start;
            }
        }