示例#1
0
        public void MenuChinh1()
        {
            pt.pnt("┏", 4, 5);
            pt.pnt("┗", 4, 46);
            pt.pnt("┓", 95, 5);
            pt.pnt("┛", 95, 46);

            pt.pnt("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 5, 5);
            pt.pnt("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 5, 46);
            pt.pnt("                                TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT HƯNG YÊN ", 0, 1);
            pt.pnt("                                      KHOA CÔNG NGHỆ THÔNG TIN ", 1, 2);
            pt.pnt("                                     ------- ○○○○ -------", 3, 3);
            // Vẽ 2 cột ngoài
            for (int i = 6; i < 46; ++i)
            {
                pt.pnt("┃", 4, i);
                pt.pnt("┃", 95, i);
            }
            #region Chữ ký
            Console.ForegroundColor = ConsoleColor.Red;
            pt.pnt("D", 5, 45);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("e", 6, 45);
            Console.ForegroundColor = ConsoleColor.Cyan;
            pt.pnt("s", 7, 45);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt("i", 8, 45);
            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("g", 9, 45);
            Console.ForegroundColor = ConsoleColor.Gray;
            pt.pnt("n", 10, 45);
            Console.ForegroundColor = ConsoleColor.Magenta;
            pt.pnt("e", 11, 45);
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            pt.pnt("d", 12, 45);
            Console.ForegroundColor = ConsoleColor.DarkRed;
            pt.pnt("b", 14, 45);
            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("y", 15, 45);
            Console.ForegroundColor = ConsoleColor.Red;
            pt.pnt("T", 17, 45);
            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("e", 18, 45);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt("a", 19, 45);
            Console.ForegroundColor = ConsoleColor.Red;
            pt.pnt("m", 20, 45);
            Console.ForegroundColor = ConsoleColor.Magenta;
            pt.pnt("T", 22, 45);
            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("™", 23, 45);
            Console.ForegroundColor = ConsoleColor.White;
            #endregion
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt(" CHƯƠNG TRÌNH QUẢN LÝ HỌC SINH", 34, 6);
            Console.ForegroundColor = ConsoleColor.White;

            pt.pnt("┏", 19, 12);
            pt.pnt("┓", 79, 12);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 12);
            pt.pnt("┛", 79, 36);
            pt.pnt("┗", 19, 36);

            // Vẽ 2 cột trong
            for (int i = 13; i < 36; ++i)
            {
                pt.pnt("┃", 19, i);
                pt.pnt("┃", 79, i);
            }
            for (int i = 16; i < 36; i += 2)
            {
                pt.pnt("┠", 19, i);
            }
            for (int i = 16; i < 36; i += 2)
            {
                pt.pnt("┨", 79, i);
            }
            pt.pnt("━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 20, 16);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 18);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 20);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 22);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 24);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 26);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 28);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 30);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 32);
            pt.pnt("───────────────────────────────────────────────────────────", 20, 34);
            pt.pnt("━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 20, 36);



            for (int i = 17; i < 36; ++i)
            {
                pt.pnt("┃", 25, i);
            }

            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("            CHỨC NĂNG CỦA CHƯƠNG TRÌNH               ", 25, 14);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt("F1", 21, 17);
            pt.pnt("F2", 21, 19);
            pt.pnt("F3", 21, 21);
            pt.pnt("F4", 21, 23);
            pt.pnt("F5", 21, 25);
            pt.pnt("F6", 21, 27);
            pt.pnt("F7", 21, 29);
            pt.pnt("F8", 21, 31);
            pt.pnt("F9", 21, 33);
            pt.pnt("F10", 21, 35);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("Quản lý Học Sinh", 32, 17);
            pt.pnt("Quản lý Lớp Học ", 32, 19);
            pt.pnt("Quản lý Giáo Viên", 32, 21);
            pt.pnt("Quản lý Bảng Điểm ", 32, 23);
            pt.pnt("Quản lý Môn Học", 32, 25);
            pt.pnt("Tìm kiếm", 32, 27);
            pt.pnt("Thống kê", 32, 29);
            pt.pnt("Thông tin phần mềm", 32, 31);
            pt.pnt("Tài liệu tham khảo", 32, 33);
            pt.pnt("Hướng dẫn sử dụng phần mềm", 32, 35);

            pt.pnt("Mời bạn chọn chức năng : ", 60, 40);
            Console.ForegroundColor = ConsoleColor.Yellow;
            pt.pnt("Hoặc  ↓↑", 60, 41);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("Nhấn", 60, 42);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt(" H ", 65, 42);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("để mở cửa sổ trợ giúp", 69, 42);

            pt.pnt("Nhấn ", 60, 43);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt("Tab", 65, 43);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("để quay lại", 69, 43);

            pt.pnt("Nhấn", 60, 44);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt("Esc", 65, 44);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt("để thoát khỏi chương trình", 69, 44);
            pt.pnt("", 85, 40);
            label1 : ConsoleKeyInfo kt = Console.ReadKey();
            Console.ForegroundColor    = ConsoleColor.White;
            switch (kt.Key)
            {
            case ConsoleKey.F1:
                Console.Clear();
                fhs.themhs();
                break;

            case ConsoleKey.F2:
                Console.Clear();
                fl.Themlop();
                break;

            case ConsoleKey.F3:
                Console.Clear();
                fgv.themgv();
                break;

            case ConsoleKey.F4:
                Console.Clear();
                fbd.themdiem();
                break;

            case ConsoleKey.F5:
                Console.Clear();
                mh.themmh();
                break;

            case ConsoleKey.F6:
                Console.Clear();
                ftk.chucnangtk();
                break;

            case ConsoleKey.F7:
                Console.Clear();
                fthk.chucnangthk();
                break;

            case ConsoleKey.F8:
                Console.Clear();
                tt.thongtinpm();
                break;

            case ConsoleKey.F9:
                Console.Clear();
                tt.tailieutk();
                break;

            case ConsoleKey.F10:
                Console.Clear();
                tt.huongdansd();
                break;

            case ConsoleKey.H:
                Console.Clear();
                tt.trungtamtrogiup();
                break;

            case ConsoleKey.Tab:
                Console.Clear();
                dn.dangnhap();
                break;

            case ConsoleKey.Escape:
                Environment.Exit(0);
                break;

            default:
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt("       ", 85, 40);
                pt.pnt("Bạn nhập sai xin mời nhập lại", 60, 45);
                pt.pnt("", 85, 40);
                goto label1;
            }
        }
示例#2
0
        public void themmh()
        {
            pt.pnt1("┏", 4, 8);
            pt.pnt1("┗", 4, 52);
            pt.pnt1("┓", 133, 8);
            pt.pnt1("┛", 133, 52);

            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 5, 8);
            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 5, 52);
            pt.pnt1("                                              TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT HƯNG YÊN ", 0, 1);
            pt.pnt1("                                                      KHOA CÔNG NGHỆ THÔNG TIN ", 1, 2);
            pt.pnt1("                                                     ------- ○○○○ -------", 3, 3);
            for (int i = 9; i < 52; ++i)
            {
                pt.pnt1("┃", 4, i);
                pt.pnt1("┃", 133, i);
            }
            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 5, 15);
            pt.pnt1(" Thêm môn học ", 59, 8);
            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 27, 18);
            for (int i = 19; i < 42; i++)
            {
                pt.pnt1("┃", 27, i);
                pt.pnt1("┃", 105, i);
            }

            pt.pnt1("┏", 27, 18);
            pt.pnt1("┗", 27, 42);
            pt.pnt1("┓", 105, 18);
            pt.pnt1("┛", 105, 42);

            pt.pnt1("┣", 4, 15);
            pt.pnt1("┣", 27, 22);
            pt.pnt1("┣", 27, 24);

            pt.pnt1("┫", 133, 15);
            pt.pnt1("┫", 105, 22);
            pt.pnt1("┫", 105, 24);

            Console.ForegroundColor = ConsoleColor.Magenta;
            pt.pnt1("Designed by TeamT ™", 5, 51);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 28, 22);
            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 28, 24);

            pt.pnt1("━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", 28, 42);


            for (int i = 23; i < 42; i++)
            {
                pt.pnt1("┃", 49, i);
                pt.pnt1("┃", 74, i);
            }

            pt.pnt1("DANH SÁCH MÔN HỌC ", 61, 20);
            pt.pnt1(" Mã môn ", 34, 23);
            pt.pnt1(" Tên môn", 56, 23);
            pt.pnt1(" Ghi chú", 87, 23);

            pt.pnt1("Mã môn : ", 18, 10);
            pt.pnt1("Tên môn :", 50, 10);
            pt.pnt1("Ghi chú : ", 89, 10);

            pt.pnt1("1. Thêm môn học", 88, 43);
            pt.pnt1("2. Sửa môn học", 88, 44);
            pt.pnt1("3. Xóa môn học", 88, 45);
            pt.pnt1("4. Để quay lại menu chính", 88, 46);
            pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
            pt.pnt1("Nhấn", 88, 48);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt1("H", 93, 48);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt1("để mở thanh công cụ và", 95, 48);
            Console.ForegroundColor = ConsoleColor.Green;
            pt.pnt1("E", 118, 48);
            Console.ForegroundColor = ConsoleColor.White;
            pt.pnt1("để tắt", 120, 48);

            // Lấy danh sách môn học
            danhsach : List <MonHoc> listmh = mhbll.LayDLMH();
            mhda.BackUp(listmh);
            int a   = 25;
            int tmp = 0;

            for (int i = 0; i < listmh.Count; ++i)
            {
                if (tmp < 9)
                {
                    {
                        pt.pnt1(listmh[i].Mamon, 37, a);
                        pt.pnt1(listmh[i].Tenmon, 58, a);
                        pt.pnt1(listmh[i].Ghichu, 87, a);
                        tmp++;
                        a += 2;
                    }
                }
                else
                {
                    break;
                }
            }
            pt.pnt1("Chọn chức năng : ", 88, 49);
            chucnang : ConsoleKeyInfo ktktt = Console.ReadKey();
            Console.ForegroundColor         = ConsoleColor.White;
            switch (ktktt.KeyChar)
            {
            case '1':
                pt.pnt1(" Thêm môn học ", 58, 8);
                pt.pnt1("               ", 88, 43);
                Console.ForegroundColor = ConsoleColor.Green;
                pt.pnt1("→ 1. Thêm môn học", 88, 43);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("    ", 105, 49);
                pt.pnt1("                          ", 88, 50);

                pt.pnt1("                         ", 10, 10);
                pt.pnt1("                            ", 40, 12);

                pt.pnt1("Mã môn : ", 18, 10);
                pt.pnt1("Tên môn :", 50, 10);
                pt.pnt1("Ghi chú : ", 89, 10);
                goto themmh;

            case '2':
                pt.pnt1(" Sửa môn học   ", 58, 8);
                pt.pnt1("               ", 88, 43);
                pt.pnt1("               ", 88, 44);
                pt.pnt1("1. Thêm môn học", 88, 43);
                Console.ForegroundColor = ConsoleColor.Green;
                pt.pnt1("→ 2. Sửa môn học", 88, 44);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("    ", 105, 49);
                pt.pnt1("                          ", 88, 50);

                pt.pnt1("                ", 18, 10);
                pt.pnt1("                ", 50, 10);
                pt.pnt1("                ", 89, 10);

                pt.pnt1("                            ", 40, 12);

                Console.ForegroundColor = ConsoleColor.Yellow;
                pt.pnt1("Nhập mã môn cần sửa : ", 10, 10);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("Tên môn :", 50, 10);
                pt.pnt1("Ghi chú : ", 89, 10);
                goto suamh;

            case '3':
                pt.pnt1(" Xóa môn học   ", 58, 8);
                pt.pnt1("               ", 88, 43);
                pt.pnt1("               ", 88, 44);
                pt.pnt1("               ", 88, 45);
                pt.pnt1("1. Thêm môn học", 88, 43);
                pt.pnt1("1. Sửa môn học", 88, 44);
                Console.ForegroundColor = ConsoleColor.Green;
                pt.pnt1("→ 3. Xóa môn học", 88, 45);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("    ", 105, 49);
                pt.pnt1("                          ", 88, 50);

                pt.pnt1("                ", 18, 10);
                pt.pnt1("                ", 50, 10);
                pt.pnt1("                ", 89, 10);

                pt.pnt1("                       ", 10, 10);
                pt.pnt1("                ", 50, 10);
                pt.pnt1("                ", 89, 10);

                Console.ForegroundColor = ConsoleColor.Yellow;
                pt.pnt1("Nhập mã môn cần xóa : ", 40, 12);
                Console.ForegroundColor = ConsoleColor.White;
                goto Xoamh;

            case '4':
                Console.Clear();
                mn.MenuChinh1();
                break;

            case '5':
                Environment.Exit(0);
                break;

            case 'G':
                Console.Clear();
                fgv.themgv();
                break;

            case 'D':
                Console.Clear();
                fbd.themdiem();
                break;

            case 'L':
                Console.Clear();
                flh.Themlop();
                break;

            case 'T':
                Console.Clear();
                ff.chucnangtk();
                break;

            case 'K':
                Console.Clear();
                ftk.chucnangthk();
                break;

            case 'S':
                Console.Clear();
                fhs.themhs();
                break;

            case 'H':
                Console.ForegroundColor = ConsoleColor.Yellow;
                pt.pnt1("G : Quản lý Giáo Viên", 4, 6);
                pt.pnt1("D : Quản lý Điểm", 30, 6);
                pt.pnt1("L : Quản lý Lớp học", 52, 6);
                pt.pnt1("T : Tìm kiếm", 76, 6);
                pt.pnt1("K : Thống kê", 96, 6);
                pt.pnt1("S : Quản lý học sinh", 114, 6);
                pt.pnt1("                           ", 88, 51);
                pt.pnt1("  ", 105, 49);
                pt.pnt1("", 105, 49);
                Console.ForegroundColor = ConsoleColor.White;
                goto chucnang;

            case 'E':
                pt.pnt1("                       ", 4, 6);
                pt.pnt1("                       ", 30, 6);
                pt.pnt1("                       ", 52, 6);
                pt.pnt1("                       ", 76, 6);
                pt.pnt1("                       ", 96, 6);
                pt.pnt1("                       ", 114, 6);
                pt.pnt1("                          ", 88, 51);
                pt.pnt1("  ", 105, 49);
                pt.pnt1("", 105, 49);
                goto chucnang;

            case '6':
                Environment.Exit(0); break;

            default:
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("      ", 105, 49);
                pt.pnt1("Bạn nhập sai xin nhập lại", 88, 50);
                pt.pnt1("", 105, 49);
                Console.ForegroundColor = ConsoleColor.White;
                goto chucnang;
            }
            #region thêm môn
