private void button3_Click_1(object sender, EventArgs e) { bunifuMaterialTextbox3.Text = bunifuMaterialTextbox3.Text.Trim(' '); bunifuMaterialTextbox5.Text = bunifuMaterialTextbox5.Text.Trim(' '); try { int e_id = int.Parse(bunifuMaterialTextbox3.Text); bool idflag = emp.CheckId(e_id); if (idflag == true) { object employee = emp.ReturnEmployee(e_id); Data_Access_Layer.Emp_Table user_emp = (Data_Access_Layer.Emp_Table)employee; if (user_emp.Password == bunifuMaterialTextbox5.Text) { if (bunifuCheckbox1.Checked == true) { Settings.Default["U_Name"] = bunifuMaterialTextbox3.Text; Settings.Default["U_Pass"] = bunifuMaterialTextbox5.Text; Settings.Default["Remember"] = true; Settings.Default.Save(); } else { Settings.Default["U_Name"] = null; Settings.Default["U_Pass"] = null; Settings.Default["Remember"] = false; Settings.Default.Save(); } this.Hide(); if (user_emp.Admin == true) { Form8 f8 = new Form8(e_id); this.Hide(); f8.Show(); } else { Form2 f2 = new Form2(e_id); this.Hide(); f2.Show(); } } else { MessageBox.Show("You Entered A Wrong Password"); } } else { MessageBox.Show("You Entered A Wrong Id"); } } catch (Exception x) { MessageBox.Show(x.ToString()); } }