Example #1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     ValidateChildren(ValidationConstraints.Enabled);
     if (!string.IsNullOrEmpty(tbUsername.Text))
         if (!string.IsNullOrEmpty(tbPass.Text))
         {
             
             if (LoginCheck())
             {
                 _frmSalesManage f = new _frmSalesManage();
                 this.Hide();
                 f.ShowDialog();
                 this.Show();
             }
             
         }
 }
Example #2
0
        private void tbUsername_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                ValidateChildren(ValidationConstraints.Enabled);
                if (!string.IsNullOrEmpty(tbUsername.Text))
                    if (!string.IsNullOrEmpty(tbPass.Text))
                    {
                       
                        if (LoginCheck())
                        {
                            _frmSalesManage f = new _frmSalesManage();
                            this.Hide();
                            f.ShowDialog();
                            this.Show();
                        }

                    }
            }
        }