/// <summary> /// Este metodo convierte un DTO a DAL /// </summary> /// <param name="DTO">Parametro DTO</param> /// <returns>Objeto tipo DAL</returns> public static Documento MapeoDTOToDAL(DocumentoDTO item) { try { Documento documento = new Documento(); documento.DocumentoId = item.DocumentoId; documento.UpdateAt = item.UpdateAt; documento.CreatedAt = item.CreatedAt; if (item.Expediente != null) { documento.Expediente = Expediente.MapeoDTOToDAL(item.Expediente); } documento.ExpedienteId = item.ExpedienteId; documento.FechaDocumento = item.FechaDocumento; documento.FechaEntrega = item.FechaEntrega; documento.FechaRadicacion = item.FechaRadicacion; documento.FechaRecepcion = item.FechaRecepcion; documento.FuncionarioEntrega = item.FuncionarioEntrega; documento.FuncionarioRecibe = item.FuncionarioRecibe; documento.OficinaOrigen = item.OficinaOrigen; documento.Remitente = item.Remitente; documento.RutaDocumento = item.RutaDocumento; documento.TipoArchivo = item.TipoArchivo; documento.Estado = item.Estado; if (item.TipoDocumento != null) { documento.TipoDocumento = TipoDocumento.MapeoDTOToDAL(item.TipoDocumento); } documento.TipoDocumentoId = item.TipoDocumentoId; return(documento); }catch (Exception) { return(null); } }
/// <summary> /// Este metodo convierte un DTO a DAL /// </summary> /// <param name="DTO">Parametro DTO</param> /// <returns>Objeto tipo DAL</returns> public static Obligacion MapeoDTOToDAL(ObligacionDTO DTO) { try { Obligacion obligacion = new Obligacion(); obligacion.ObligacionId = DTO.ObligacionId; obligacion.UpdateAt = DTO.UpdateAt; obligacion.CreatedAt = DTO.CreatedAt; obligacion.Cuantia = DTO.Cuantia; obligacion.Dueda = DTO.Dueda; obligacion.Estado = DTO.Estado; if (DTO.Expediente != null) { obligacion.Expediente = Expediente.MapeoDTOToDAL(DTO.Expediente); } if (DTO.Persona != null) { obligacion.Persona = Persona.MapeoDTOToDAL(DTO.Persona); } if (DTO.TipoObligacion != null) { obligacion.TipoObligacion = TipoObligacion.MapeoDTOToDAL(DTO.TipoObligacion); } obligacion.FechaPreinscripcion = DTO.FechaPreinscripcion; obligacion.PersonaId = DTO.PersonaId; obligacion.ExpedienteId = DTO.ExpedienteId; obligacion.TipoObligacionId = DTO.TipoObligacionId; return(obligacion); }catch (Exception) { return(null); } }
/// <summary> /// Este metodo convierte un DTO a DAL /// </summary> /// <param name="DTO">Parametro DTO</param> /// <returns>Objeto tipo DAL</returns> public static Obligacion MapeoDTOToDAL(ObligacionDTO DTO) { Obligacion obligacion = new Obligacion(); obligacion.ObligacionId = DTO.ObligacionId; obligacion.Cuantia = DTO.Cuantia; if (DTO.Expediente != null) { obligacion.Expediente = Expediente.MapeoDTOToDAL(DTO.Expediente); } obligacion.ExpedienteId = DTO.ExpedienteId; return(obligacion); }