Exemplo n.º 1
0
        public void Sua()
        {
            Hien();
            Console.WriteLine("SUA THONG TIN KHACH HANG");
            List <Khachhang> list = khBLL.GetAllKhachHang();
            string           makhachhang;

            Console.Write("Nhap ma khach hang can sua:");
            makhachhang = Console.ReadLine();
            int i = 0;

            for (i = 0; i < list.Count; ++i)
            {
                if (list[i].MaKhach == makhachhang)
                {
                    break;
                }
            }

            if (i < list.Count)
            {
                Khachhang kh = new Khachhang(list[i]);
                Console.Write("Nhap ma khach hang moi:");
                string ma = Console.ReadLine();
                if (!string.IsNullOrEmpty(ma))
                {
                    kh.MaKhach = ma;
                }
                Console.Write("Nhap ho ten khach hang moi:");
                string ten = Console.ReadLine();
                if (!string.IsNullOrEmpty(ten))
                {
                    kh.Hoten = ten;
                }
                Console.Write("Nhap que quan moi :");
                string que = Console.ReadLine();
                if (!string.IsNullOrEmpty(que))
                {
                    kh.QueQuan = que;
                }
                Console.Write("Nhap dia chi moi:");
                string dc = Console.ReadLine();
                if (!string.IsNullOrEmpty(dc))
                {
                    kh.DiaChi = dc;
                }
                Console.Write("Nhap so dien thoai moi:");
                string sdt = Console.ReadLine();
                if (!string.IsNullOrEmpty(sdt))
                {
                    kh.SodienThoai = sdt;
                }
                khBLL.SuaKhachHang(kh, makhachhang);
            }
            else
            {
                Console.WriteLine("Khong ton tai ma khach hang nay");
            }
        }
Exemplo n.º 2
0
        public void Sua()
        {
            Console.Clear();
            Console.SetCursorPosition(13, 5); Console.WriteLine("╔═════════════════════════════════════════════════════════════════════════════════════════╗");
            Console.SetCursorPosition(13, 6); Console.WriteLine("║                                  Sửa Thông Tin Khách Hàng                               ║");
            Console.SetCursorPosition(13, 7); Console.WriteLine("╠═════════════════════════════════════════════════════════════════════════════════════════╣");
            List <Khachhang> list = KH.GetAllKhachHang();
            string           Masua;

            Console.SetCursorPosition(13, 8);     Console.Write("║ Nhập Mã Khách Hàng Cần Sửa :                                                            ║");
            Console.SetCursorPosition(43, 8);
            Masua = Console.ReadLine();
            int i;

            for (i = 0; i < list.Count; ++i)
            {
                if (list[i].Makh == Masua)
                {
                    break;
                }
            }
            if (i < list.Count)
            {
                Console.SetCursorPosition(13, 9);  Console.WriteLine("║                                  Thông tin khách hàng                                   ║");
                Console.SetCursorPosition(13, 10); Console.WriteLine("╠════════════════════╦═════════════╦═══════════════════════╦═══════════════╦══════════════╣");
                Console.SetCursorPosition(13, 11); Console.WriteLine("║      Ngày Giờ      ║Mã Khách Hàng║    Tên Khách Hàng     ║    Địa Chỉ    ║     SĐT      ║");
                Console.SetCursorPosition(13, 12); Console.WriteLine("╠════════════════════╬═════════════╬═══════════════════════╬═══════════════╬══════════════╣");
                Console.WriteLine("\t     ║" + list[i].Ngaygiokh + "║   " + list[i].Makh + "\t║    " + list[i].Tenkh + "\t║    " + list[i].Diachi + "\t║  " + list[i].SDT + "  ║");
                Console.SetCursorPosition(13, 14); Console.WriteLine("╚════════════════════╩═════════════╩═══════════════════════╩═══════════════╩══════════════╝");
                Khachhang kh = new Khachhang(list[i]);
                Console.SetCursorPosition(13, 16); Console.Write("Nhập Tên Khách Hàng Mới :");
                string ten = Console.ReadLine();
                if (!string.IsNullOrEmpty(ten))
                {
                    kh.Tenkh = ten;
                }
                Console.SetCursorPosition(13, 18); Console.Write("Nhập Địa Chỉ Khách Hàng Mới :");
                string diachi = Console.ReadLine();
                if (!string.IsNullOrEmpty(diachi))
                {
                    kh.Diachi = diachi;
                }
                Console.SetCursorPosition(13, 20); Console.Write("Nhập Số Điện Thoại Mới :");
                string sdt = Console.ReadLine();
                if (!string.IsNullOrEmpty(sdt))
                {
                    kh.SDT = sdt;
                }
                KH.SuaKhachHang(kh);
            }
            else
            {
                Console.SetCursorPosition(13, 15); Console.WriteLine("╚═════════════════════════════════════════════════════════════════════════════════════════╝");
                Console.SetCursorPosition(13, 11); Console.Write("  Không tồn tại mã sản phẩm nay....");
                Console.ReadKey();
            }
        }
