public void AddOrdenReportes(ref OperationResult pobjOperationResult, List <ordenreporteDto> pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; string NewId = "(No generado)"; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); foreach (var item in pobjDtoEntity) { ordenreporte objEntity = ordenreporteAssembler.ToEntity(item); // Autogeneramos el Pk de la tabla int intNodeId = int.Parse(ClientSession[0]); NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 210), "OZ"); objEntity.v_OrdenReporteId = NewId; dbContext.AddToordenreporte(objEntity); } dbContext.SaveChanges(); pobjOperationResult.Success = 1; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); } }
/// <summary> /// Converts this instance of <see cref="ordenreporte"/> to an instance of <see cref="ordenreporteDto"/>. /// </summary> /// <param name="entity"><see cref="ordenreporte"/> to convert.</param> public static ordenreporteDto ToDTO(this ordenreporte entity) { if (entity == null) { return(null); } var dto = new ordenreporteDto(); dto.v_OrdenReporteId = entity.v_OrdenReporteId; dto.v_OrganizationId = entity.v_OrganizationId; dto.v_NombreReporte = entity.v_NombreReporte; dto.v_ComponenteId = entity.v_ComponenteId; dto.i_Orden = entity.i_Orden; dto.v_NombreCrystal = entity.v_NombreCrystal; dto.i_NombreCrystalId = entity.i_NombreCrystalId; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="ordenreporteDto"/> to an instance of <see cref="ordenreporte"/>. /// </summary> /// <param name="dto"><see cref="ordenreporteDto"/> to convert.</param> public static ordenreporte ToEntity(this ordenreporteDto dto) { if (dto == null) { return(null); } var entity = new ordenreporte(); entity.v_OrdenReporteId = dto.v_OrdenReporteId; entity.v_OrganizationId = dto.v_OrganizationId; entity.v_NombreReporte = dto.v_NombreReporte; entity.v_ComponenteId = dto.v_ComponenteId; entity.i_Orden = dto.i_Orden; entity.v_NombreCrystal = dto.v_NombreCrystal; entity.i_NombreCrystalId = dto.i_NombreCrystalId; dto.OnEntity(entity); return(entity); }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="ordenreporte"/> converted from <see cref="ordenreporteDto"/>.</param> static partial void OnEntity(this ordenreporteDto dto, ordenreporte entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="ordenreporteDto"/> converted from <see cref="ordenreporte"/>.</param> static partial void OnDTO(this ordenreporte entity, ordenreporteDto dto);