private void btnUpdate_Click(object sender, EventArgs e)
        {
            string gender;
               // UcRegisterEmployee reg = (UserControl)Application.OpenForms["UcRegisterEmployee"];
             //   DataTable dtTable = EmpManager.DisplayEmployeesRecord();
            if(rdoMale.Checked==true)
            {
                gender="Male";
            }
            else
            {
                gender="Female";
            }
            UcRegisterEmployee UcRegEmployee = new UcRegisterEmployee();

            EmployeeProperties.Nationality = txtNationality.Text.Trim();
            EmployeeProperties.Name = txtName.Text.Trim();
            EmployeeProperties.Dob = (DateTime)dtpDOB.Value;
            EmployeeProperties.JoinDate = (DateTime)dtpJoinDate.Value;
            EmployeeProperties.FatherContact = txtContactNumberFather.Text.Trim();
            EmployeeProperties.FatherName = txtFatherName.Text.Trim();
            EmployeeProperties.Gender = gender;
            EmployeeProperties.PermanentAddress = txtPremanentAddress.Text.Trim();
            EmployeeProperties.TemporaryAddress = txtTemporaryAddress.Text.Trim();
            EmployeeProperties.ContactNum = txtContactNumber.Text.Trim();
            if (EmployeeManager.EmployeeUpdates(EmployeeProperties.Id,EmployeeProperties.Name, EmployeeProperties.TemporaryAddress, EmployeeProperties.PermanentAddress
                , EmployeeProperties.ContactNum, EmployeeProperties.Dob, EmployeeProperties.JoinDate, EmployeeProperties.Nationality, EmployeeProperties.FatherName
                , EmployeeProperties.FatherContact, EmployeeProperties.Gender))
            {
                MessageBox.Show("Success");
               // UcRegEmployee.dgvDisplayEmployeeRec.DataSource = dtTable;

            }
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            EmployeeProperties.Name = txtName.Text;//here Name is called from EmployeeProperties.
            string password = txtPassword.Text.Trim();

               // string type = "Admin";
            LoginValidation loginValidation = new LoginValidation();
            DataTable dtTable = new DataTable();
            int id = (int)cboUserType.SelectedValue;
            dtTable = loginValidation.userType(id);
            string type = dtTable.Columns[0].ToString();

            if (loginValidation.ValidateUser(EmployeeProperties.Name, password))
            {
                frmMdiMain MdiMain = new frmMdiMain();
                this.Hide();
                MdiMain.Show();
                if (type == "admin")
                {
                    UcRegisterEmployee EMP = new UcRegisterEmployee();
                    EMP.btnManageEmployee.Enabled = false;
                }

            }
            else
            {
                MessageBox.Show("Name or Password does not match");
            }

                //if (loginValidation.ValidateMainAdmin(EmployeeProperties.Name, password))
                //{
                //    frmMdiMain MdiMain = new frmMdiMain();
                //    this.Hide();
                //    MdiMain.Show();
                //}
                //else

                  //  MessageBox.Show("Something Error");
        }
 private void adminControlToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UcRegisterEmployee registerEmployee = new UcRegisterEmployee();
        // this.panel1.Controls.Add(registerEmployee);
     this.pnlRight.Controls.Add(registerEmployee);
 }