コード例 #1
0
        public async Task <ActionResult <ResultadoBPN> > RegistrarDocumentoResultadoBPN(ExpedienteWrapper expedientewrapper)
        {
            ResultadoBPNDTO resultadoBPNDTO = new ResultadoBPNDTO();
            var             json            = JsonConvert.SerializeObject(expedientewrapper.documento);

            resultadoBPNDTO = JsonConvert.DeserializeObject <ResultadoBPNDTO>(json);

            List <string> url2     = new List <string>();
            string        urlData2 = "";

            foreach (string u in resultadoBPNDTO.contenidoDTO.Urlanexo)
            {
                if (!string.IsNullOrWhiteSpace(u))
                {
                    var solicitudBytes2 = Convert.FromBase64String(u);
                    urlData2 = await _almacenadorDeDocs.saveDoc(solicitudBytes2, "pdf", "resultadobpn");

                    url2.Add(urlData2);
                }
            }

            ExpedienteDTO       expedientePorConsultar = _expedienteservice.getById(expedientewrapper.idexpediente);
            DocumentoExpediente documentosolicitud     = expedientePorConsultar.documentos.Find(x => x.tipo == "SolicitudInicial");

            return(_documentoservice.registrarResultadoBPN(resultadoBPNDTO, url2, expedientewrapper.idusuarioactual, expedientewrapper.idexpediente, expedientewrapper.documentoentrada, documentosolicitud.iddocumento));
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="DAL"></param>
 /// <returns></returns>
 public static ExpedienteDTO MapeoDALToDTO(Expediente DAL)
 {
     try
     {
         ExpedienteDTO expediente = new ExpedienteDTO();
         expediente.ExpedienteId             = DAL.ExpedienteId;
         expediente.UpdateAt                 = DAL.UpdateAt;
         expediente.CreatedAt                = DAL.CreatedAt;
         expediente.Cuantia                  = DAL.Cuantia;
         expediente.Descripcion              = DAL.Descripcion;
         expediente.DireccionEjecutado       = DAL.DireccionEjecutado;
         expediente.DireccionTituloEjecutivo = DAL.DireccionTituloEjecutivo;
         expediente.EntidadEncargada         = DAL.EntidadEncargada;
         expediente.FechaRadicacion          = DAL.FechaRadicacion;
         expediente.Identificacion           = DAL.Identificacion;
         expediente.NaturalezaObligacion     = DAL.NaturalezaObligacion;
         expediente.Nombre = DAL.Nombre;
         //expediente.Obligacion = Obligacion.MapeoDALToDTO(DAL.Obligacion);
         expediente.UbicacionExpediente = DAL.UbicacionExpediente;
         // expediente.ObligacionId = DAL.ObligacionId;
         return(expediente);
     }
     catch (Exception)
     {
         return(null);
     }
 }
コード例 #3
0
        public string Insertar(ExpedienteDTO expediente)
        {
            using (db = new Contexto())
            {
                try
                {
                    // preparar el cliente para guardar
                    Expediente c = Expediente.MapeoDTOToDAL(expediente);
                    c.Obligacion            = Obligacion.MapeoDTOToDAL(expediente.Obligacion);
                    c.Obligacion.Expediente = c;
                    db.Expedientes.Add(c);
                    //db.Obligaciones.Add(c.Obligacion);
                    db.SaveChanges();
                    // preparar la respuesta
                    respuesta = "Se realizó la operación satisfactoriamente";
                }
                catch (System.Data.Entity.Validation.DbEntityValidationException ex)
                {
                    respuesta = ex.Message;
                }
                catch (Exception ex)
                {
                    respuesta = ex.Message;
                }

                return(respuesta);
            }
        }
コード例 #4
0
        public async Task <ActionResult <ConclusionFirma> > RegistrarDocumentoCF(ExpedienteWrapper expediente)
        {
            ConclusionFirmaDTO conclusionfirmaDTO = new ConclusionFirmaDTO();
            var json = JsonConvert.SerializeObject(expediente.documento);

            conclusionfirmaDTO = JsonConvert.DeserializeObject <ConclusionFirmaDTO>(json);
            List <string> url2     = new List <string>();
            string        urlData2 = "";

            foreach (string u in conclusionfirmaDTO.contenidoDTO.Urlanexo)
            {
                if (!string.IsNullOrWhiteSpace(u))
                {
                    var solicitudBytes2 = Convert.FromBase64String(u);
                    urlData2 = await _almacenadorDeDocs.saveDoc(solicitudBytes2, "pdf", "conclusionfirma");

                    url2.Add(urlData2);
                }
            }

            ExpedienteDTO       expedientePorConsultar = _expedienteservice.getById(expediente.idexpediente);
            DocumentoExpediente documentosolicitud     = expedientePorConsultar.documentos.Find(x => x.tipo == "SolicitudInicial");

            ConclusionFirma documentoCF = new ConclusionFirma();

            documentoCF = _documentoservice.registrarConclusionFirmaE(expediente, url2, documentosolicitud.iddocumento);
            _escrituraspublicasservice.updateEscrituraPublicaporConclusionFirma(conclusionfirmaDTO.contenidoDTO.idescriturapublica);
            return(documentoCF);
        }
        public void InsertarTest()
        {
            ExpedienteBLL obj = new ExpedienteBLL();
            //ExpedienteDTO expediente = new ExpedienteDTO{
            //    Cuantia = 500,
            //    Identificacion="dd",
            //    Nombre="jj",
            //    Obligacion= new ObligacionDTO{
            //        Cuantia=500
            //    }
            //};
            ObligacionDTO obligacion = new ObligacionDTO
            {
                Cuantia = 500
            };
            ExpedienteDTO expediente = new ExpedienteDTO
            {
                Cuantia        = 500,
                Identificacion = "dd",
                Nombre         = "jj",
                Obligacion     = obligacion
            };

            obj.Insertar(expediente);
            Assert.AreEqual("Se realizó la operación satisfactoriamente", obj.Insertar(expediente));
        }
コード例 #6
0
        public ExpedienteDTO FindExpedienteById(int ExpedienteId)
        {
            //List<Expediente> lista = db.Expedientes.ToList();
            var           exped      = db.Expedientes.Where(t => t.ExpedienteId == ExpedienteId).FirstOrDefault();
            ExpedienteDTO expediente = Expediente.MapeoDALToDTO(exped);     // Busca por llave primaria

            return(expediente);
        }
コード例 #7
0
 public ExpedienteDTO FindById(int ExpedienteId)
 {
     using (Contexto db = new Contexto())
     {
         var           exped      = db.Expedientes.Find(ExpedienteId);
         ExpedienteDTO expediente = Expediente.MapeoDALToDTO(exped); // Busca por llave primaria
         return(expediente);
     }
 }
コード例 #8
0
        /// <summary>
        /// Este metodo convierte un DTO a DAL
        /// </summary>
        /// <param name="DTO">Parametro DTO</param>
        /// <returns>Objeto tipo DAL</returns>
        public static Expediente MapeoDTOToDAL(ExpedienteDTO DTO)
        {
            Expediente expediente = new Expediente();

            expediente.ExpedienteId   = DTO.ExpedienteId;
            expediente.Cuantia        = DTO.Cuantia;
            expediente.Identificacion = DTO.Identificacion;
            expediente.Nombre         = DTO.Nombre;
            expediente.ObligacionId   = DTO.ObligacionId;
            return(expediente);
        }
コード例 #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="DAL"></param>
        /// <returns></returns>
        public static ExpedienteDTO MapeoDALToDTO(Expediente DAL)
        {
            ExpedienteDTO expediente = new ExpedienteDTO();

            expediente.ExpedienteId   = DAL.ExpedienteId;
            expediente.Cuantia        = DAL.Cuantia;
            expediente.Identificacion = DAL.Identificacion;
            expediente.Nombre         = DAL.Nombre;
            expediente.Obligacion     = Obligacion.MapeoDALToDTO(DAL.Obligacion);
            expediente.ObligacionId   = DAL.ObligacionId;
            return(expediente);
        }
コード例 #10
0
        public ExpedienteDTO getById(string iddoc)
        {
            Expediente    expediente = _expedientes.Find(exp => exp.id == iddoc).FirstOrDefault();
            ExpedienteDTO dTO        = new ExpedienteDTO
            {
                cliente      = expediente.cliente,
                derivaciones = expediente.derivaciones,
                documentos   = expediente.documentos,
                estado       = expediente.estado,
                fechafin     = expediente.fechafin,
                fechainicio  = expediente.fechainicio,
                id           = expediente.id,
                tipo         = expediente.tipo
            };

            return(dTO);
        }