private void btnHome_Click(object sender, EventArgs e) { tblRegistration registration = new tblRegistration(); frmDashboard frmDash = new frmDashboard(roleVp, imageVp, nameVp, mobileVp, emailVp, surnameVp); frmDash.Show(); this.Close(); }
//Function for Searching logged faults. //public ViewResult (string searchString) //{ //} private void btnHome_Click(object sender, EventArgs e) { Image imageVp = null; string roleVp = " "; string nameVp = " "; string emailVp = " "; string mobileVp = " "; string surnameVp = " "; frmDashboard frmD = new frmDashboard(roleVp, imageVp, nameVp, emailVp, mobileVp, surnameVp); this.Hide(); frmD.Show(); }
private void button1_Click(object sender, EventArgs e) { bool test = false; string role = "None"; Image Pic = null; string name = "None"; string email = "None"; string mobile = "None"; string surname = "None"; foreach (var registration in ef.tblRegistrations) { if (registration.Mobile == txtUsername.Text && registration.Password == txtPassword.Text) { test = true; role = registration.UserRole; Pic = byteArrayToImage(registration.images); name = registration.FirstName; mobile = registration.Mobile; email = registration.Email; surname = registration.Surname; } } if (test == true) { this.Hide(); frmDashboard desh = new frmDashboard(role, Pic, name, mobile, email, surname); desh.Show(); lblErrorPassword.Visible = false; txtUsername.Clear(); txtPassword.Clear(); txtUsername.Focus(); } else { lblErrorPassword.Visible = true; // txtUsername.Clear(); txtPassword.Clear(); txtPassword.Focus(); } }