示例#1
0
        public void Login()
        {
            Program.currentLoggedInAccount = null;
            Console.Clear();
            Console.WriteLine("Tiến hành đăng nhập hệ thống SHB.");
            // Yêu cầu nhập username, password.
            Console.WriteLine("Vui lòng nhập usename: ");
            var username = Console.ReadLine();

            Console.WriteLine("Vui lòng nhập mật khẩu: ");
            var password = Console.ReadLine();
            // gọi đến model kiểm, nếu model trả về null thì báo đăng nhập sai.
            var shbAccount = SHBAccountModel.FindByUsernameandPassword(username, password);

            if (shbAccount == null)
            {
                Console.WriteLine("Sai thông tin tài khoản, vui lòng đăng nhập lại.");
                Console.WriteLine("Ấn phím bất kỳ để tiếp tục.");
                Console.ReadLine();
                return;
            }

            // trong trường hợp trả về khác null.
            // set giá trị vào biến currentLoggedInAccount.
            Program.currentLoggedInAccount = shbAccount;
        }
示例#2
0
 public GiaoDichSHB()
 {
     shbAccountModel = new SHBAccountModel();
 }
示例#3
0
 public SHB()
 {
     shbAccountModel = new SHBAccountModel();
 }