Пример #1
0
        public void ConsultaDeInversiones(string numero_Cedula_Socio, string numero_Socio)
        {
            JavaScriptSerializer json   = new JavaScriptSerializer();
            string             datoJson = string.Empty;
            List <Inversiones> lista    = new List <Inversiones>();

            try
            {
                //Valida Si existe Socio
                var persona = PersonaActor.DamePorIdentificacionSinVerificarExistencia(numero_Cedula_Socio);
                var cliente = ClienteActor.DameListaPorNumeroCliente(FBSSettingsEmpresa.LeeConfiguracion().Secuencial,
                                                                     int.Parse(numero_Socio), true, 0).FirstOrDefault();

                var estado = FBSSettingsEstadoDeposito.LeeConfiguracion();

                if (cliente != null)
                {
                    var listaInversiones = DepositoMaestroActor.DameListaPorSecuencialCliente(cliente.Secuencial).Where(x =>
                                                                                                                        x.CodigoEstadoDeposito == estado.Activo || x.CodigoEstadoDeposito == estado.Vencido ||
                                                                                                                        x.CodigoEstadoDeposito == estado.Exigible);
                    foreach (var item in listaInversiones)
                    {
                        lista.Add(new Inversiones(item.Codigo,
                                                  item.Monto));
                    }
                }

                var datosJson = new
                {
                    success              = true,
                    nombre_Socio         = persona.NombreUnido,
                    lista_De_Inversiones = lista
                };

                HttpContext.Current.Response.ContentType = "application/json";
                HttpContext.Current.Response.Write(json.Serialize(datosJson));
                HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            catch (Exception ex)
            {
                var datosJson = new
                {
                    success = false,
                    msg     = ex
                };

                HttpContext.Current.Response.ContentType = "application/json";
                HttpContext.Current.Response.Write(json.Serialize(datosJson));
                HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
        }
Пример #2
0
        public void ConsultaDeAhorrosCoopMetas(string numero_Cedula_Socio, string numero_Socio)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();
            string           datoJson = string.Empty;
            List <Prestamos> lista    = new List <Prestamos>();
            var estadoCuenta          = FBSSettingsEstadoCuenta.LeeConfiguracion();

            try
            {
                //Valida Si existe Socio
                var persona = PersonaActor.DamePorIdentificacionSinVerificarExistencia(numero_Cedula_Socio);
                var cliente = ClienteActor.DameListaPorNumeroCliente(FBSSettingsEmpresa.LeeConfiguracion().Secuencial,
                                                                     int.Parse(numero_Socio), true, 0).FirstOrDefault();

                if (cliente != null)
                {
                    CuentaMaestro cuentaAhorros = CuentaMaestroActor.DameListaPorSecuencialCliente(cliente.Secuencial).Where(x =>
                                                                                                                             (x.CodigoEstado == estadoCuenta.Activa || x.CodigoEstado == estadoCuenta.Inactiva) &&
                                                                                                                             x.CodigoTipoCuenta == FBSSettingsTipoCuenta.LeeConfiguracion().AhorroProgramado).OrderByDescending(x => x.Saldo).FirstOrDefault();


                    if (cuentaAhorros != null)
                    {
                        CuentaMaestro_AhorroInversion ahorroInversion = CuentaMaestro_AhorroInversionActor.DamePorSecuencialCuentaMaestroSinVerificarExistencia(cuentaAhorros.Secuencial);
                        if (ahorroInversion != null)
                        {
                            var datosJson = new
                            {
                                success      = true,
                                nombre_Socio = persona.NombreUnido,
                                saldo_Cuenta_Ahorro_CoopMetas = cuentaAhorros.Saldo,
                                fecha_Ahorro = ahorroInversion.FechaCancelacion.ToShortDateString(),
                                monto_Ahorro = ahorroInversion.ValorCobro
                            };

                            HttpContext.Current.Response.ContentType = "application/json";
                            HttpContext.Current.Response.Write(json.Serialize(datosJson));
                            HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                            HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                            HttpContext.Current.ApplicationInstance.CompleteRequest();
                        }
                        else
                        {
                            var datosJson = new
                            {
                                success = false,
                                msg     = "No se encontró ninguna cuenta de Ahorro Inversion"
                            };

                            HttpContext.Current.Response.ContentType = "application/json";
                            HttpContext.Current.Response.Write(json.Serialize(datosJson));
                            HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                            HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                            HttpContext.Current.ApplicationInstance.CompleteRequest();
                        }
                    }
                    else
                    {
                        var datosJson = new
                        {
                            success = false,
                            msg     = "No se encontró ninguna cuenta de Ahorros para el cliente"
                        };

                        HttpContext.Current.Response.ContentType = "application/json";
                        HttpContext.Current.Response.Write(json.Serialize(datosJson));
                        HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                        HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }
                }
            }
            catch (Exception ex)
            {
                var datosJson = new
                {
                    success = false,
                    msg     = ex
                };

                HttpContext.Current.Response.ContentType = "application/json";
                HttpContext.Current.Response.Write(json.Serialize(datosJson));
                HttpContext.Current.Response.Flush();                // Sends all currently buffered output to the client.
                HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client.
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
        }