public void getDataFromTxt()
        {
            try
            {
                Employee objEmployee1 = objEmployee1 = new Employee(); //Creating a new object from the Employee class

                objEmployee1.EmpName     = txtUserNameSF.Text.ToString();
                objEmployee1.EmpID       = Convert.ToInt32(txtEmpIDSF.Text);
                objEmployee1.DeptID      = Convert.ToInt32(cmbDeptSF.SelectedValue);
                objEmployee1.Designation = txtEmpDesignationSF.Text;
                bool xx = (1 < 2) ? true : false;



                if (passwordValidation() == true)
                {
                    objEmployee1.Password = txtPasswordConSF.Text.ToString();
                }

                else
                {
                    MessageBox.Show("Please renter your password", "Password confirmation failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPasswordSF.Focus();
                    txtPasswordConSF.Focus();
                }

                EmpManger objDataHandler = new EmpManger();
                objDataHandler.insertEmployee(objEmployee1);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public void getDataFromTxt()
        {
            string   defaultPassword = "******";
            Employee objEmployee1    = objEmployee1 = new Employee();  //Creating a new object from the Employee class

            objEmployee1.EmpName     = txtUserNameSF.Text.ToString();
            objEmployee1.EmpID       = Convert.ToInt32(txtEmpIDSF.Text);
            objEmployee1.DeptID      = Convert.ToInt32(cmbDeptSF.SelectedValue.ToString());
            objEmployee1.Designation = txtEmpDesignationSF.Text.ToString();
            objEmployee1.Password    = defaultPassword.ToString();

            EmpManger objDataHandler = new EmpManger();

            objDataHandler.insertEmployee(objEmployee1);
        }