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); } }
private void btnLogin_Click(object sender, EventArgs e) { Dashboard d = new Dashboard(); d.Show(); this.Hide(); }
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(); } }
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(); } }