Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtUserID.Text))
            {
                MessageBox.Show("UserID Field is empty, Please Check!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUserID.Focus();
                return;
            }

            try
            {
                AppDataTableAdapters.loginTableAdapter login = new AppDataTableAdapters.loginTableAdapter();
                AppData.loginDataTable dt = login.login(txtUserID.Text, txtPass.Text);
                if (dt.Rows.Count > 0)
                {                    
                    Dashboard d = new Dashboard();
                    d.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Access Denied", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            
        }
Example #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Dashboard d = new Dashboard();
            d.Show();
            this.Hide();
            

        }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     DialogResult result2 = MessageBox.Show("Are you sure you want to quit?", "Confirmation", MessageBoxButtons.YesNo);
     if (result2 == DialogResult.Yes)
     {
         Application.Exit();
     }
     else
     {
         Dashboard d2 = new Dashboard();
         d2.Show();
         this.Close();
     }
 }
Example #4
0
 private void bckButton_Click(object sender, EventArgs e)
 {
     DialogResult result = MessageBox.Show("Do you really want to go back?", "Confirmation", MessageBoxButtons.YesNoCancel);
     if (result == DialogResult.Yes)
     {
         Login l = new Login();
         l.Show();
         this.Close();
     }
     else
     {
         Dashboard d = new Dashboard();
         d.Show();
         this.Close();
     }
 }