コード例 #1
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string ProcesarPdfIva(ref DatosClientePy dataCliente, HttpRequestBase request, out string codigoError, out string mensajeError)
        {
            string mes  = "";
            var    text = request.ExtractTextFromPdf(out mes, out codigoError, out mensajeError);

            if (codigoError != "200")
            {
                return(null);
            }

            if (dataCliente.IvaVentaMes == null)
            {
                dataCliente.IvaVentaMes = new IvaVentasMeses();
            }

            var doc = request.Files.AllKeys[0].Split('-')[0];
            //string cleanedText = Regex.Replace(text.ToString(), @"http[^\s]+", "");

            string codeError = "", mensaje = "", totalVentasMes = "";

            try
            {
                totalVentasMes = _ServicioRatingEmpresarial.ProcesarPDFDeclaracionIVA(dataCliente.Cedula.Trim() + "001", mes, text.ToString(), DateTime.Now.ToString("yyyy/MM/dd"), ref codeError, ref mensaje);
            }
            catch (Exception)
            {
                codigoError = "503";
                return(null);
            }

            if (codeError != "000")
            {
                codigoError  = "400";
                mensajeError = mensaje;
            }
            else
            {
                codigoError  = "200";
                mensajeError = "subido correctamente";
            }

            if (doc == "documento1")
            {
                dataCliente.IvaVentaMes.Mes1 = totalVentasMes;
            }
            if (doc == "documento2")
            {
                dataCliente.IvaVentaMes.Mes2 = totalVentasMes;
            }
            if (doc == "documento3")
            {
                dataCliente.IvaVentaMes.Mes3 = totalVentasMes;
            }

            return("");
        }
コード例 #2
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string ActualizarDatosCliente(DatosClientePy datosCliente)
        {
            string codigoRetorno, mensajeRetorno, resp;

            try
            {
                //ActualizarDatosClienteSolicitudCredito
                resp = _ContratacionProducto.ActualizarDatosClienteSolicitudCredito(datosCliente.Cedula, datosCliente.Nombres, datosCliente.FechaNacimiento, datosCliente.Celular, datosCliente.Email, 0, int.Parse(datosCliente.IdEstadoCivil), out codigoRetorno, out mensajeRetorno);
            }
            catch (Exception)
            {
                codigoRetorno = "503"; mensajeRetorno = "";
                resp          = null;
            }

            return(resp);
        }
コード例 #3
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public Anyo ConsultaAnyos(ref DatosClientePy dataCliente, out string codError, out string mensajeError)
        {
            mensajeError = "";
            string idClienteRating;

            idClienteRating = ""; string idProceso = "", fechaRevision = "";
            DataSet resp = null; codError = "200";

            try
            {
                _ServicioRatingEmpresarial.Consultar_Ins_Updt_Clientes_Rating_Neo(dataCliente.Cedula, dataCliente.Nombres, dataCliente.DireccionDomicilio, ref codError, ref mensajeError, ref idClienteRating, ref idProceso, ref fechaRevision);
                resp = _ServicioRatingEmpresarial.ConsultaAnyosWeb(dataCliente.Cedula, fechaRevision, idProceso);
                dataCliente.idProceso = idProceso;
                var fechaSplited = fechaRevision.Split('-');
                dataCliente.fechaRevision = fechaSplited[2] + "/" + fechaSplited[1] + "/" + fechaSplited[0];
            }
            catch (Exception e)
            {
                codError = "503";
                return(null);
            }

            string informacion = ""; Anyo anyo = new Anyo();
            var    table    = resp.Tables["Table"];
            var    myColumn = table.Columns.Cast <DataColumn>().SingleOrDefault(col => col.ColumnName == "Informar");

            if (myColumn != null)
            {
                codError = "200";
                var tableRow = table.AsEnumerable().First();
                informacion = tableRow.Field <string>(myColumn);
            }
            else
            {
                codError = "500"; return(null);
            }
            if (informacion.ToLower() == "incompleto")
            {
                DataNamesMapper <Anyo> mapperToAnyo = new DataNamesMapper <Anyo>();
                anyo = mapperToAnyo.Map(resp.Tables["table1"].Rows[0]);
            }
            anyo.Detalle     = informacion.ToLower();
            anyo.Environment = _settings.Environment.mode;

            return(anyo);
        }
