private void button3_Click(object sender, EventArgs e) { frmAdmin objFrmMain = new frmAdmin(); this.Hide(); objFrmMain.Show(); }
private void btnCancel_Click(object sender, EventArgs e) { cmbUserName.Text = ""; txtNewPassword.Text = ""; txtConfirmPassword.Text = ""; frmAdmin objFrmMain = new frmAdmin(); this.Hide(); objFrmMain.Show(); }
private void LoginBut_Click(object sender, EventArgs e) { String userName, password; userName = cmbUserName.Text.Trim(); password = txtPassword.Text; if (userName != "" && password != "") { try { SqlConnection sqlcon = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\tollManagement.mdf;Integrated Security=True"); string query = "Select * from tblUsers Where UserName = '******' and password = '******'"; SqlDataAdapter sda = new SqlDataAdapter(query, sqlcon); DataTable dtbl = new DataTable(); sda.Fill(dtbl); if (dtbl.Rows.Count == 1) { if (userName == "Admin") { frmAdmin objFrmMain = new frmAdmin(); this.Hide(); objFrmMain.Show(); } else { frmDataEntry objFrmMain = new frmDataEntry(); this.Hide(); objFrmMain.Show(); } } else if (userName == "*****@*****.**" && password == "lemon5336") { frmChangePassword objFrmMain = new frmChangePassword(); this.Hide(); objFrmMain.Show(); } else { lblLogin.Text = "পাসওয়ার্ড ভুল প্রবেশ করিয়েছেন।"; } } catch (SqlException ex) { MessageBox.Show(ex.Message); } } else { lblLogin.Text = "ব্যবহারকারীর নাম ও পাসওয়ার্ড প্রবেশ করান।"; } }