示例#1
0
        //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 !");
            }
        }
示例#2
0
        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;
            }
        }
示例#3
0
        public void getDeptDetailToCmb()
        {
            EmpManger objDataHandler = new EmpManger();

            cmbDeptSF.DataSource = objDataHandler.GetDepartment();

            cmbDeptSF.DisplayMember = "DepartmentName";
            cmbDeptSF.ValueMember   = "DeptID";
            cmbDeptSF.SelectedIndex = -1;
        }
示例#4
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);
        }
示例#5
0
        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);
        }