protected override void OnWizardClosed(DialogResult result)
 {
     if(result == DialogResult.OK)
     {
         var command = new UpdateProjectHardwareCommand(
             hardware.ProjectId,
             hardware.Id,
             this.editHardwarePage.TypedPage.Milestone,
             this.editHardwarePage.TypedPage.HardwareTasks);
         this.EventBroker.Publish(command, Topics.COMMANDS);
     }
 }
Пример #2
0
        public void ProcessAction(UpdateProjectHardwareCommand eventObject)
        {
            var project = this.projectRepository.FindById(eventObject.ProjectId);
            var projectHardware = project.Hardwares.Where(x => x.Id == eventObject.Id).First();

            Mapper.CreateMap<UpdateProjectHardwareCommand, ProjectHardware>();

            Mapper.Map(eventObject, projectHardware);

            this.projectRepository.Save(project);

            this.eventBroker.Publish(new ProjectHardwareUpdatedEvent(project.Id, projectHardware.Id), Topics.EVENTS);
        }