//public void giveLoginAccess() //{ // DataHandler objDataHandler = new DataHandler(); // //DataTable loginTable = new DataTable(); // List<Employee> lstEmployee = new List<Employee>(); // lstEmployee = objDataHandler.GetLoginDetails(); // List<Employee> lstEmployeeFiltered = new List<Employee>(); // lstEmployeeFiltered = (from lstt in lstEmployee // where lstt.EmpName.Equals(textBoxUserNameLF.ToString().Trim()) && lstt.Password.Equals(textBoxPasswordLF.Text.Trim().ToString()) // select lstt).ToList(); // if(lstEmployeeFiltered.Count()> 0) // { // MessageBox.Show("Done"); // } // else // { // MessageBox.Show("Failed"); // } //} public void login() { bool x; userLogin objuserLogin = new userLogin(); objuserLogin.userName = txtuserName.Text.ToString(); objuserLogin.Password = txtPassword.Text.ToString(); EmpManger obj = new EmpManger(); x = obj.Login(objuserLogin); if (x == true) { MessageBox.Show("login succesful !"); userName = txtuserName.Text.ToString(); SystemForm objSystemForm = new SystemForm(userName); objSystemForm.Show(); this.Hide(); } else { MessageBox.Show("login fail !"); } }
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; } }
public void getDeptDetailToCmb() { EmpManger objDataHandler = new EmpManger(); cmbDeptSF.DataSource = objDataHandler.GetDepartment(); cmbDeptSF.DisplayMember = "DepartmentName"; cmbDeptSF.ValueMember = "DeptID"; cmbDeptSF.SelectedIndex = -1; }
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); }
public List <EmployeeVewModel> GetEmployeeviewModel() { EmpManger em = new EmpManger(); List <Employee> lstEmoployee = new List <Employee>(); lstEmoployee = em.GetEmployee(); List <EmployeeVewModel> lstEmpoloyeeViewModel = new List <EmployeeVewModel>(); EmployeeVewModel ObjEmployeeVewModel = null; foreach (var item in lstEmoployee) { ObjEmployeeVewModel = new EmployeeVewModel(); ObjEmployeeVewModel.EmpID = item.EmpID; ObjEmployeeVewModel.EmpName = item.EmpName; ObjEmployeeVewModel.Designation = item.Designation; ObjEmployeeVewModel.DeptID = item.objDepartment.DeptId; ObjEmployeeVewModel.DepartmentName = item.objDepartment.DepartmentName; lstEmpoloyeeViewModel.Add(ObjEmployeeVewModel); } return(lstEmpoloyeeViewModel); }