Beispiel #1
0
        public void Nhap()
        {
            Console.Write("Nhap so nhan vien:"); sonv = int.Parse(Console.ReadLine());
            ds = new Nhanvien[sonv];
            for (int i = 0; i < sonv; i++)
            {
                Console.WriteLine("Ban muon nhap thong tin cho nhan vien quanly(Q), cong nhan{C},san xuat{S}");
                char ch = char.Parse(Console.ReadLine());
                switch (char.ToUpper(ch))
                {
                case 'Q': ds[i] = new NVQL(); ds[i].Nhap(); break;

                case 'C': ds[i] = new NVCN(); ds[i].Nhap(); break;

                case 'S': ds[i] = new NVSX(); ds[i].Nhap(); break;
                }
            }
        }
Beispiel #2
0
        public void Nhap()
        {
            Console.Write("Nhap so nhan vien:");
            snv = int.Parse(Console.ReadLine());
            ds  = new Nhanvien[snv];
            for (int i = 0; i < snv; ++i)
            {
                Console.WriteLine("ban muon nhap thong cho nhan vien quanly(Q),congnhan(C),sanxuat(S)");
                char ch = char.Parse(Console.ReadLine());
                switch (char.ToLower(ch))
                {
                case 'Q': ds[i] = new NVQL(); ds[i].Nhap(); break;

                case 'C': ds[i] = new NVCN(); ds[i].Nhap(); break;

                case 'S': ds[i] = new NVSX(); ds[i].Nhap(); break;
                }
            }
        }