/// <summary> /// Converts this instance of <see cref="planintegral"/> to an instance of <see cref="planintegralDto"/>. /// </summary> /// <param name="entity"><see cref="planintegral"/> to convert.</param> public static planintegralDto ToDTO(this planintegral entity) { if (entity == null) { return(null); } var dto = new planintegralDto(); dto.v_PlanIntegral = entity.v_PlanIntegral; dto.v_PersonId = entity.v_PersonId; dto.i_TipoId = entity.i_TipoId; dto.v_Descripcion = entity.v_Descripcion; dto.d_Fecha = entity.d_Fecha; dto.v_Lugar = entity.v_Lugar; 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="planintegralDto"/> to an instance of <see cref="planintegral"/>. /// </summary> /// <param name="dto"><see cref="planintegralDto"/> to convert.</param> public static planintegral ToEntity(this planintegralDto dto) { if (dto == null) { return(null); } var entity = new planintegral(); entity.v_PlanIntegral = dto.v_PlanIntegral; entity.v_PersonId = dto.v_PersonId; entity.i_TipoId = dto.i_TipoId; entity.v_Descripcion = dto.v_Descripcion; entity.d_Fecha = dto.d_Fecha; entity.v_Lugar = dto.v_Lugar; 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 AddPlanIntegral(ref OperationResult pobjOperationResult, planintegralDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; string NewId = "(No generado)"; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); planintegral objEntity = planintegralAssembler.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, 327), "PL");; objEntity.v_PlanIntegral = NewId; dbContext.AddToplanintegral(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); return; } }
public void UpdatePlanIntegral(ref OperationResult pobjOperationResult, planintegralDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); // Obtener la entidad fuente var objEntitySource = (from a in dbContext.planintegral where a.v_PlanIntegral == pobjDtoEntity.v_PlanIntegral select a).FirstOrDefault(); // Crear la entidad con los datos actualizados pobjDtoEntity.d_UpdateDate = DateTime.Now; pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]); planintegral objEntity = planintegralAssembler.ToEntity(pobjDtoEntity); // Copiar los valores desde la entidad actualizada a la Entidad Fuente dbContext.planintegral.ApplyCurrentValues(objEntity); // Guardar los cambios dbContext.SaveChanges(); pobjOperationResult.Success = 1; return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); return; } }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="planintegral"/> converted from <see cref="planintegralDto"/>.</param> static partial void OnEntity(this planintegralDto dto, planintegral entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="planintegralDto"/> converted from <see cref="planintegral"/>.</param> static partial void OnDTO(this planintegral entity, planintegralDto dto);