コード例 #1
0
        public static void MenuQuanLiNhanVien()
        {
            int chon;

            do
            {
                Console.WriteLine("\t\t\t |==============================Quan Li Nhan Vien==============================|\n");
                Console.WriteLine("\t\t\t |                            0. Quay Lai                                      |\n");
                Console.WriteLine("\t\t\t |                            1. Danh Sach Nhan Vien                           |\n");
                Console.WriteLine("\t\t\t |                            2. Them Nhan Vien                                |\n");
                Console.WriteLine("\t\t\t |                            3. Xoa Nhan Vien                                 |\n");
                Console.WriteLine("\t\t\t |                            4. Cap Nhat Thong Tin Nhan Vien                  |\n");
                Console.WriteLine("\t\t\t |                            5. Tra Cuu Thong Tin Nhan Vien                   |\n");
                Console.WriteLine("\t\t\t |                            6. Thoat                                         |\n");
                Console.WriteLine("\t\t\t |===================================CHOOSE====================================|\n");
                Console.WriteLine("Ban Chon: ");
                chon = int.Parse(Console.ReadLine());
                try {
                    switch (chon)
                    {
                    case 0:
                        QuanLiQuan.MenuQuanLiQuanCaPhe();
                        break;

                    case 1:
                        Console.WriteLine("\t\t\t --------------------------------------------DANH SACH NHAN VIEN--------------------------------------------");
                        Console.WriteLine("\t\t\t Ma Nhan Vien | Ho Ten               | Gioi Tinh | Que Quan     | Ngay Sinh     | Ngay Vao Lam     | Bo Phan");
                        QuanLiNhanVien.lNhanVien.ForEach(x => x.HienThi());
                        break;

                    case 2:
                        QuanLiNhanVien.ThemNhanVien();
                        break;

                    case 3:
                        QuanLiNhanVien.XoaNhanVien();
                        break;

                    case 4:
                        QuanLiNhanVien.MenuCapNhat();
                        break;

                    case 5:
                        QuanLiNhanVien.MenuTraCuu();
                        break;

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

                    default:
                        Console.WriteLine("Vui Long Nhap Lai");
                        break;
                    }
                }
                catch (System.FormatException) {
                    Console.WriteLine("Vui Long Nhap Chu So");
                }
            }while(chon != 9);
        }
