コード例 #1
0
        public void UpdateEmployee(Employee employee)
        {
            Security secure = new Security();

            employee.Password = secure.HashSHA1(employee.Password);

            DataAccessEmployee dal = new DataAccessEmployee();

            dal.UpdateEmployee(employee);
        }
コード例 #2
0
        public EmployeeOperations(IEmployeeView view, DataAccessEmployee employeeData)
        {
            this.view         = view;
            this.employeeData = employeeData;

            var employee = employeeData.RetrieveEmployee();

            this.view.LoadEmployee(employee);


            view.Add += () =>
            {
                var            e  = view.AddEmployee();
                UserOperations bl = new UserOperations();
                employeeData.AddEmployee(e);
            };

            view.Delete += () =>
            {
                var            e  = view.DeleteEmployee();
                UserOperations bl = new UserOperations();
                employeeData.DeleteEmployee(e);
            };

            view.Ret += () =>
            {
                var empList = employeeData.RetrieveEmployee();
                this.view.LoadEmployee(empList);
            };

            view.Updatee += () =>
            {
                var            e  = view.UpdateEmployee();
                UserOperations bl = new UserOperations();
                employeeData.UpdateEmployee(e);
            };
        }