Beispiel #1
0
        public static void MenuQuanLiQuanCaPhe()
        {
            int chon;

            do
            {
                Console.WriteLine("\t\t\t |=============================Quan Li Quan Ca Phe=============================|\n");
                Console.WriteLine("\t\t\t |                            0. Quan Li Nhan Vien                             |\n");
                Console.WriteLine("\t\t\t |                            1. Quan Li Ban                                   |\n");
                Console.WriteLine("\t\t\t |                            2. Quan Li Bo Phan                               |\n");
                Console.WriteLine("\t\t\t |                            3. Quan Li Thuc Don                              |\n");
                Console.WriteLine("\t\t\t |                            4. Quan Li Hoa Don                               |\n");
                Console.WriteLine("\t\t\t |                            5. Thoat                                         |\n");
                Console.WriteLine("\t\t\t |===================================CHOOSE====================================|\n");
                Console.WriteLine("Ban Chon: ");
                chon = int.Parse(Console.ReadLine());
                try {
                    switch (chon)
                    {
                    case 0:
                        QuanLiNhanVien.MenuQuanLiNhanVien();
                        break;

                    case 1:
                        QuanLiBan.MenuQuanLiBan();
                        break;

                    case 2:
                        QuanLiBoPhan.MenuQuanLiBoPhan();
                        break;

                    case 3:
                        QuanLiThucDon.MenuQuanLiThucDon();
                        break;

                    case 4:
                        QuanLiHoaDon.MenuQuanLiHoaDon();
                        break;

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

                    default:
                        Console.WriteLine("Vui Long Nhap Lai");
                        break;
                    }
                }
                catch (System.FormatException) {
                    Console.WriteLine("Vui Long Nhap Chu So");
                }
            }while(chon != 0 || chon != 5);
        }
        public static void MenuCapNhat()
        {
            int    chon;
            string MaBan;

            Console.WriteLine("Nhap Ma Ban Muon Cap Nhat: ");
            MaBan = Console.ReadLine();
            Ban ban = QuanLiBan.DSBan.Find(x => x.MaBan == MaBan);

            if (ban == null)
            {
                Console.WriteLine("Ban Khong Co Trong He Thong. Xin Nhap Lai");
                QuanLiBan.MenuCapNhat();
            }
            do
            {
                Console.WriteLine("\t\t\t |=============================Cap Nhat Thong Tin Ban=============================|\n");
                Console.WriteLine("\t\t\t |                            0. Quay Lai                                         |\n");
                Console.WriteLine("\t\t\t |                            1. Tinh Trang                                       |\n");
                Console.WriteLine("\t\t\t |                            2. Suc Chua                                         |\n");
                Console.WriteLine("\t\t\t |                            3. Thoat                                            |\n");
                Console.WriteLine("\t\t\t |====================================CHOOSE======================================|\n");
                Console.WriteLine("Ban Chon: ");
                chon = int.Parse(Console.ReadLine());
                try {
                    Console.WriteLine("Thong Tin Ban Can Cap Nhat: ");
                    Console.WriteLine("\t\t\t Ma Ban                          | Tinh Trang                         | Suc Chua");
                    ban.HienThi();
                    switch (chon)
                    {
                    case 0:
                        QuanLiBan.MenuQuanLiBan();
                        break;

                    case 1:
                        string tt;
                        Console.WriteLine("Nhap Tinh Trang(Trong/Day): ");
                        tt = Console.ReadLine();
                        ban.CapNhatTinhTrang(tt);
                        break;

                    case 2:
                        int sc;
                        Console.WriteLine("Nhap Suc Chua: ");
                        sc = int.Parse(Console.ReadLine());
                        if (sc > 0)
                        {
                            ban.CapNhatSucChua(sc);
                        }
                        break;

                    default:
                        Console.WriteLine("Vui Long Nhap Lai");
                        break;
                    }
                    Console.WriteLine("Thong Tin Ban Sau Cap Nhat: ");
                    Console.WriteLine("\t\t\t Ma Ban                          | Tinh Trang                         | Suc Chua");
                    ban.HienThi();
                }
                catch (System.FormatException) {
                    Console.WriteLine("Vui Long Nhap Chu So");
                }
            }while(chon != 0 || chon != 3);
        }