themmh:
            string mamon, tenmon, ghichu;
            pt.pnt1("", 26, 10); mamon = Console.ReadLine();
            if (mamon == "")
            {
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Mã môn không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                Console.ForegroundColor = ConsoleColor.White;
                ConsoleKeyInfo kt = Console.ReadKey();
                switch (kt.Key)
                {
                case ConsoleKey.Tab:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    pt.pnt1("1. Thêm môn học    ", 88, 43);
                    pt.pnt1("2. Sửa môn học", 88, 44);
                    pt.pnt1("3. Xóa môn học", 88, 45);
                    pt.pnt1("4. Để quay lại menu chính", 88, 46);
                    pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                    pt.pnt1("Nhấn", 88, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("H", 93, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để mở thanh công cụ và", 95, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("E", 118, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để tắt", 120, 48);
                    pt.pnt1("", 105, 49);
                    goto chucnang;

                default:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    goto themmh;
                }
            }
            if (mhbll.KTMamon(mamon) == true)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Mã môn đã tồn tại ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                Console.ForegroundColor = ConsoleColor.White;
                ConsoleKeyInfo kt = Console.ReadKey();
                switch (kt.Key)
                {
                case ConsoleKey.Tab:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("1. Thêm môn học    ", 88, 43);
                    pt.pnt1("2. Sửa môn học", 88, 44);
                    pt.pnt1("3. Xóa môn học", 88, 45);
                    pt.pnt1("4. Để quay lại menu chính", 88, 46);
                    pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                    pt.pnt1("Nhấn", 88, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("H", 93, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để mở thanh công cụ và", 95, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("E", 118, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để tắt", 120, 48);
                    pt.pnt1("", 105, 49);
                    goto chucnang;

                default:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("           ", 26, 10);
                    goto themmh;
                }
            }
tenmon:
            pt.pnt1("", 60, 10); tenmon = Console.ReadLine();
            if (tenmon == "")
            {
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Tên môn không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                Console.ForegroundColor = ConsoleColor.White;
                ConsoleKeyInfo kt = Console.ReadKey();
                switch (kt.Key)
                {
                case ConsoleKey.Tab:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    pt.pnt1("1. Thêm môn học    ", 88, 43);
                    pt.pnt1("2. Sửa môn học", 88, 44);
                    pt.pnt1("3. Xóa môn học", 88, 45);
                    pt.pnt1("4. Để quay lại menu chính", 88, 46);
                    pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                    pt.pnt1("Nhấn", 88, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("H", 93, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để mở thanh công cụ và", 95, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("E", 118, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để tắt", 120, 48);
                    pt.pnt1("", 105, 49);
                    goto chucnang;

                default:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    goto tenmon;
                }
            }
            if (tenmon.Length < 4)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Tên môn không đúng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                Console.ForegroundColor = ConsoleColor.White;
                ConsoleKeyInfo kt = Console.ReadKey();
                switch (kt.Key)
                {
                case ConsoleKey.Tab:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("1. Thêm môn học    ", 88, 43);
                    pt.pnt1("2. Sửa môn học", 88, 44);
                    pt.pnt1("3. Xóa môn học", 88, 45);
                    pt.pnt1("4. Để quay lại menu chính", 88, 46);
                    pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                    pt.pnt1("Nhấn", 88, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("H", 93, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để mở thanh công cụ và", 95, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("E", 118, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để tắt", 120, 48);
                    pt.pnt1("", 105, 49);
                    goto chucnang;

                default:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 60, 10);
                    goto tenmon;
                }
            }
ghichu:
            pt.pnt1("", 99, 10); ghichu = Console.ReadLine();
            if (ghichu == "")
            {
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Ghi chú không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                Console.ForegroundColor = ConsoleColor.White;
                ConsoleKeyInfo kt = Console.ReadKey();
                switch (kt.Key)
                {
                case ConsoleKey.Tab:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    pt.pnt1("1. Thêm môn học    ", 88, 43);
                    pt.pnt1("2. Sửa môn học", 88, 44);
                    pt.pnt1("3. Xóa môn học", 88, 45);
                    pt.pnt1("4. Để quay lại menu chính", 88, 46);
                    pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                    pt.pnt1("Nhấn", 88, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("H", 93, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để mở thanh công cụ và", 95, 48);
                    Console.ForegroundColor = ConsoleColor.Green;
                    pt.pnt1("E", 118, 48);
                    Console.ForegroundColor = ConsoleColor.White;
                    pt.pnt1("để tắt", 120, 48);
                    pt.pnt1("", 105, 49);
                    goto chucnang;

                default:
                    pt.pnt1("                                                    ", 6, 44);
                    pt.pnt1("                        ", 6, 45);
                    goto ghichu;
                }
            }
            for (int i = 0; i < ghichu.Length; ++i)
            {
                if (ghichu.Length < 4 || (ghichu[i] != 'b' && ghichu[i] != 'a' && ghichu[i] != 't' && ghichu[i] != 'u' && ghichu[i] != 'o' && ghichu[i] != 'c' && ghichu[i] != 'h' && ghichu[i] != 'n' && ghichu[i] != ' '))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    pt.pnt1("Ghi chú là : bắt buộc hoặc tự chọn ! Nhấn phím bất kỳ nhập lại ", 15, 47);
                    Console.ForegroundColor = ConsoleColor.White;
                    ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    default:
                        pt.pnt1("                                                                            ", 15, 47);
                        pt.pnt1("                        ", 99, 10);
                        goto ghichu;
                    }
                }
            }
            MonHoc mh = new MonHoc(mamon, tenmon, ghichu);
            pt.pnt1("Nhấn Enter để lưu và thêm tiếp ", 6, 44);
            pt.pnt1("Nhấn Tab để quay lại", 6, 45);
label4:
            ConsoleKeyInfo ktt = Console.ReadKey();
            switch (ktt.Key)
            {
            case ConsoleKey.Enter:
                mhbll.ThemMH(mh);
                Console.Clear();
                themmh();
                break;

            case ConsoleKey.Tab:
                pt.pnt1("                                                    ", 6, 44);
                pt.pnt1("                        ", 6, 45);
                pt.pnt1("1. Thêm môn học    ", 88, 43);
                pt.pnt1("2. Sửa môn học", 88, 44);
                pt.pnt1("3. Xóa môn học", 88, 45);
                pt.pnt1("4. Để quay lại menu chính", 88, 46);
                pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                pt.pnt1("Nhấn", 88, 48);
                Console.ForegroundColor = ConsoleColor.Green;
                pt.pnt1("H", 93, 48);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("để mở thanh công cụ và", 95, 48);
                Console.ForegroundColor = ConsoleColor.Green;
                pt.pnt1("E", 118, 48);
                Console.ForegroundColor = ConsoleColor.White;
                pt.pnt1("để tắt", 120, 48);
                pt.pnt1("", 105, 49);
                goto chucnang;

            default:
                Console.ForegroundColor = ConsoleColor.Red;
                pt.pnt1("Bạn nhập sai ! Xin nhập lại ", 6, 46);
                Console.ForegroundColor = ConsoleColor.White;
                goto label4;
            }
            #endregion

            #region sửa môn học
suamh:
            string mamons, tenmonmoi, ghichumoi;
            pt.pnt1("", 32, 10); mamons = Console.ReadLine();
            do
            {
                if (mamons == "")
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    pt.pnt1("Mã môn không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                    pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                    Console.ForegroundColor = ConsoleColor.White;
                    ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    case ConsoleKey.Tab:
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);
                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học     ", 88, 44);
                        pt.pnt1("3. Xóa môn học", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);
                        goto chucnang;

                    default:
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);
                        goto suamh;
                    }
                }
                if (mhbll.KTMamon(mamons) == true)
                {
                    List <MonHoc> listmhh = mhbll.LayDLMH();
                    for (int i = 0; i < listmhh.Count; ++i)
                    {
                        if (listmhh[i].Mamon == mamons)
                        {
                            pt.pnt1(listmhh[i].Tenmon, 60, 10);
                            pt.pnt1(listmhh[i].Ghichu, 99, 10);
                        }
                    }
                    pt.pnt1("", 60, 10);
                    Console.ReadKey();
                    pt.pnt1("              ", 60, 10);
tenmonmoi:
                    pt.pnt1("", 60, 10); tenmonmoi = Console.ReadLine();
                    if (tenmonmoi == "")
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        pt.pnt1("Tên môn không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                        pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                        Console.ForegroundColor = ConsoleColor.White;
                        ConsoleKeyInfo kt = Console.ReadKey();
                        switch (kt.Key)
                        {
                        case ConsoleKey.Tab:
                            pt.pnt1("                                                    ", 6, 44);
                            pt.pnt1("                        ", 6, 45);
                            pt.pnt1("1. Thêm môn học    ", 88, 43);
                            pt.pnt1("2. Sửa môn học     ", 88, 44);
                            pt.pnt1("3. Xóa môn học", 88, 45);
                            pt.pnt1("4. Để quay lại menu chính", 88, 46);
                            pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                            pt.pnt1("Nhấn", 88, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("H", 93, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để mở thanh công cụ và", 95, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("E", 118, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để tắt", 120, 48);
                            pt.pnt1("", 105, 49);
                            goto chucnang;

                        default:
                            pt.pnt1("                                                    ", 15, 47);
                            pt.pnt1("                        ", 15, 48);
                            goto tenmonmoi;
                        }
                    }
                    if (tenmonmoi.Length < 4)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        pt.pnt1("Tên môn không đúng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                        Console.ForegroundColor = ConsoleColor.White;
                        ConsoleKeyInfo kt = Console.ReadKey();
                        switch (kt.Key)
                        {
                        case ConsoleKey.Tab:
                            pt.pnt1("                                                    ", 6, 44);
                            pt.pnt1("1. Thêm môn học    ", 88, 43);
                            pt.pnt1("2. Sửa môn học     ", 88, 44);
                            pt.pnt1("3. Xóa môn học", 88, 45);
                            pt.pnt1("4. Để quay lại menu chính", 88, 46);
                            pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                            pt.pnt1("Nhấn", 88, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("H", 93, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để mở thanh công cụ và", 95, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("E", 118, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để tắt", 120, 48);
                            pt.pnt1("", 105, 49);
                            goto chucnang;

                        default:
                            pt.pnt1("                                                    ", 15, 47);
                            pt.pnt1("                        ", 60, 10);
                            goto tenmonmoi;
                        }
                    }
                    pt.pnt1("", 99, 10);
                    Console.ReadKey();
                    pt.pnt1("            ", 99, 10);
ghichumoi:
                    pt.pnt1("", 99, 10); ghichumoi = Console.ReadLine();
                    if (ghichumoi == "")
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        pt.pnt1("Ghi chú không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                        pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                        Console.ForegroundColor = ConsoleColor.White;
                        ConsoleKeyInfo kt = Console.ReadKey();
                        switch (kt.Key)
                        {
                        case ConsoleKey.Tab:
                            pt.pnt1("                                                    ", 6, 44);
                            pt.pnt1("                        ", 6, 45);
                            pt.pnt1("1. Thêm môn học    ", 88, 43);
                            pt.pnt1("2. Sửa môn học     ", 88, 44);
                            pt.pnt1("3. Xóa môn học", 88, 45);
                            pt.pnt1("4. Để quay lại menu chính", 88, 46);
                            pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                            pt.pnt1("Nhấn", 88, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("H", 93, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để mở thanh công cụ và", 95, 48);
                            Console.ForegroundColor = ConsoleColor.Green;
                            pt.pnt1("E", 118, 48);
                            Console.ForegroundColor = ConsoleColor.White;
                            pt.pnt1("để tắt", 120, 48);
                            pt.pnt1("", 105, 49);
                            goto chucnang;

                        default:
                            pt.pnt1("                                                    ", 15, 47);
                            pt.pnt1("                        ", 15, 48);
                            goto ghichumoi;
                        }
                    }
                    for (int i = 0; i < ghichumoi.Length; ++i)
                    {
                        if (ghichumoi.Length < 4 || (ghichumoi.ToLower() != "bat buoc".ToLower() && ghichumoi.ToLower() != "tu chon".ToLower()))
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            pt.pnt1("Ghi chú là : bắt buộc hoặc tự chọn ! Nhấn phím bất kỳ nhập lại ", 15, 47);
                            Console.ForegroundColor = ConsoleColor.White;
                            ConsoleKeyInfo kt = Console.ReadKey();
                            switch (kt.Key)
                            {
                            default:
                                pt.pnt1("                                                                            ", 15, 47);
                                pt.pnt1("                        ", 99, 10);
                                goto ghichumoi;
                            }
                        }
                    }

                    MonHoc mhnew = new MonHoc(mamons, tenmonmoi, ghichumoi);
                    pt.pnt1("Nhấn Enter để lưu và sửa tiếp ", 6, 44);
                    pt.pnt1("Nhấn Tab để quay lại", 6, 45);
den:
                    ConsoleKeyInfo ktty = Console.ReadKey();
                    switch (ktty.Key)
                    {
                    case ConsoleKey.Enter:
                        mhbll.XoaMH(mamons);
                        mhbll.ThemMH(mhnew);
                        pt.pnt1("          ", 32, 10);
                        pt.pnt1("              ", 60, 10);
                        pt.pnt1("              ", 99, 10);

                        pt.pnt1("                                   ", 6, 44);
                        pt.pnt1("                                   ", 6, 45);

                        for (int i = 25; i < 38; ++i)
                        {
                            pt.pnt1("          ", 37, i);
                            pt.pnt1("                   ", 58, i);
                            pt.pnt1("                   ", 87, i);
                        }

                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học     ", 88, 44);
                        pt.pnt1("3. Xóa môn học     ", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);

                        goto danhsach;

                    case ConsoleKey.Tab:
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);

                        pt.pnt1("          ", 32, 10);
                        pt.pnt1("              ", 60, 10);
                        pt.pnt1("              ", 99, 10);

                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học     ", 88, 44);
                        pt.pnt1("3. Xóa môn học      ", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);
                        goto chucnang;

                    default:
                        Console.ForegroundColor = ConsoleColor.Red;
                        pt.pnt1("Bạn nhập sai ! Xin nhập lại ", 6, 49);
                        Console.ForegroundColor = ConsoleColor.White;
                        goto den;
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    pt.pnt1("Mã môn không tồn tại ! Nhấn phím bất kỳ nhập lại ", 15, 47);
                    Console.ForegroundColor = ConsoleColor.White;
                    ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    default:
                        pt.pnt1("                                                    ", 15, 47);
                        pt.pnt1("         ", 32, 10);
                        goto suamh;
                    }
                }
            } while (true);
            #endregion

            #region xóa môn
Xoamh:
            string mamonx;
            do
            {
                pt.pnt1("", 61, 12); mamonx = Console.ReadLine();
                if (mamonx == "")
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    pt.pnt1("Mã môn không rỗng ! Nhấn phím bất kỳ nhập lại ", 6, 44);
                    pt.pnt1("Nhấn Tab để quay lại ", 6, 45);
                    Console.ForegroundColor = ConsoleColor.White;
                    ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    case ConsoleKey.Tab:
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);
                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học     ", 88, 44);
                        pt.pnt1("3. Xóa môn học     ", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);
                        goto chucnang;

                    default:
                        pt.pnt1("                                                    ", 15, 47);
                        pt.pnt1("                        ", 15, 48);
                        goto Xoamh;
                    }
                }
                if (mhbll.KTMamon(mamonx) == true)
                {
                    pt.pnt1("Nhấn Enter để lưu và xóa tiếp ", 6, 44);
                    pt.pnt1("Nhấn Tab để quay lại", 6, 45);
                    den2 : ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    case ConsoleKey.Enter:
                        mhbll.XoaMH(mamonx);
                        pt.pnt1("      ", 61, 12);
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);

                        for (int i = 25; i < 38; ++i)
                        {
                            pt.pnt1("          ", 37, i);
                            pt.pnt1("                   ", 58, i);
                            pt.pnt1("                   ", 87, i);
                        }

                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học   ", 88, 44);
                        pt.pnt1("3. Xóa môn học   ", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);

                        goto danhsach;

                    case ConsoleKey.Tab:
                        pt.pnt1("                                                    ", 6, 44);
                        pt.pnt1("                        ", 6, 45);
                        pt.pnt1("1. Thêm môn học    ", 88, 43);
                        pt.pnt1("2. Sửa môn học     ", 88, 44);
                        pt.pnt1("3. Xóa môn học", 88, 45);
                        pt.pnt1("4. Để quay lại menu chính", 88, 46);
                        pt.pnt1("5. Để thoát khỏi chương trình", 88, 47);
                        pt.pnt1("Nhấn", 88, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("H", 93, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để mở thanh công cụ và", 95, 48);
                        Console.ForegroundColor = ConsoleColor.Green;
                        pt.pnt1("E", 118, 48);
                        Console.ForegroundColor = ConsoleColor.White;
                        pt.pnt1("để tắt", 120, 48);
                        pt.pnt1("", 105, 49);
                        goto chucnang;

                    default:
                        Console.ForegroundColor = ConsoleColor.Red;
                        pt.pnt1("Bạn nhập sai ! Xin nhập lại ", 80, 49);
                        Console.ForegroundColor = ConsoleColor.White;
                        goto den2;
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    pt.pnt1("Mã môn không tồn tại ! Nhấn phím bất kỳ nhập lại ", 15, 47);
                    Console.ForegroundColor = ConsoleColor.White;
                    ConsoleKeyInfo kt = Console.ReadKey();
                    switch (kt.Key)
                    {
                    default:
                        pt.pnt1("                                                    ", 15, 47);
                        pt.pnt1("                ", 61, 12);
                        goto Xoamh;
                    }
                }
            } while (true);
            #endregion
        }