/// <summary> /// Converts this instance of <see cref="adolescente"/> to an instance of <see cref="adolescenteDto"/>. /// </summary> /// <param name="entity"><see cref="adolescente"/> to convert.</param> public static adolescenteDto ToDTO(this adolescente entity) { if (entity == null) { return(null); } var dto = new adolescenteDto(); dto.v_AdolescenteId = entity.v_AdolescenteId; dto.v_PersonId = entity.v_PersonId; dto.v_EdadInicioTrabajo = entity.v_EdadInicioTrabajo; dto.v_TipoTrabajo = entity.v_TipoTrabajo; dto.v_NroHorasTv = entity.v_NroHorasTv; dto.v_NroHorasJuegos = entity.v_NroHorasJuegos; dto.v_MenarquiaEspermarquia = entity.v_MenarquiaEspermarquia; dto.v_EdadInicioRS = entity.v_EdadInicioRS; dto.i_IsDeleted = entity.i_IsDeleted; dto.i_InsertUserId = entity.i_InsertUserId; dto.d_InsertDate = entity.d_InsertDate; dto.i_UpdateUserId = entity.i_UpdateUserId; dto.d_UpdateDate = entity.d_UpdateDate; dto.v_NombreCuidador = entity.v_NombreCuidador; dto.v_EdadCuidador = entity.v_EdadCuidador; dto.v_DniCuidador = entity.v_DniCuidador; dto.v_ViveCon = entity.v_ViveCon; dto.v_Observaciones = entity.v_Observaciones; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="adolescenteDto"/> to an instance of <see cref="adolescente"/>. /// </summary> /// <param name="dto"><see cref="adolescenteDto"/> to convert.</param> public static adolescente ToEntity(this adolescenteDto dto) { if (dto == null) { return(null); } var entity = new adolescente(); entity.v_AdolescenteId = dto.v_AdolescenteId; entity.v_PersonId = dto.v_PersonId; entity.v_EdadInicioTrabajo = dto.v_EdadInicioTrabajo; entity.v_TipoTrabajo = dto.v_TipoTrabajo; entity.v_NroHorasTv = dto.v_NroHorasTv; entity.v_NroHorasJuegos = dto.v_NroHorasJuegos; entity.v_MenarquiaEspermarquia = dto.v_MenarquiaEspermarquia; entity.v_EdadInicioRS = dto.v_EdadInicioRS; entity.i_IsDeleted = dto.i_IsDeleted; entity.i_InsertUserId = dto.i_InsertUserId; entity.d_InsertDate = dto.d_InsertDate; entity.i_UpdateUserId = dto.i_UpdateUserId; entity.d_UpdateDate = dto.d_UpdateDate; entity.v_NombreCuidador = dto.v_NombreCuidador; entity.v_EdadCuidador = dto.v_EdadCuidador; entity.v_DniCuidador = dto.v_DniCuidador; entity.v_ViveCon = dto.v_ViveCon; entity.v_Observaciones = dto.v_Observaciones; dto.OnEntity(entity); return(entity); }
public string AddAdolescente(ref OperationResult objOperationResult, adolescenteDto objAdolDto, List <string> ClientSession) { string NewId0 = null; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); adolescente objEntity = adolescenteAssembler.ToEntity(objAdolDto); objEntity.d_InsertDate = DateTime.Now; objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]); objEntity.i_IsDeleted = 0; int intNodeId = int.Parse(ClientSession[0]); NewId0 = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 353), "JO");; objEntity.v_AdolescenteId = NewId0; dbContext.AddToadolescente(objEntity); dbContext.SaveChanges(); objOperationResult.Success = 1; LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "JO", "v_AdolescenteId=" + NewId0.ToString(), Success.Ok, null); } catch (Exception ex) { objOperationResult.Success = 0; objOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "JO", "v_AdolescenteId=" + NewId0.ToString(), Success.Failed, objOperationResult.ExceptionMessage); } return(NewId0); }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="adolescente"/> converted from <see cref="adolescenteDto"/>.</param> static partial void OnEntity(this adolescenteDto dto, adolescente entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="adolescenteDto"/> converted from <see cref="adolescente"/>.</param> static partial void OnDTO(this adolescente entity, adolescenteDto dto);