/// <summary> /// Converts this instance of <see cref="softwarecomponentrelease"/> to an instance of <see cref="softwarecomponentreleaseDto"/>. /// </summary> /// <param name="entity"><see cref="softwarecomponentrelease"/> to convert.</param> public static softwarecomponentreleaseDto ToDTO(this softwarecomponentrelease entity) { if (entity == null) { return(null); } var dto = new softwarecomponentreleaseDto(); dto.i_SoftwareComponentId = entity.i_SoftwareComponentId; dto.v_SoftwareComponentVersion = entity.v_SoftwareComponentVersion; dto.i_DeploymentFileId = entity.i_DeploymentFileId; dto.d_ReleaseDate = entity.d_ReleaseDate; dto.v_DatabaseVersionRequired = entity.v_DatabaseVersionRequired; dto.v_ReleaseNotes = entity.v_ReleaseNotes; dto.v_AdditionalInformation1 = entity.v_AdditionalInformation1; dto.v_AdditionalInformation2 = entity.v_AdditionalInformation2; dto.i_IsPublished = entity.i_IsPublished; dto.i_IsLastVersion = entity.i_IsLastVersion; dto.d_InsertDate = entity.d_InsertDate; dto.d_UpdateDate = entity.d_UpdateDate; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="softwarecomponentreleaseDto"/> to an instance of <see cref="softwarecomponentrelease"/>. /// </summary> /// <param name="dto"><see cref="softwarecomponentreleaseDto"/> to convert.</param> public static softwarecomponentrelease ToEntity(this softwarecomponentreleaseDto dto) { if (dto == null) { return(null); } var entity = new softwarecomponentrelease(); entity.i_SoftwareComponentId = dto.i_SoftwareComponentId; entity.v_SoftwareComponentVersion = dto.v_SoftwareComponentVersion; entity.i_DeploymentFileId = dto.i_DeploymentFileId; entity.d_ReleaseDate = dto.d_ReleaseDate; entity.v_DatabaseVersionRequired = dto.v_DatabaseVersionRequired; entity.v_ReleaseNotes = dto.v_ReleaseNotes; entity.v_AdditionalInformation1 = dto.v_AdditionalInformation1; entity.v_AdditionalInformation2 = dto.v_AdditionalInformation2; entity.i_IsPublished = dto.i_IsPublished; entity.i_IsLastVersion = dto.i_IsLastVersion; entity.d_InsertDate = dto.d_InsertDate; entity.d_UpdateDate = dto.d_UpdateDate; dto.OnEntity(entity); return(entity); }
public void AddSoftwareComponentRelease(ref OperationResult pobjOperationResult, softwarecomponentreleaseDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); softwarecomponentrelease objEntity = softwarecomponentreleaseAssembler.ToEntity(pobjDtoEntity); objEntity.d_InsertDate = DateTime.Now; dbContext.AddTosoftwarecomponentrelease(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + objEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + objEntity.v_SoftwareComponentVersion, Success.Ok, null); return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = ex.Message; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + pobjDtoEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + pobjDtoEntity.v_SoftwareComponentVersion, Success.Failed, ex.Message); return; } }
public void UpdateSoftwareComponentRelease(ref OperationResult pobjOperationResult, softwarecomponentreleaseDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); // Obtener la entidad fuente var objEntitySource = (from a in dbContext.softwarecomponentrelease where a.i_SoftwareComponentId == pobjDtoEntity.i_SoftwareComponentId && a.v_SoftwareComponentVersion == pobjDtoEntity.v_SoftwareComponentVersion select a).FirstOrDefault(); // Crear la entidad con los datos actualizados pobjDtoEntity.d_UpdateDate = DateTime.Now; softwarecomponentrelease objEntity = softwarecomponentreleaseAssembler.ToEntity(pobjDtoEntity); // Copiar los valores desde la entidad actualizada a la Entidad Fuente dbContext.softwarecomponentrelease.ApplyCurrentValues(objEntity); // Guardar los cambios dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + objEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + objEntity.v_SoftwareComponentVersion, Success.Ok, null); return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = ex.Message; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + pobjDtoEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + pobjDtoEntity.v_SoftwareComponentVersion, Success.Failed, ex.Message); return; } }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="softwarecomponentrelease"/> converted from <see cref="softwarecomponentreleaseDto"/>.</param> static partial void OnEntity(this softwarecomponentreleaseDto dto, softwarecomponentrelease entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="softwarecomponentreleaseDto"/> converted from <see cref="softwarecomponentrelease"/>.</param> static partial void OnDTO(this softwarecomponentrelease entity, softwarecomponentreleaseDto dto);