protected override int ExecuteWorkImplementation() { var literaryOriginal = m_originalId != null ? m_catalogValueRepository.FindById <LiteraryOriginal>(m_originalId.Value) : new LiteraryOriginal(); if (literaryOriginal == null) { throw new MainServiceException(MainServiceErrorCode.EntityNotFound, "The entity was not found."); } literaryOriginal.Name = m_name; m_catalogValueRepository.Save(literaryOriginal); return(literaryOriginal.Id); }
protected override int ExecuteWorkImplementation() { var keywordEntity = m_keywordId != null ? m_catalogValueRepository.FindById <Keyword>(m_keywordId.Value) : new Keyword(); if (keywordEntity == null) { throw new MainServiceException(MainServiceErrorCode.EntityNotFound, "The entity was not found."); } keywordEntity.Text = m_name; m_catalogValueRepository.Save(keywordEntity); return(keywordEntity.Id); }
protected override int ExecuteWorkImplementation() { var termCategory = m_termCategoryId != null ? m_catalogValueRepository.FindById <TermCategory>(m_termCategoryId.Value) : new TermCategory(); if (termCategory == null) { throw new MainServiceException(MainServiceErrorCode.EntityNotFound, "The entity was not found."); } termCategory.Name = m_data.Name; m_catalogValueRepository.Save(termCategory); return(termCategory.Id); }
protected override int ExecuteWorkImplementation() { var responsibleType = m_responsibleTypeId != null ? m_catalogValueRepository.FindById <ResponsibleType>(m_responsibleTypeId.Value) : new ResponsibleType(); if (responsibleType == null) { throw new MainServiceException(MainServiceErrorCode.EntityNotFound, "The entity was not found."); } var typeEnum = m_mapper.Map <ResponsibleTypeEnum>(m_data.Type); responsibleType.Text = m_data.Text; responsibleType.Type = typeEnum; m_catalogValueRepository.Save(responsibleType); return(responsibleType.Id); }