コード例 #1
0
        public static void Chon(List <NhapKho> list, NhapKho_BLL NhapKho_BLL, NhapKho_DAL NhapKho_DAL)
        {
            int chon;

            while (true)
            {
                Menu();
                chon = int.Parse(Console.ReadLine());
                if (chon == 0)
                {
                    break;
                }
                Console.Clear();

                switch (chon)
                {
                case 1:
                    NhapKho_BLL.NhapNhapKho(list);
                    Console.ReadKey();
                    Console.Clear();
                    NhapKho_DAL.GhiFile(list);
                    break;

                case 2:
                    NhapKho_BLL.HienNhapKho(list);
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case 3: NhapKho_BLL.TimKiem(list);
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case 4:
                    NhapKho_BLL.Sua(list);
                    NhapKho_DAL.GhiFile(list);
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case 5:
                    NhapKho_BLL.Xoa(list);
                    NhapKho_DAL.GhiFile(list);
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case 6:
                    NhapKho_BLL.ThongKeNhap(list);
                    Console.ReadKey();
                    Console.Clear();
                    break;

                default: break;
                }
            }
        }
コード例 #2
0
ファイル: Run.cs プロジェクト: thanhtonvk/QuanLyHangTon
        public static void RunProgram()
        {
            List <SanPham> sanPhams    = new List <SanPham>();
            List <NhapKho> nhapKhos    = new List <NhapKho>();
            List <XuatKho> xuatKhos    = new List <XuatKho>();
            NhapKho_BLL    nhapKho_BLL = new NhapKho_BLL();
            XuatKho_BLL    xuatKho_BLL = new XuatKho_BLL();
            SanPham_BLL    sanPham_BLL = new SanPham_BLL();
            NhapKho_DAL    nhapKho_DAL = new NhapKho_DAL();
            SanPham_DAL    sanPham_DAL = new SanPham_DAL();
            XuatKho_DAL    xuatKho_DAL = new XuatKho_DAL();

            nhapKho_DAL.DocFile(nhapKhos);
            xuatKho_DAL.DocFile(xuatKhos);
            sanPham_DAL.DocFile(sanPhams);
            int chon;

            while (true)
            {
                Menu();
                chon = int.Parse(Console.ReadLine());
                Console.Clear();
                if (chon == 0)
                {
                    break;
                }
                switch (chon)
                {
                case 1:
                    SanPham_GUI.Chon(sanPhams, sanPham_BLL, sanPham_DAL);
                    Console.Clear();
                    break;

                case 2:
                    NhapKho_GUI.Chon(nhapKhos, nhapKho_BLL, nhapKho_DAL);
                    Console.Clear();
                    break;

                case 3:
                    XuatKho_GUI.Chon(xuatKhos, xuatKho_BLL, xuatKho_DAL);
                    Console.Clear();
                    break;

                default: break;
                }
            }
        }