コード例 #4
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public byte[] GetTablaAmortizacion(DatosClientePy dataCliente, FromFormSolicitudCreditoDto soli)
        {
            string CodigoRetorno, MensajeRetorno;

            byte[] pdf;
            try
            {
                pdf = _ContratacionProducto.SimularTablaAmortizacion("PDF", dataCliente.Cedula, "C", dataCliente.Nombres,
                                                                     _settings.ProductoSG.IdProductoNeo.ToString(), soli.amortizacion, soli.monto + ".00", soli.plazoCredito.Descripcion.Split(' ')[0], "1", out CodigoRetorno, out MensajeRetorno);
            }
            catch (Exception)
            {
                pdf            = null;
                CodigoRetorno  = "503";
                MensajeRetorno = "servicio no desoinible por el momento.";
            }

            return(pdf);
        }
コード例 #5
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string ProcesarDeclaracionIVA(DatosClientePy dataCliente)
        {
            string codError = "", mensajeError = "";

            try
            {
                //_ServicioRatingEmpresarial.ProcesoDeclaracionIVA("CAL", dataCliente.idProceso, double.Parse(dataCliente.IvaVentaMes.Mes1), double.Parse(dataCliente.IvaVentaMes.Mes2), double.Parse(dataCliente.IvaVentaMes.Mes3), ref codError, ref mensajeError);
                codError = "000";
            }
            catch (Exception)
            {
                return("503");
            }

            if (codError != "000")
            {
                return("500");
            }
            return("200");
        }
コード例 #6
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string GenerarVariaciones_Indicadores_FlujoEfectivo(DatosClientePy dataCliente)
        {
            string codError = "", mensajeError = "";

            try
            {
                _ServicioRatingEmpresarial.GenerarVariaciones_Indicadores_FlujoEfectivo(dataCliente.idProceso, "", ref codError, ref mensajeError);
            }
            catch (Exception)
            {
                return("503");
            }

            if (codError != "000")
            {
                return("500");
            }

            return("200");
        }
コード例 #7
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string GenerarAnalisisCualitativo(DatosClientePy dataCliente)
        {
            string codError = "000", mensajeError = "";

            try
            {
                _ServicioRatingEmpresarial.GenerarAnalisisCualitativo(dataCliente.idProceso, dataCliente.Cedula, dataCliente.fechaRevision, "", ref codError, ref mensajeError);
            }
            catch (Exception)
            {
                return("503");
            }

            if (codError != "000")
            {
                return("500");
            }

            return("200");
        }
コード例 #8
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var param = filterContext.HttpContext.Request.Params["aplicacion"]; param = param.ToLower();
            var token = filterContext.HttpContext.Request.Params["token"];
            var s     = token.Split(' ');

            var isInDevelopment = (_mode.Equals("development", StringComparison.InvariantCultureIgnoreCase));

            if (isInDevelopment && (s.Length > 1))
            {
                if (param == "sobregiro")
                {
                    DatosCliente datosCliente = new DatosCliente();
                    datosCliente.Cedula = s[1];

                    filterContext.HttpContext.Session.Add("datosCliente", datosCliente);

                    filterContext.Result = new RedirectToRouteResult(
                        new RouteValueDictionary
                    {
                        { "controller", "SobreGiro" },
                        { "action", "Solicitud" }
                    });
                }

                if (param == "creditopyme")
                {
                    DatosClientePy datosCliente = new DatosClientePy();
                    datosCliente.Cedula = s[1];

                    filterContext.HttpContext.Session.Add("datosClienteCP", datosCliente);

                    filterContext.Result = new RedirectToRouteResult(
                        new RouteValueDictionary
                    {
                        { "controller", "CreditoPyme" },
                        { "action", "Simulador" }
                    });
                }
            }
        }
