private void btn_Close_Click(object sender, EventArgs e) { Emp_Management_MDIParent ad = new Emp_Management_MDIParent(); ad.Show(); this.Hide(); }
private void btn_Login_Click(object sender, EventArgs e) { Con_Open(); SqlCommand Cmd = new SqlCommand("Select Count(*) from Login where Username = '******' And Password = '******' ", Con); int Cnt = Convert.ToInt32(Cmd.ExecuteScalar()); if (Cnt > 0) { MessageBox.Show("Login Sucessful !!!!", "Sucess", MessageBoxButtons.OK, MessageBoxIcon.Information); Global_Vars.Username = "******" + tb_Username.Text; Emp_Management_MDIParent MM = new Emp_Management_MDIParent(); MM.Show(); this.Hide(); } else { MessageBox.Show("Please Enter Valid Username && Password", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); tb_Username.Clear(); tb_Password.Clear(); tb_Username.Focus(); tb_Password.Enabled = false; btn_Login.Enabled = false; } Con_Close(); }