예제 #1
0
        public async Task <IActionResult> Edit(string id, [Bind("IdReprLegal,NombresRepresentanteLegal,ApellidosRepresentanteLegal,IdTipoDocumento,NoDocumento,Correo,Telefono,IdEmpresa")] RepresentanteLegal representanteLegal)
        {
            if (id != representanteLegal.IdReprLegal)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(representanteLegal);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RepresentanteLegalExists(representanteLegal.IdReprLegal))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdEmpresa"]       = new SelectList(_context.Empresa, "IdEmpresa", "IdEje", representanteLegal.IdEmpresa);
            ViewData["IdTipoDocumento"] = new SelectList(_context.TipoDocumento, "IdTipoDocumento", "IdTipoDocumento", representanteLegal.IdTipoDocumento);
            return(View(representanteLegal));
        }
예제 #2
0
        public bool GrabarSolicitudEmpresa(SolicitudEmpresa item, ref Int64 codigo, ref string rMsg)
        {
            SolicitudDatos obj        = new SolicitudDatos();
            Int64          codigorep  = 0;
            string         mensajerep = "";
            int            i          = 0;

            obj.GrabarSolicitudEmpresa(item, ref codigo, ref rMsg);

            string nameArchivo = "LOGGUARDACORPRP";

            HelperLog.EscribirLog("", nameArchivo, "GrabarSolicitudEmpresa nrosec: " + codigo, false);
            HelperLog.EscribirLog("", nameArchivo, " GrabarSolicitudEmpresa mensaje: " + rMsg, false);

            if (item.REPRESENTANTE_LEGAL.Count > 0)
            {
                for (i = 0; i < item.REPRESENTANTE_LEGAL.Count; i++)
                {
                    RepresentanteLegal oRepLegal = new RepresentanteLegal();
                    oRepLegal = (RepresentanteLegal)item.REPRESENTANTE_LEGAL[i];
                    oRepLegal.SOLIN_CODIGO = codigo;
                    obj.GrabarSolicitudRepLegal(oRepLegal, ref codigorep, ref mensajerep);
                    rMsg = mensajerep;
                }
            }
            return(true);
        }
예제 #3
0
        private RepresentanteLegal representanteLegal()
        {
            Identidad          identidadRepresentante = new Identidad("0801198512396");
            RepresentanteLegal representanteLegal     = new RepresentanteLegal(identidadRepresentante, "Juan Perez");

            return(representanteLegal);
        }
예제 #4
0
        private static void saveRepresentante(RepresentanteLegal representante)
        {
            _session = _sessionFactory.OpenSession();
            using (var tx = _session.BeginTransaction())
            {
                _session.Save(representante);

                tx.Commit();
            }
            _session.Close();
        }
예제 #5
0
        private RepresentanteLegal getRepresentanteLegal(GremioRequest gremioRequest)
        {
            var rtnRequest             = gremioRequest.rtnRequest;
            var representanteRequest   = gremioRequest.representanteLegalRequest;
            var identidadRepresentante = representanteRequest.identidadRequest;
            var identidad = new Identidad(identidadRepresentante.identidad);



            var representanteLegal = new RepresentanteLegal(identidad, representanteRequest.nombre);

            return(representanteLegal);
        }