コード例 #9
0
        public ActionResult Index(DataToken data)
        {
            if (data.IsAnyNullOrEmpty())
            {
                return(RedirectToAction("Notificacion", "ErrorHandler", new { id = "401" }));
            }

            Session.Clear();

            string codigoRetorno;

            ServicioToken.TokenValida tokenValida = _tokenRepo.RecuperarInfToken(data.token, data.canal, data.aplicacion, out codigoRetorno);

            if (tokenValida.meta.Code == "000")
            {
                string   str_json = tokenValida.data.metajson;
                InfToken json     = JsonConvert.DeserializeObject <InfToken>(str_json);

                DatosCliente datosCliente = new DatosCliente();
                datosCliente.Cedula = json.identificacion;

                if (json.producto == _settings.ProductoSG.IdProductoNeo.ToString())
                {
                    Session["datosCliente"] = datosCliente;
                    return(RedirectToAction("Solicitud", "SobreGiro"));
                }

                if (json.producto == _settings.ProductoCP.IdProductoNeo.ToString())
                {
                    var obj = new DatosClientePy(); obj.Cedula = json.identificacion;
                    Session["datosClienteCP"] = obj;
                    return(RedirectToAction("Simulador", "CreditoPyme"));
                }
            }


            return(RedirectToAction("Notificacion", "ErrorHandler", new { id = codigoRetorno }));
        }
コード例 #10
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string ProcesarPdfSRI(DatosClientePy dataCliente, HttpRequestBase request, out string codigoError, out string mensajeError)
        {
            string anyo = "";
            var    text = request.ExtractTextFromPdf(out anyo, out codigoError, out mensajeError);

            if (codigoError != "200")
            {
                return(null);
            }

            //string cleanedText = Regex.Replace(text.ToString(), @"http[^\s]+", "");

            string codeError = "", mensaje = "";

            try
            {
                var rekujwssp = _ServicioRatingEmpresarial.ProcesarPDFImpuestoRenta(dataCliente.Cedula.Trim() + "001", anyo, text.ToString(), dataCliente.idProceso, dataCliente.fechaRevision, "usuarioWeb", ref codeError, ref mensaje);
            }
            catch (Exception e)
            {
                var r = e.Message;
                codigoError = "503";
                return(null);
            }

            if (codeError != "000")
            {
                codigoError  = "400";
                mensajeError = mensaje;
            }
            else
            {
                codigoError  = "200";
                mensajeError = "subido correctamente";
            }

            return("");
        }
コード例 #11
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public string GetDataForViewDireccionNegocio(ref ForViewInfoNegocioDto data, DatosClientePy datosCliente, ICatalogoRepository _repo)
        {
            Catalogo[] catalogos = null;
            if (datosCliente.infoNegocio != null)
            {
                data.SeleccionAnterior = datosCliente.infoNegocio;
                //DireccionNegocioSeleccion seleccion = data.SeleccionAnterior;
                if (datosCliente.infoNegocio.provincia != 0)
                {
                    catalogos = _repo.GetDataCboxDireccionBy("ciudad", datosCliente.infoNegocio.provincia.ToString());
                }

                if (catalogos != null)
                {
                    data.ciudad = catalogos;
                }
                else
                {
                    return("503");
                }

                if (datosCliente.infoNegocio.ciudad != 0)
                {
                    catalogos = _repo.GetDataCboxDireccionBy("parroquia", datosCliente.infoNegocio.ciudad.ToString());
                }

                if (catalogos != null)
                {
                    data.parroquia = catalogos;
                }
                else
                {
                    return("503");
                }
            }

            catalogos = _repo.GetDataCboxForAdress("tipoInmueble");

            if (catalogos != null)
            {
                data.tipoInmueble = catalogos;
            }
            else
            {
                return("503");
            }

            catalogos = _repo.GetDataCboxDireccionBy("provincia");

            if (catalogos != null)
            {
                data.comboOptionLocation = catalogos;
            }
            else
            {
                return("503");
            }

            catalogos = _repo.GetDataCboxForAdress("aseguradora");

            if (catalogos != null)
            {
                data.aseguradora = catalogos;
            }
            else
            {
                return("503");
            }

            data.direccion = datosCliente.DireccionDomicilio;

            return("200");
        }
