Ejemplo n.º 1
0
        public void ProcessAction(UpdateProjectCommand eventObject)
        {
            var project = this.projectRepository.FindById(eventObject.ProjectId);

            Mapper.CreateMap<UpdateProjectCommand, Project>();

            Mapper.Map(eventObject, project);

            this.projectRepository.Save(project);

            this.eventBroker.Publish(new ProjectUpdatedEvent(project.Id), Topics.EVENTS);
        }
Ejemplo n.º 2
0
        public void ProcessAction(SaveAction eventObject)
        {
            var viewModel = this.projectView.GetProjectViewModel();

            if (viewModel != null)
            {
                var command = new UpdateProjectCommand(
                    viewModel.Id,
                    viewModel.Name,
                    viewModel.Comment,
                    viewModel.Reference,
                    viewModel.StartDate,
                    viewModel.EndDate,
                    viewModel.Tasks,
                    viewModel.OtherBenefits);

                this.OnUpdateProjectCommand(command);
            }
        }