예제 #6
0
        public async Task <IActionResult> Create([Bind("IdReprLegal,NombresRepresentanteLegal,ApellidosRepresentanteLegal,IdTipoDocumento,NoDocumento,Correo,Telefono,IdEmpresa")] RepresentanteLegal representanteLegal)
        {
            if (ModelState.IsValid)
            {
                _context.Add(representanteLegal);
                await _context.SaveChangesAsync();

                TempData["Mensaje"] = "El Representante Legal se ha creado correctamente";
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdEmpresa"]       = new SelectList(_context.Empresa, "IdEmpresa", "IdEje", representanteLegal.IdEmpresa);
            ViewData["IdTipoDocumento"] = new SelectList(_context.TipoDocumento, "IdTipoDocumento", "IdTipoDocumento", representanteLegal.IdTipoDocumento);
            return(View(representanteLegal));
        }
        private static Gremio getGremio()
        {
            var municipio    = new Municipio("01", "01", "Municipio");
            var departamento = new Departamento()
            {
                Id = "01", Municipios = new List <Municipio>()
                {
                    municipio
                }, Nombre = "Departamento"
            };
            var direccion = new Direccion(departamento, municipio, "direccion gremio");

            var RTN           = new RTN("08011985123960");
            var representante = new RepresentanteLegal(new Identidad("0801198512396"), "Dante");

            var gremio = new Gremio(RTN, representante, direccion, "Camara");

            return(gremio);
        }
예제 #8
0
        private static Gremio convertToGremio(GremioRequest request)
        {
            var rtn                 = request.rtnRequest;
            var representante       = request.representanteLegalRequest;
            var direccion           = request.direccionRequest;
            var rtnGremio           = new RTN(rtn.RTN);
            var auditoria           = request.auditoriaRequest;
            var representanteGremio = new RepresentanteLegal(new Identidad(representante.identidadRequest.identidad),
                                                             representante.nombre);

            var municipioGremio = new Municipio()
            {
                DepartamentoId = direccion.departamentoRequest.idDepartamento,
                Id             = direccion.municipioRequest.idMunicipio,
                Nombre         = direccion.municipioRequest.nombre
            };


            var departamentoGremio = new Departamento()
            {
                Id         = direccion.departamentoRequest.idDepartamento,
                Municipios = new List <Municipio>()
                {
                    municipioGremio
                },
                Nombre = direccion.departamentoRequest.nombre
            };
            var direccionGremio = new Direccion(departamentoGremio, municipioGremio, direccion.descripcion);

            direccionGremio.Id = direccion.IdGuid;

            var auditoriaGremio = new Auditoria(auditoria.usuarioCreo, auditoria.fechaCreo, auditoria.usuarioModifico,
                                                auditoria.fechaModifico);

            var gremio = new Gremio(rtnGremio, representanteGremio, direccionGremio, request.nombre);

            gremio.Auditoria = auditoriaGremio;
            return(gremio);
        }
예제 #9
0
 public RepresentanteLegal Put([FromBody] RepresentanteLegal representanteLegal)
 {
     _repositorio.Atualizar(representanteLegal);
     return(representanteLegal);
 }
예제 #10
0
 public RepresentanteLegal Post([FromBody] RepresentanteLegal representanteLegal)
 {
     _repositorio.Adicionar(representanteLegal);
     return(representanteLegal);
 }
예제 #11
0
 public RepresentanteLegal Atualizar(RepresentanteLegal representanteLegal)
 {
     ctx.Entry(representanteLegal).State = EntityState.Modified;
     ctx.SaveChanges();
     return(representanteLegal);
 }
예제 #12
0
 public RepresentanteLegal Adicionar(RepresentanteLegal representanteLegal)
 {
     ctx.RepresentanteLegals.Add(representanteLegal);
     ctx.SaveChanges();
     return(representanteLegal);
 }
예제 #13
0
        public bool RegistrarRepresentanteLegalSEC(RepresentanteLegal items)
        {
            MaestroDatos obj = new MaestroDatos();

            return(obj.RegistrarRepresentanteLegalSEC(items));
        }
예제 #14
0
        //PROY-24740
        public HistorialDataCreditoCorp obtenerHistorialDCCorp(DataCreditoCorpIN p_datacredito)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_TIPO_DOC",             DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_NRO_RUC",              DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_TIPO_SEC",             DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("K_CUR_HISTORIAL_DC",     DbType.Object, ParameterDirection.Output),
                new DAABRequest.Parameter("K_CUR_HISTORIAL_REPLEG", DbType.Object, ParameterDirection.Output)
            };

            for (int i = 0; i < arrParam.Length; i++)
            {
                arrParam[i].Value = DBNull.Value;
            }

            arrParam[0].Value = p_datacredito.istrTipoDocumento.Substring(p_datacredito.istrTipoDocumento.Length - 1, 1);
            arrParam[1].Value = p_datacredito.istrNumeroDocumento;
            arrParam[2].Value = p_datacredito.istrTipoSEC;

            BDSISACT    obj       = new BDSISACT(BaseDatos.BD_SISACT);
            DAABRequest obRequest = obj.CreaRequest();

            string[] sTab = { "historico", "representantes" };
            obRequest.TableNames  = sTab;
            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.PKG_SISACT_HISTORICO_DC + ".SPS_OBTENER_HISTORICO_DC_CORP";
            obRequest.Parameters.AddRange(arrParam);
            IDataReader dr = null;
            HistorialDataCreditoCorp objConsultaHistorialDataCreditoCorp = new HistorialDataCreditoCorp();

            try
            {
                dr = obRequest.Factory.ExecuteReader(ref obRequest).ReturnDataReader;

                while (dr.Read())
                {
                    objConsultaHistorialDataCreditoCorp.ws53_Out_Header_CodigoRetorno               = Funciones.CheckStr(dr["COD_RETORNO"]);
                    objConsultaHistorialDataCreditoCorp.ws12_Out_Header_NumeroOperacion             = Funciones.CheckStr(dr["NUM_OPERACION"]);
                    objConsultaHistorialDataCreditoCorp.ws50_Out_GrupoIntegrantes_IntegranteNombres = Funciones.CheckStr(dr["RAZON_SOCIAL"]);
                    objConsultaHistorialDataCreditoCorp.ws50_Out_CampoValor_Accion              = Funciones.CheckStr(dr["RIESGO"]);
                    objConsultaHistorialDataCreditoCorp.ws12_In_Nombres                         = Funciones.CheckStr(dr["NOMBRES"]);
                    objConsultaHistorialDataCreditoCorp.ws12_In_ApellidoPaterno                 = Funciones.CheckStr(dr["APE_PAT"]);
                    objConsultaHistorialDataCreditoCorp.ws12_In_ApellidoMaterno                 = Funciones.CheckStr(dr["APE_MAT"]);
                    objConsultaHistorialDataCreditoCorp.ws50_Out_CampoValor_MsgIngTarjeta       = Funciones.CheckStr(dr["MSG_ING_TAR"]);
                    objConsultaHistorialDataCreditoCorp.ws50_Out_CampoValor_MsgIngDHipotecaria  = Funciones.CheckStr(dr["MSG_ING_DHIP"]);
                    objConsultaHistorialDataCreditoCorp.ws50_Out_CampoValor_MsgIngDnHipoTarjeta = Funciones.CheckStr(dr["MSG_ING_DNHIPO_TAR"]);
                    objConsultaHistorialDataCreditoCorp.buro_consultado                         = Funciones.CheckInt(dr["BURO_CREDITICIO"]); //PROY-20054-IDEA-23849
                }

                // Para los representantes legal
                dr.NextResult();
                ArrayList ListaRepresentanteLegal = new ArrayList();

                string   strNombreCompletoRRLL = "";
                string   strApePaterno         = "";
                string   strApeMaterno         = "";
                string   strNombre             = "";
                string[] arrNombre;

                while (dr.Read())
                {
                    RepresentanteLegal oRepresentanteLegal = new RepresentanteLegal();
                    oRepresentanteLegal.APODC_TIP_DOC_REP = Funciones.CheckStr(dr["TIPO_DOCUMENTO"]);
                    oRepresentanteLegal.APODV_NUM_DOC_REP = Funciones.CheckStr(dr["NUMERO_DOCUMENTO"]);

                    strNombreCompletoRRLL = Funciones.CheckStr(dr["NOMBRES"]);
                    arrNombre             = strNombreCompletoRRLL.Split(' ');
                    strApePaterno         = "";
                    strApeMaterno         = "";
                    strNombre             = "";
                    if (arrNombre.Length == 3)
                    {
                        strApePaterno = arrNombre[0];
                        strApeMaterno = arrNombre[1];
                        strNombre     = arrNombre[2];
                    }
                    else
                    {
                        if (arrNombre.Length > 3)
                        {
                            strApePaterno = arrNombre[0];
                            strApeMaterno = arrNombre[1];
                            strNombre     = "";
                            StringBuilder sblNombre = new StringBuilder();
                            for (int z = 2; z < arrNombre.Length; z++)
                            {
                                sblNombre.AppendFormat("{0} ", arrNombre[z]);
                            }
                            strNombre = sblNombre.ToString().Trim();
                        }
                    }

                    oRepresentanteLegal.APODV_APA_REP_LEG = strApePaterno;
                    oRepresentanteLegal.APODV_AMA_REP_LEG = strApeMaterno;
                    oRepresentanteLegal.APODV_NOM_REP_LEG = strNombre;
                    oRepresentanteLegal.APODV_CAR_REP     = Funciones.CheckStr(dr["CARGO"]);
                    ListaRepresentanteLegal.Add(oRepresentanteLegal);
                }
                objConsultaHistorialDataCreditoCorp.RepresentantesLegales = ListaRepresentanteLegal;
            }
            finally
            {
                if (dr != null && dr.IsClosed == false)
                {
                    dr.Close();
                }
                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }
            return(objConsultaHistorialDataCreditoCorp);
        }