/// <summary> /// Converts this instance of <see cref="systemparameter"/> to an instance of <see cref="systemparameterDto"/>. /// </summary> /// <param name="entity"><see cref="systemparameter"/> to convert.</param> public static systemparameterDto ToDTO(this systemparameter entity) { if (entity == null) { return(null); } var dto = new systemparameterDto(); dto.i_GroupId = entity.i_GroupId; dto.i_ParameterId = entity.i_ParameterId; dto.v_Value1 = entity.v_Value1; dto.v_Value2 = entity.v_Value2; dto.v_Field = entity.v_Field; dto.i_ParentParameterId = entity.i_ParentParameterId; dto.i_Sort = entity.i_Sort; 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="systemparameterDto"/> to an instance of <see cref="systemparameter"/>. /// </summary> /// <param name="dto"><see cref="systemparameterDto"/> to convert.</param> public static systemparameter ToEntity(this systemparameterDto dto) { if (dto == null) { return(null); } var entity = new systemparameter(); entity.i_GroupId = dto.i_GroupId; entity.i_ParameterId = dto.i_ParameterId; entity.v_Value1 = dto.v_Value1; entity.v_Value2 = dto.v_Value2; entity.v_Field = dto.v_Field; entity.i_ParentParameterId = dto.i_ParentParameterId; entity.i_Sort = dto.i_Sort; 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); }
public void AddSystemParameter(ref OperationResult pobjOperationResult, systemparameterDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); systemparameter objEntity = systemparameterAssembler.ToEntity(pobjDtoEntity); objEntity.d_InsertDate = DateTime.Now; objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]); objEntity.i_IsDeleted = 0; dbContext.AddTosystemparameter(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "PARÁMETRO", "GroupId=" + objEntity.i_GroupId.ToString() + " / Descripción = " + objEntity.v_Value1, 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, "PARÁMETRO", "GroupId=" + pobjDtoEntity.i_GroupId.ToString() + " / Descripción = " + pobjDtoEntity.v_Value1, Success.Failed, ex.Message); return; } }
public void UpdateSystemParameter(ref OperationResult pobjOperationResult, systemparameterDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); // Obtener la entidad fuente var objEntitySource = (from a in dbContext.systemparameter where a.i_GroupId == pobjDtoEntity.i_GroupId && a.i_ParameterId == pobjDtoEntity.i_ParameterId select a).FirstOrDefault(); // Crear la entidad con los datos actualizados pobjDtoEntity.d_UpdateDate = DateTime.Now; pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]); systemparameter objEntity = systemparameterAssembler.ToEntity(pobjDtoEntity); // Copiar los valores desde la entidad actualizada a la Entidad Fuente dbContext.systemparameter.ApplyCurrentValues(objEntity); // Guardar los cambios dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "PARÁMETRO", "GroupId=" + objEntity.i_GroupId.ToString() + " / Descripción = " + objEntity.v_Value1, 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, "PARÁMETRO", "GroupId=" + pobjDtoEntity.i_GroupId.ToString() + " / Descripción = " + pobjDtoEntity.v_Value1, Success.Failed, ex.Message); return; } }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="systemparameter"/> converted from <see cref="systemparameterDto"/>.</param> static partial void OnEntity(this systemparameterDto dto, systemparameter entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="systemparameterDto"/> converted from <see cref="systemparameter"/>.</param> static partial void OnDTO(this systemparameter entity, systemparameterDto dto);