コード例 #12
0
ファイル: ICreditoPyme.cs プロジェクト: JohnYsaac10/app-test
        public DatosClientePy GetInfoClientePy(string cedula, out string codError, out string mensajeError)
        {
            DataNamesMapper <DatosClientePy> mapperToclient = new DataNamesMapper <DatosClientePy>();
            DatosClientePy infoCliente = null;
            DataSet        data        = null;

            try
            {
                data = _ContratacionProducto.ConsultaDatosClienteCoreAll(cedula, "C", out codError, out mensajeError);
            }
            catch (System.Exception)
            {
                codError     = "503";
                mensajeError = InitialConfig.getNotiMessage(codError, _settings).paragraph;
                return(null);
            }
            int       paso        = 0;
            int       idSolicitud = 0;
            DataRow   row         = null;
            DataTable table       = null;

            if (data.Tables.Contains("DatosBasicosCliente") && codError == "000")
            {
                row         = data.Tables["DatosBasicosCliente"].Rows[0];
                infoCliente = mapperToclient.Map(row);
                var pagina = row.Field <string>("ID_PASO_SOLICITUD");
                var idSoli = row.Field <string>("ID_SOLICITUD");
                paso        = pagina.ToInt();
                idSolicitud = idSoli.ToInt();
                //EstadoCivilFromCore
                DataNamesMapper <EstadoCivilFromCore> mapperToEcFromCore = new DataNamesMapper <EstadoCivilFromCore>();
                infoCliente.estadoCivilFormCore = mapperToEcFromCore.Map(row);
            }
            if (paso == 0 && idSolicitud == 0)
            {
                return(infoCliente);
            }


            if (paso >= 1) // Simulador | datos cliente
            {
                infoCliente.infoSolicitud = Mapper.Map <FromFormSolicitudCreditoDto>(row);
                //DataNamesMapper<SolicitudSeleccion> mapperToSeleccion1 = new DataNamesMapper<SolicitudSeleccion>();
                //infoCliente.SolicitudSeleccionAnt = mapperToSeleccion1.Map(row);
            }
            if (paso >= 2)//no definido     (estado Civil)
            {
            }
            if (paso >= 3) //Direccion domicilio | Confirmacion Datos Cliente
            {
                DataNamesMapper <FromFormInfoDomicilio> mapperToSeleccion3 = new DataNamesMapper <FromFormInfoDomicilio>();
                infoCliente.infoDomicilio = mapperToSeleccion3.Map(row);
                infoCliente.ActionRoute   = "InfoDomicilio";
            }
            if (paso >= 4) //Carga Balances
            {
            }
            if (paso >= 5) //Carga IVA
            {
            }
            if (paso >= 6) //Ventas Cliente
            {
                DataNamesMapper <Models.Producto> mapperToSeleccion6 = new DataNamesMapper <Models.Producto>();
                var seleccionado = new FromFormVentas();
                seleccionado.productos       = mapperToSeleccion6.Map(data.Tables["Productos"]).ToList();
                seleccionado.numeroEmpleados = row["NUM_EMPLEADOS"].ToString().ToInt();
                infoCliente.infoVentas       = seleccionado;
                infoCliente.ActionRoute      = "TusVentas";
            }
            if (paso >= 7) //Clientes-Proveedores
            {
                List <ClientesProveedores>            clientesProveedores = new List <ClientesProveedores>();
                DataNamesMapper <ClientesProveedores> mapperToSeleccion7  = new DataNamesMapper <ClientesProveedores>();
                FromFormClientes forWiew = new FromFormClientes();

                if (data.Tables.Contains("Clientes") && codError == "000")
                {
                    var t = data.Tables["Clientes"].getWithAddedCol("C");
                    clientesProveedores = mapperToSeleccion7.Map(t).ToList();
                }
                if (data.Tables.Contains("Proveedores") && codError == "000")
                {
                    var t = data.Tables["Proveedores"].getWithAddedCol("P");
                    var r = mapperToSeleccion7.Map(t).ToList();
                    if (clientesProveedores != null)
                    {
                        clientesProveedores = clientesProveedores.Concat(r).ToList();
                    }
                    else
                    {
                        clientesProveedores = r;
                    }
                }
                forWiew.clientes = clientesProveedores;
                infoCliente.infoClientesProveedores = forWiew;
                infoCliente.ActionRoute             = "ClientesProveedores";
            }
            if (paso >= 8) //Direccion Negocio
            {
                DataNamesMapper <FromFormInfoDirecNeg> mapperToSeleccion8 = new DataNamesMapper <FromFormInfoDirecNeg>();
                infoCliente.infoNegocio = mapperToSeleccion8.Map(row);
                infoCliente.ActionRoute = "DireccionNegocio";
            }
            if (paso >= 9)  //Certificacion | Confirmacion Datos Negocio
            {
            }
            if (paso == 10) //Referencias Bancarias
            {
            }

            return(infoCliente);
        }