예제 #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (txbUserName.Text == "" || txbPassWord.Text == "")
            {
                MessageBox.Show("Vui lòng điền đầy đủ tên đăng nhập và mật khẩu!", "Đăng nhập thất bại", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    if (checkLogin(userName, passWord))
                    {
                        Account loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);

                        fTableManager fT = new fTableManager(loginAccount);
                        this.Hide();
                        fT.ShowDialog();
                        this.Show();
                    }
                    else
                    {
                        MessageBox.Show("Sai Tên đăng nhập hoặc Mật khẩu!", "Đăng nhập thất bại", MessageBoxButtons.OK);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Sai Tên đăng nhập hoặc Mật khẩu!", "Đăng nhập thất bại", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            fTableManager fTableManager = new fTableManager();

            this.Hide();
            fTableManager.ShowDialog();
            this.Show();
        }
예제 #3
0
        private void button13_Click(object sender, EventArgs e)
        {
            fTableManager f = new fTableManager();

            this.Hide();
            f.ShowDialog();
            this.Show();
        }
예제 #4
0
 private void btDangNhap_Click(object sender, EventArgs e)
 {
     if (txbDangNhap.Text.CompareTo("admin") == 0 && txbMatKhau.Text.CompareTo("123456") == 0)
     {
         fTableManager f = new fTableManager();
         this.Hide();
         f.ShowDialog();
         this.Show();
     }
     else
     {
         MessageBox.Show("Tài khoãn hoặc mật khẩu không đúng");
     }
 }
예제 #5
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (Login(txtUserName.Text, txtPassWord.Text))
     {
         fTableManager newF = new fTableManager();
         this.Hide();
         newF.ShowDialog();
         this.Show();
     }
     else
     {
         MessageBox.Show("Đăng nhâp thất bại");
     }
 }
예제 #6
0
 void PreLoadAllForms()
 {
     frmMain           = this;
     frmLogin          = new fLogin();
     frmAccount        = new fAccount();
     frmAccountInfo    = new fAccountInfo();
     frmChangePassword = new fChangePassword();
     frmFood           = new fFood();
     frmFoodCategory   = new fFoodCategory();
     frmRevenue        = new fRevenue();
     frmTableFood      = new fTableFood();
     frmTableManager   = new fTableManager();
     frmTutorial       = new fTutorial();
     frmSoftwareInfo   = new fSoftwareInfo();
 }
예제 #7
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (Login(userName, passWord))
            {
                fTableManager f = new fTableManager();
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!");
            }
        }
예제 #8
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (AccountDAO.Instance.Login(txtUserName.Text, txtPassWord.Text))
            {
                Account currentAccount = AccountDAO.Instance.GetAccountByUserName(txtUserName.Text)[0];

                this.Visible = false;
                fTableManager fTableManager = new fTableManager(currentAccount);
                fTableManager.StartPosition = FormStartPosition.CenterScreen;
                fTableManager.ShowDialog();
                this.Visible = true;
            }
            else
            {
                MessageBox.Show("Wrong Username or Password");
            }
        }
예제 #9
0
파일: fLogin.cs 프로젝트: qtrinh128/CSharp
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string passWord = txtPassword.Text.Trim();

            if (checkLogin(userName, passWord))
            {
                Account       loginAcc     = AccountDAO.Instance.getAccountByUsername(userName);
                fTableManager tableManager = new fTableManager(loginAcc);
                this.Hide();
                tableManager.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Đăng nhập không thành công", "Thông báo");
            }
        }
예제 #10
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassword.Text;

            if (AccountDAO.Instance.Login(userName, passWord))
            {
                Account       account = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f       = new fTableManager(account);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Wrong Password or Username!");
            }
        }
예제 #11
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (Login(userName, passWord))
            {
                Account       loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tài khoản hoặc mật khẩu!");
            }
        }
예제 #12
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            string userName = this.textBoxUserName.Text;
            string passWord = this.textBoxPassword.Text;

            if (login(userName, passWord))
            {
                Account       account      = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager tableManager = new fTableManager(account);
                this.Hide();
                tableManager.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("sai tên tài khoản hoặc mật khẩu");
            }
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = this.txtUserName.Text;
            string passWord = this.txtPassWord.Text;

            if (Login(userName, passWord))
            {
                Account       loginAcc = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f        = new fTableManager(loginAcc);
                this.Hide();    // ẩn form hiện tại (fLogin)
                f.ShowDialog(); // Hiển thi form ftableManager
                this.Show();    // Sau khi tắt fTableManager hiển thị fLogin lên
            }
            else
            {
                MessageBox.Show("Tên tài khoản hoặc mật khẩu không đúng!");
            }
        }
예제 #14
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text;
            string passWord = txtPassWord.Text;

            if (Login(userName, passWord))
            {
                AccountDTO    accountLogin = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager tableManager = new fTableManager(accountLogin);
                this.Hide();
                tableManager.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tài khoản hoặc mật khẩu!", "Lỗi đăng nhập", MessageBoxButtons.OK);
            }
        }
예제 #15
0
        private void btnLogin_Click_1(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (Login(userName, passWord))
            {
                Account       loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #16
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (Login(userName, passWord))
            {
                Account       loginAccount = AccountDAO.Instance.getAccountByUserName(userName);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Đăng nhập không thành công, kiểm tra tên đăng nhập và mật khẩu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #17
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txtUsername.Text;
            string passWord = txtPassword.Text;

            if (Login(userName, passWord))
            {
                Account       loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!", "Thông báo");
            }
        }
예제 #18
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (checkLogin(userName, passWord))
            {
                Account loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);

                fTableManager fT = new fTableManager(loginAccount);
                this.Hide();
                fT.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai Tên đăng nhập hoặc Mật khẩu!", "Đăng nhập thất bại", MessageBoxButtons.OK);
            }
        }
예제 #19
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string username = txbUser.Text;
            string password = txbPassword.Text;

            if (Login(username, password))
            {
                Account       loginAccount = UserAccount.Instance.GetAccountByUserNamae(username);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
                txbPassword.Text = null;
            }
            else
            {
                MessageBox.Show("Sai tài khoản mật khẩu");
            }
        }
예제 #20
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUsername.Text;
            string passWord = txbPassword.Text;

            if (Login(userName, passWord))
            {
                IAccount loginAccount = listAcc.Where(x => x.UserName == userName).SingleOrDefault();

                fTableManager f = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!");
            }
        }
예제 #21
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txbUserName.Text;
            string passWord = txbPassWord.Text;

            if (userName.Equals("") || passWord.Equals(""))
            {
                MessageBox.Show("Vui lòng điền thông tin");
            }
            else if (Login(userName, passWord))
            {
                Account       loginAccount = AccountDAO.Instance.GetAccountByUserName(userName);
                fTableManager f            = new fTableManager(loginAccount);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!");
            }
        }