Example #1
0
        public void Update()
        {
            DSNhaCungCap n = new DSNhaCungCap();

            n.Show();
            string mancc;

            do
            {
                Console.Write("\n\t\tNhập mã nhà cung cấp cần sửa: ");
                mancc = Console.ReadLine();
                mancc = mancc.ToUpper();
                if (mancc.Length == 0)
                {
                    Console.WriteLine("Nhập lại!!!");
                }
            } while (mancc.Length == 0);
            if (TimNhaCungCap(mancc) != null)
            {
                TimNhaCungCap(mancc).NhapThem();
                GhiTep();
                Console.WriteLine("Update successfully !!!");
                Console.WriteLine();
                Console.WriteLine("Nhân viên sau khi update xong: ");
                Console.WriteLine();
                TimNhaCungCap(mancc).Show();
            }
            else
            {
                Console.WriteLine("Không tìm thấy nhà cung cấp cần sửa !!!");
            }
        }
Example #2
0
        public void Delete()
        {
            DSNhaCungCap n = new DSNhaCungCap();

            n.Show();
            string maNcc;

            do
            {
                Console.Write("\n\t\tNhập mã nhà cung cấp muốn xóa: ");
                maNcc = Console.ReadLine();
                maNcc = maNcc.ToUpper();
                if (maNcc.Length == 0)
                {
                    Console.WriteLine("Mời nhập lại !");
                }
            } while (maNcc.Length == 0);
            if (TimNhaCungCap(maNcc) != null)
            {
                dsnhacc.Remove(TimNhaCungCap(maNcc));
                deleteTXT(maNcc);
                Console.WriteLine();
                Console.WriteLine("Xóa Thành Công !");
            }
            else
            {
                Console.WriteLine("Không tìm thấy nhà cung cấp cần xóa !");
            }
        }
Example #3
0
        public void Add()
        {
            NhaCungCap   t = new NhaCungCap();
            DSNhaCungCap n = new DSNhaCungCap();

            n.Readfile();
            n.Show();
            do
            {
                Console.Write("\n\t\tNhập mã nhân viên cần thêm: ");
                t.MaNCC1 = Console.ReadLine();
                t.MaNCC1 = t.MaNCC1.ToUpper();
                if (t.MaNCC1.Length == 0)
                {
                    Console.WriteLine("Nhập lại: ");
                }
            } while (t.MaNCC1.Length == 0);
            if (n.KTMa(t.MaNCC1))
            {
                Console.WriteLine("Mã nhân viên đã tồn tại! Nhập lại");
            }
            else
            {
                t.NhapThem();
                n.ktADD(t.MaNCC1, t.TenNCC1, t.Diachi1, t.Email1, t.SoDT1);
                Console.WriteLine("Add Successfully !!!");
            }
        }