/// <summary> /// Converts this instance of <see cref="blacklistperson"/> to an instance of <see cref="blacklistpersonDto"/>. /// </summary> /// <param name="entity"><see cref="blacklistperson"/> to convert.</param> public static blacklistpersonDto ToDTO(this blacklistperson entity) { if (entity == null) { return(null); } var dto = new blacklistpersonDto(); dto.v_BlackListPerson = entity.v_BlackListPerson; dto.v_PersonId = entity.v_PersonId; 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; dto.i_Status = entity.i_Status; dto.d_DateRegister = entity.d_DateRegister; dto.d_DateDetection = entity.d_DateDetection; dto.d_DateSolution = entity.d_DateSolution; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="blacklistpersonDto"/> to an instance of <see cref="blacklistperson"/>. /// </summary> /// <param name="dto"><see cref="blacklistpersonDto"/> to convert.</param> public static blacklistperson ToEntity(this blacklistpersonDto dto) { if (dto == null) { return(null); } var entity = new blacklistperson(); entity.v_BlackListPerson = dto.v_BlackListPerson; entity.v_PersonId = dto.v_PersonId; 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; entity.i_Status = dto.i_Status; entity.d_DateRegister = dto.d_DateRegister; entity.d_DateDetection = dto.d_DateDetection; entity.d_DateSolution = dto.d_DateSolution; dto.OnEntity(entity); return(entity); }
public void AddBlackList(ref OperationResult pobjOperationResult, blacklistpersonDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; string NewId = "(No generado)"; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); blacklistperson objEntity = blacklistpersonAssembler.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 = int.Parse(ClientSession[0]); NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 110), "ZZ");; objEntity.v_BlackListPerson = NewId; dbContext.AddToblacklistperson(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "BLACKLIST", "v_BlackListPerson=" + NewId.ToString(), Success.Ok, null); return; } 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, "BLACKLIST", "v_BlackListPerson=" + NewId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage); return; } }
public void UpdateBlackList(ref OperationResult pobjOperationResult, blacklistpersonDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); // Obtener la entidad fuente var objEntitySource = (from a in dbContext.blacklistperson where a.v_BlackListPerson == pobjDtoEntity.v_BlackListPerson select a).FirstOrDefault(); // Crear la entidad con los datos actualizados pobjDtoEntity.d_UpdateDate = DateTime.Now; pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]); blacklistperson objEntity = blacklistpersonAssembler.ToEntity(pobjDtoEntity); // Copiar los valores desde la entidad actualizada a la Entidad Fuente dbContext.blacklistperson.ApplyCurrentValues(objEntity); // Guardar los cambios dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "BLACKLIST", "v_AreaId=" + objEntity.v_BlackListPerson.ToString(), Success.Ok, null); return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "BLACKLIST", "v_AreaId=" + pobjDtoEntity.v_BlackListPerson.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage); return; } }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="blacklistperson"/> converted from <see cref="blacklistpersonDto"/>.</param> static partial void OnEntity(this blacklistpersonDto dto, blacklistperson entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="blacklistpersonDto"/> converted from <see cref="blacklistperson"/>.</param> static partial void OnDTO(this blacklistperson entity, blacklistpersonDto dto);