Exemplo n.º 3
0
        public void Sua()
        {
            Console.Clear();
            Console.WriteLine("------------------------------SỬA THÔNG TIN KHÁCH HÀNG------------------------------");
            List <KhachHang> list = khBLL.GetAllKhachHang();
            string           makhachhang;

            Console.Write("Nhập mã khách hàng cần sửa:");
            makhachhang = Console.ReadLine();
            int i = 0;

            for (i = 0; i < list.Count; ++i)
            {
                if (list[i].MaKhachHang == makhachhang)
                {
                    break;
                }
            }

            if (i < list.Count)
            {
                KhachHang kh = new KhachHang(list[i]);
                Console.Write("Tên mới:");
                string ten = Console.ReadLine();
                if (!string.IsNullOrEmpty(ten))
                {
                    kh.HoTen = ten;
                }
                Console.Write("Quê quán:");
                string qq = Console.ReadLine();
                if (!string.IsNullOrEmpty(qq))
                {
                    kh.QueQuan = qq;
                }
                Console.Write("Địa chỉ:");
                string dc = Console.ReadLine();
                if (!string.IsNullOrEmpty(dc))
                {
                    kh.DiaChi = dc;
                }
                Console.Write("SĐT:");
                string sdt = Console.ReadLine();
                if (!string.IsNullOrEmpty(sdt))
                {
                    kh.SodienThoai = sdt;
                }
                khBLL.SuaKhachHang(kh);
            }
            else
            {
                Console.WriteLine("                         Không tồn tại mã khách hàng này!!!");
            }
        }
Exemplo n.º 4
0
        public void Sua()
        {
            Console.Clear();
            Console.WriteLine("             THÔNG TIN KHÁCH HÀNG");
            List <KhachHang> list = khBLL.GetAllKhachHang();
            string           makhachhang;

            Console.Write("             Nhập mã khách hàng cần sửa:");
            makhachhang = Console.ReadLine();
            int i;

            for (i = 0; i < list.Count; ++i)
            {
                if (list[i].MaKhach == makhachhang)
                {
                    break;
                }
            }
            if (i < list.Count)
            {
                KhachHang kh = new KhachHang(list[i]);
                Console.Write("            Nhập họ tên khách hàng :");
                string ten = Console.ReadLine();
                if (!string.IsNullOrEmpty(ten))
                {
                    kh.MaKhach = ten;
                }
                Console.Write("             Nhập quê quán :");
                string que = Console.ReadLine();
                if (!string.IsNullOrEmpty(que))
                {
                    kh.QueQuan = que;
                }
                Console.Write("             Nhập địa chỉ :");
                string dc = Console.ReadLine();
                if (!string.IsNullOrEmpty(dc))
                {
                    kh.DiaChi = dc;
                }
                Console.Write("             Nhập số điện thoại:");
                string sdt = Console.ReadLine();
                if (!string.IsNullOrEmpty(sdt))
                {
                    kh.SodienThoai = sdt;
                }
                khBLL.SuaKhachHang(kh);
            }
            else
            {
                Console.WriteLine("Không tồn tại mã khách hàng này");
            }
        }