コード例 #2
0
        public static void MenuQuanLiThucDon()
        {
            int chon;

            do
            {
                Console.WriteLine("\t\t\t |==============================Quan Li Thuc Don===============================|\n");
                Console.WriteLine("\t\t\t |                            0. Quay Lai                                      |\n");
                Console.WriteLine("\t\t\t |                            1. Thuc Don                                      |\n");
                Console.WriteLine("\t\t\t |                            2. Them Mon                                      |\n");
                Console.WriteLine("\t\t\t |                            3. Xoa Mon                                       |\n");
                Console.WriteLine("\t\t\t |                            4. Sap Xep                                       |\n");
                Console.WriteLine("\t\t\t |                            5. Tim Kiem Theo Khoang Gia                      |\n");
                Console.WriteLine("\t\t\t |                            6. Thoat                                         |\n");
                Console.WriteLine("\t\t\t |===================================CHOOSE====================================|\n");
                Console.WriteLine("Ban Chon: ");
                chon = int.Parse(Console.ReadLine());
                try {
                    switch (chon)
                    {
                    case 0:
                        QuanLiQuan.MenuQuanLiQuanCaPhe();
                        break;

                    case 1:
                        QuanLiThucDon.ThucDon();
                        break;

                    case 2:
                        QuanLiThucDon.MenuThem();
                        break;

                    case 3:
                        QuanLiThucDon.MenuXoa();
                        break;

                    case 4:
                        QuanLiThucDon.MenuThuTuSapXep();
                        break;

                    case 5:
                        QuanLiThucDon.MenuTimKiem();
                        break;

                    case 6:
                        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 != 7);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            BoPhan   bp1 = new BoPhan("Quan Li");
            BoPhan   bp2 = new BoPhan("Phuc Vu");
            BoPhan   bp3 = new BoPhan("Pha Che");
            BoPhan   bp4 = new BoPhan("Thu Ngan");
            NhanVien nv1 = new NhanVien("Thanh", "Nam", "DN", "20/09/2020", "12/03/2001", "Phuc Vu");
            NhanVien nv2 = new NhanVien("Trung", "Nam", "HCM", "21/10/2020", "14/02/2000", "Thu Ngan");
            NhanVien nv3 = new NhanVien("Tram", "Nu", "HN", "02/03/2020", "17/09/1999", "Thu Ngan");
            NhanVien nv4 = new NhanVien("Hieu", "Nam", "BB", "14/07/2020", "19/11/1990", "Quan Li");
            NhanVien nv5 = new NhanVien("Nhi", "Nu", "BB", "09/01/2020", "21/07/2001", "Pha Che");

            ThucDon f1 = new ThucAn("Banh flan vo trung", 30000, "Con", "Sang, Trua, Chieu", "Chay");
            ThucDon f2 = new ThucAn("Bap xao", 15000, "Het", "Sang, Trua", "Chay");
            ThucDon f3 = new ThucAn("Com tam", 20000, "Con", "Sang, Trua, Chieu", "Khong Chay");
            ThucDon f4 = new ThucAn("Com chay", 15000, "Con", "Trua, Chieu", "Chay");
            ThucDon f5 = new ThucAn("Goi bo", 20000, "Con", "Chieu, Toi", "Khong Chay");
            ThucDon d1 = new ThucUong("Tra Sua Tran Chau", 30000, "Con", "Sang, Trua, Chieu, Toi", "Da");
            ThucDon d2 = new ThucUong("Sua Nong", 20000, "Con", "Trua, Toi", "Khong Da");
            ThucDon d3 = new ThucUong("Coffe Da", 15000, "Con", "Sang, Toi", "Da");
            ThucDon d4 = new ThucUong("Coffe", 15000, "Con", "Sang, Toi", "Khong Da");
            ThucDon d5 = new ThucUong("Nuoc Cam", 30000, "Con", "Sang, Trua, Chieu", "Da");

            Ban b1 = new Ban("Trong", 4);
            Ban b2 = new Ban("Trong", 2);
            Ban b3 = new Ban("Trong", 2);
            Ban b4 = new Ban("Day", 4);
            Ban b5 = new Ban("Day", 6);

            List <int> sl1 = new List <int>(new List <int> {
                1, 2, 3
            });
            List <int> sl2 = new List <int>(new List <int> {
                2, 1, 3
            });
            List <int> sl3 = new List <int>(new List <int> {
                1, 4
            });
            List <ThucDon> td1 = new List <ThucDon>(new List <ThucDon> {
                f1, f4, d5
            });
            List <ThucDon> td2 = new List <ThucDon>(new List <ThucDon> {
                f2, f1, d5
            });
            List <ThucDon> td3 = new List <ThucDon>(new List <ThucDon> {
                d5, f3
            });
            HoaDon hd1 = new HoaDon("2", td1, sl1, b2, "05/01/2021", "Trua", 100000);
            HoaDon hd2 = new HoaDon("3", td2, sl2, b1, "07/05/2021", "Sang", 500000);
            HoaDon hd3 = new HoaDon("3", td3, sl3, b3, "05/09/2021", "Sang", 200000);

            // QuanLiNhanVien.MenuQuanLiNhanVien();
            // QuanLiThucDon.MenuQuanLiThucDon();
            // QuanLiHoaDon.MenuQuanLiHoaDon();
            // QuanLiBan.MenuQuanLiBan();
            // QuanLiBoPhan.MenuQuanLiBoPhan();
            QuanLiQuan.MenuQuanLiQuanCaPhe();
        }
コード例 #4
0
        public static void MenuQuanLiHoaDon()
        {
            int chon;

            do
            {
                Console.WriteLine("\t\t\t |===============================Quan Li Hoa Don===============================|\n");
                Console.WriteLine("\t\t\t |                            0. Quay Lai                                      |\n");
                Console.WriteLine("\t\t\t |                            1. Danh Sach Hoa Don                             |\n");
                Console.WriteLine("\t\t\t |                            2. Doanh Thu                                     |\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 {
                    switch (chon)
                    {
                    case 0:
                        QuanLiQuan.MenuQuanLiQuanCaPhe();
                        break;

                    case 1:
                        QuanLiHoaDon.DanhSachHoaDon(QuanLiHoaDon.lHoaDon);
                        break;

                    case 2:
                        QuanLiHoaDon.MenuDoanhThu();
                        break;

                    case 3:
                        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 != 3);
        }
コード例 #5
0
        public static void MenuQuanLiBan()
        {
            int chon;

            do
            {
                Console.WriteLine("\t\t\t |=================================Quan Li Ban=================================|\n");
                Console.WriteLine("\t\t\t |                            0. Quay Lai                                      |\n");
                Console.WriteLine("\t\t\t |                            1. Danh Sach Ban                                 |\n");
                Console.WriteLine("\t\t\t |                            2. Dat Ban                                       |\n");
                Console.WriteLine("\t\t\t |                            3. Them Ban                                      |\n");
                Console.WriteLine("\t\t\t |                            4. Xoa Ban                                       |\n");
                Console.WriteLine("\t\t\t |                            5. Cap Nhat Thong Tin Ban                        |\n");
                Console.WriteLine("\t\t\t |                            6. Xem Hoa Hon                                   |\n");
                Console.WriteLine("\t\t\t |                            7. Thoat                                         |\n");
                Console.WriteLine("\t\t\t |===================================CHOOSE====================================|\n");
                Console.WriteLine("Ban Chon: ");
                chon = int.Parse(Console.ReadLine());
                try {
                    switch (chon)
                    {
                    case 0:
                        QuanLiQuan.MenuQuanLiQuanCaPhe();
                        break;

                    case 1:
                        Console.WriteLine("\t\t\t ---------------------------------Danh Sach Ban---------------------------------\n");
                        Console.WriteLine("\t\t\t Ma Ban                          | Tinh Trang                         | Suc Chua");
                        Console.WriteLine("\t\t\t -------------------------------------------------------------------------------");
                        QuanLiBan.DSBan.ForEach(x => x.HienThi());
                        break;

                    case 2:
                        QuanLiBan.DatBan();
                        break;

                    case 3:
                        QuanLiBan.ThemBan();
                        break;

                    case 4:
                        QuanLiBan.XoaBan();
                        break;

                    case 5:
                        QuanLiBan.MenuCapNhat();
                        break;

                    case 6:
                        string mhd;
                        Console.WriteLine("Ma Hoa Don:  ");
                        mhd = Console.ReadLine();
                        HoaDon hd = QuanLiHoaDon.DSHoaDon.Find(x => x.MaHoaDon == mhd);
                        if (hd != null)
                        {
                            Console.WriteLine($"\t\t\t ----------------------------------Hoa Don So {mhd}---------------------------------\n");
                            hd.HoaDonChoKhach();
                        }
                        break;

                    case 7:
                        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 != 6);
        }