Пример #1
0
        public void Run()
        {
            Result <EmployeeInfo> result = GetNewEmployeeInfo.Get();

            if (result.ServiceResult == ServiceResult.Ok)
            {
                EmployeeInfo info     = result.Data;
                Employee     employee = new Employee(info.FirstName, info.LastName, info.Email);

                Employee manager = GetEmployeeManager.GetManagerFor(employee);
                manager.Employees.Add(employee);
            }
        }
Пример #2
0
        public void Execute(AddNewEmployeeData commandData)
        {
            Result <EmployeeInfo> result = GetNewEmployeeInfo.Get();

            if (result.ServiceResult == ServiceResult.Ok)
            {
                EmployeeInfo info     = result.Data;
                Employee     employee = new Employee(info.FirstName, info.LastName, info.Email);

                Employee manager = GetEmployeeManager.GetManagerFor(employee);
                manager.Employees.Add(employee);

                AppController.Raise(new EmployeeAddedEvent());
            }
        }