Exemplo n.º 1
0
        public void NhapThem()
        {
            do
            {
                Console.Write("\tNhập tên khách hàng: ");
                Hoten1 = Console.ReadLine();
            } while (Hoten1.Trim().Length == 0 || Hoten1.Trim().Length > 20);

            do
            {
                Console.Write("\tĐịa chỉ: ");
                Diachi = Console.ReadLine();
            } while (Diachi.Trim().Length == 0 || Diachi.Trim().Length > 10);
            do
            {
                Console.Write("\tSố điện thoại: ");
                SoDt = Console.ReadLine();
            } while (SoDt.Trim().Length == 0 || SoDt.Trim().Length > 11);
            do
            {
                Console.Write("\tSố CMT/CCCD: ");
                soCMT = Console.ReadLine();
            } while (soCMT.Trim().Length == 0 || soCMT.Trim().Length > 10);
            TGmua = DateTime.Now.ToString("dd/MM/yyyy");
            do
            {
                Console.Write("\tSố lần ghé thăm cửa hàng:");
                SoLanGheTham1 = int.Parse(Console.ReadLine());
            } while (SoLanGheTham1 < 1);
        }
Exemplo n.º 2
0
        public void Nhap()
        {
            do
            {
                Console.Write("Nhap ma khach hang: ");
                Makh = Console.ReadLine().Trim();
            } while (Makh.Trim().Length == 0 || Makh.Trim().Length > 10);
            do
            {
                Console.Write("Nhap ten khach hang: ");
                Hoten1 = Console.ReadLine();
            } while (Hoten1.Trim().Length == 0 || Hoten1.Trim().Length > 20);

            do
            {
                Console.Write("Dia chi: ");
                Diachi = Console.ReadLine();
            } while (Diachi.Trim().Length == 0 || Diachi.Trim().Length > 10);
            do
            {
                Console.Write("Nhap so dien thoai: ");
                SoDt = Console.ReadLine();
            } while (SoDt.Trim().Length == 0 || SoDt.Trim().Length > 11);
            do
            {
                Console.Write("Nhap so CMT/CCCD: ");
                soCMT = Console.ReadLine();
            } while (soCMT.Trim().Length == 0 || soCMT.Trim().Length > 10);
            do
            {
                Console.Write("Nhap thoi gian mua: ");
                TGmua = Console.ReadLine().Trim();
            } while (TGmua.Trim().Length == 0 || TGmua.Trim().Length > 10);
            do
            {
                Console.Write("So lan ghe tham cua hang:");
                SoLanGheTham1 = int.Parse(Console.ReadLine());
            } while (SoLanGheTham1 < 1);
        }