private string AddServiceComponentMultimedia(ref OperationResult pobjOperationResult, servicecomponentmultimediaDto pobjDtoEntity, List <string> ClientSession, SiNo ExecLog) { //mon.IsActive = true; string NewId = "(No generado)"; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); servicecomponentmultimedia objEntity = servicecomponentmultimediaAssembler.ToEntity(pobjDtoEntity); objEntity.d_InsertDate = DateTime.Now; objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]); objEntity.i_IsDeleted = 0; // Autogeneramos el Pk de la tabla int intNodeId = 9;// int.Parse(ClientSession[0]); NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 46), "FC"); objEntity.v_ServiceComponentMultimediaId = NewId; dbContext.AddToservicecomponentmultimedia(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; if (ExecLog == SiNo.SI) { // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SERVICE COMPONENT MULTIMEDIA", "v_ServiceComponentMultimediaId=" + NewId.ToString(), Success.Ok, null); } } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SERVICE COMPONENT MULTIMEDIA", "v_ServiceComponentMultimediaId=" + NewId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage); } return(NewId); }
/// <summary> /// Converts this instance of <see cref="servicecomponentmultimedia"/> to an instance of <see cref="servicecomponentmultimediaDto"/>. /// </summary> /// <param name="entity"><see cref="servicecomponentmultimedia"/> to convert.</param> public static servicecomponentmultimediaDto ToDTO(this servicecomponentmultimedia entity) { if (entity == null) return null; var dto = new servicecomponentmultimediaDto(); dto.v_ServiceComponentMultimediaId = entity.v_ServiceComponentMultimediaId; dto.v_ServiceComponentId = entity.v_ServiceComponentId; dto.v_MultimediaFileId = entity.v_MultimediaFileId; dto.v_Comment = entity.v_Comment; 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; entity.OnDTO(dto); return dto; }
/// <summary> /// Converts this instance of <see cref="servicecomponentmultimediaDto"/> to an instance of <see cref="servicecomponentmultimedia"/>. /// </summary> /// <param name="dto"><see cref="servicecomponentmultimediaDto"/> to convert.</param> public static servicecomponentmultimedia ToEntity(this servicecomponentmultimediaDto dto) { if (dto == null) return null; var entity = new servicecomponentmultimedia(); entity.v_ServiceComponentMultimediaId = dto.v_ServiceComponentMultimediaId; entity.v_ServiceComponentId = dto.v_ServiceComponentId; entity.v_MultimediaFileId = dto.v_MultimediaFileId; entity.v_Comment = dto.v_Comment; 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; dto.OnEntity(entity); return entity; }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="servicecomponentmultimedia"/> converted from <see cref="servicecomponentmultimediaDto"/>.</param> static partial void OnEntity(this servicecomponentmultimediaDto dto, servicecomponentmultimedia entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="servicecomponentmultimediaDto"/> converted from <see cref="servicecomponentmultimedia"/>.</param> static partial void OnDTO(this servicecomponentmultimedia entity, servicecomponentmultimediaDto dto);