private void toolStripButton1_Click(object sender, EventArgs e) { this.Hide(); EmployeeScreencs form = new EmployeeScreencs(); form.Show(); }
private void button4_Click(object sender, EventArgs e) { bool isganeshcorrect = false, isUsernamecorrect = false, isPasswordcorrect = false, isRolecorrect = false; ISvaluecorrect(textBox1.Text, textBox2.Text, comboBox1.Text, ref isganeshcorrect, ref isUsernamecorrect, ref isPasswordcorrect, ref isRolecorrect); if (isganeshcorrect) { LoggedInUser.Username = textBox1.Text; if (comboBox1.SelectedIndex == 1) { this.Hide(); textBox3.Text = "you are login as employee"; SpeechSynthesizer synth = new SpeechSynthesizer(); synth.Speak(textBox3.Text); EmployeeScreencs form = new EmployeeScreencs(); form.Show(); } else { this.Hide(); textBox3.Text = "you are login as Owner"; OwnerForm form = new OwnerForm(); form.Show(); SpeechSynthesizer synth = new SpeechSynthesizer(); synth.Speak(textBox3.Text); } } else { if (!isUsernamecorrect) { MessageBox.Show("No such user found", "Wrong user", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (!isPasswordcorrect & isRolecorrect) { MessageBox.Show("Password is worng", "wrong password", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (!isPasswordcorrect & !isRolecorrect) { MessageBox.Show("Both password and role are wrong", "wrong password and role", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (!isRolecorrect & isPasswordcorrect) { MessageBox.Show("Role is not associated with user", "wrong role", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }