예제 #1
0
        public void Initialize()
        {
            _departmentItem = new DepartmentSqlDAL(_connectionString);

            _department = new Department();

            _department.Name = "Test Department";

            _department.Id = _departmentItem.CreateDepartment(_department);

            // Initialize a new transaction scope. This automatically begins the transaction.
            tran = new TransactionScope();

            _employeeItem = new EmployeeSqlDAL(_connectionString);

            _employee = new Employee();

            _employee.DepartmentId = _department.Id;
            _employee.FirstName    = "John";
            _employee.LastName     = "Smith";
            _employee.Gender       = "M";
            _employee.JobTitle     = "Developer";
            _employee.BirthDate    = new DateTime(1990, 01, 01);
            _employee.HireDate     = new DateTime(2000, 02, 03);

            _employee.EmployeeId = _employeeItem.CreateEmployee(_employee);
        }