Example #1
0
        /// <summary>
        /// Exportacion de datos : usuario de servicio exterior
        /// </summary>
        /// <returns></returns>
        public FileContentResult PLus9XJE()
        {
            string TituloWorksheet = "Cuentas Corrientes";
            string NombreFileExcel = "CuentasCorrientes.xlsx";

            //string[] columns = { "OrganoServicio", "NumeroCuenta", "Moneda", "BancoAgencia", "SwiftBIC", "IBAN", "ABA", "RIB", "CBU", "BSB", "ABI", "CAB", "DestinoCuenta", "FechaApertura", "FechaCierre", "Autorizacion", "FechaAut", "Apoderado", "Beneficiario", "Domicilio1", "Domicilio2", "Domicilio3", "TransferenciaCtaOrigen", "TransferenciaTpDestino", "TransferenciaBancoInt", "TransferenciaRuteoInt", "Observaciones" };
            string[] columns = { "OrganoServicio", "NumeroCuenta", "Moneda", "BancoAgencia", "SwiftBIC", "IBAN", "ABA", "RIB", "CBU", "BSB", "ABI", "CAB", "DestinoCuenta", "FechaApertura", "FechaCierre", "Autorizacion", "FechaAut", "Apoderado", "Beneficiario", "Domicilio1", "Domicilio2", "Domicilio3", "Observaciones" };

            if (User != null)
            {
                if (this.IsPermitido())
                {
                    try
                    {
                        int OrganoServicio = Convert.ToInt16(Peach.DecriptText(User.OrganoServicio_CID));

                        List <RPCuentasCorrientes> Cuentas = new BLCuentaCorriente().ExportarCuentas(OrganoServicio).ToList();
                        if (Cuentas.Count > 0)
                        {
                            byte[] filecontent = ExcelExportHelper.ExportExcel(
                                Cuentas, TituloWorksheet,
                                String.Format("Exportado por {0} el {1} a las {2}.", User.Usuario, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString()),
                                true,
                                columns);

                            return(File(filecontent, ExcelExportHelper.ExcelContentType, NombreFileExcel));
                        }
                        else
                        {
                            return(File(Encoding.UTF8.GetBytes("No hay datos"), "text/plain", string.Format("Reporte.txt")));
                        }
                    }
                    catch (Exception ex)
                    {
                        return(File(Encoding.UTF8.GetBytes(ex.Message), "text/plain", string.Format("Error.txt")));
                    }
                }
                else
                {
                    return(File(Encoding.UTF8.GetBytes("Lo sentimos, no tiene permisos para exportar el reporte."), "text/plain", string.Format("Reporte.txt")));
                }
            }
            else
            {
                return(File(Encoding.UTF8.GetBytes("Error. No ha ingresado correctamente a la aplicación."), "text/plain", string.Format("Reporte.txt")));
            }
        }
Example #2
0
        /// <summary>
        /// Método de exportación a excel
        /// </summary>
        /// <returns></returns>
        public FileContentResult dklHc0hk()
        {
            string TituloWorksheet = "Cuentas Corrientes de Órganos de Servicio Exterior";
            string NombreFileExcel = "CuentasCorrientes.xlsx";

            string[] columns = { "OrganoServicio", "NumeroCuenta", "Moneda", "BancoAgencia", "SwiftBIC", "IBAN", "ABA", "RIB", "CBU", "BSB", "ABI", "CAB", "DestinoCuenta", "FechaApertura", "FechaCierre", "Autorizacion", "FechaAut", "Apoderado", "Beneficiario", "Domicilio1", "Domicilio2", "Domicilio3", "TransferenciaCtaOrigen", "TransferenciaTpDestino", "TransferenciaBancoInt", "TransferenciaRuteoInt", "Observaciones" };

            if (User != null)
            {
                if (this.IsPermitido())
                {
                    try
                    {
                        List <RPCuentasCorrientes> Cuentas = new BLCuentaCorriente().ExportarCuentas().ToList();
                        if (Cuentas.Count > 0)
                        {
                            byte[] filecontent = ExcelExportHelper.ExportExcel(
                                Cuentas, TituloWorksheet,
                                String.Format("Exportado por {0} el {1} a las {2}.", User.Usuario, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString()),
                                true,
                                columns);

                            return(File(filecontent, ExcelExportHelper.ExcelContentType, NombreFileExcel));
                        }
                        else
                        {
                            return(File(Encoding.UTF8.GetBytes("No hay datos"), "text/plain", string.Format("Reporte.txt")));
                        }
                    }
                    catch (Exception ex)
                    {
                        return(File(Encoding.UTF8.GetBytes(ex.Message), "text/plain", string.Format("Error.txt")));
                    }
                }
                else
                {
                    return(File(Encoding.UTF8.GetBytes("Ups! No tienes permisos. ;( sorry."), "text/plain", string.Format("Reporte.txt")));
                }
            }
            else
            {
                return(File(Encoding.UTF8.GetBytes("Ups! No estas logueado. =( sorry."), "text/plain", string.Format("Reporte.txt")));
            }
        }
Example #3
0
        public ActionResult VUyNXUxV(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var mnd = dat[0];
                    var bic = dat[1].Trim().ToUpper();
                    var rib = dat[2].Trim().ToUpper();

                    var abi = dat[3].Trim().ToUpper();
                    var ini = dat[4].Trim();
                    var doc = dat[5].Trim().ToUpper();

                    var cta = dat[6].Trim().ToUpper();
                    var des = dat[7];
                    var iba = dat[8].Trim().ToUpper();
                    var cbu = dat[9].Trim().ToUpper();
                    var cab = dat[10].Trim().ToUpper();
                    var fin = dat[11].Trim().ToUpper();
                    var fdo = dat[12].Trim();

                    var age = dat[13];
                    var rut = dat[14];
                    var aba = dat[15].Trim().ToUpper();
                    var bsb = dat[16].Trim().ToUpper();

                    var apo = dat[17];
                    var obs = dat[18].Trim().ToUpper();

                    var ben = dat[19].Trim().ToUpper();
                    var di1 = dat[20].Trim().ToUpper();
                    var di2 = dat[21].Trim().ToUpper();
                    var di3 = dat[22].Trim().ToUpper();
                    var sid = dat[23];


                    if (cta == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un número de cuenta";
                    }
                    else if (mnd == null)
                    {
                        globalResponse.ERR = "No ha seleccionado una moneda";
                    }
                    else if (age == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el banco / agencia";
                    }
                    else if (rut == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el código de ruteo";
                    }
                    else
                    {
                        int _Id  = Convert.ToInt16(Peach.DecriptFromBase64(sid));
                        int _mnd = Convert.ToInt16(Peach.DecriptText(mnd));
                        int _age = Convert.ToInt16(Peach.DecriptText(age));
                        int _rut = Convert.ToInt16(Peach.DecriptText(rut));
                        int _des = Convert.ToInt16(Peach.DecriptText(des));

                        BETransferenciaPlantilla oPlantilla = new BETransferenciaPlantilla();

                        BECuentaCorriente Cuenta = new BECuentaCorriente
                        {
                            Id           = _Id,
                            NumeroCuenta = cta,
                            Moneda       = new BEMoneda
                            {
                                Id = _mnd
                            },
                            Agencia = new BEAgenciaBancaria
                            {
                                Id = _age
                            },
                            CodigoRuteo = new ItemGenerico
                            {
                                IntValue = _rut
                            },
                            Iban  = iba,
                            Swift = bic,
                            ABA   = aba,

                            RIB = rib,
                            ABI = abi,
                            CBU = cbu,
                            CAB = cab,
                            BSB = bsb,

                            Destino = new ItemGenerico
                            {
                                IntValue = _des
                            },
                            FechaApertura = ini,
                            FechaCierre   = fin,
                            Documento     = new BEDocumento
                            {
                                Numero = doc,
                                Fecha  = fdo
                            },
                            EsCompartida = new ItemGenerico
                            {
                                IntValue = 0
                            },
                            Apoderado = new ItemGenerico
                            {
                                IntValue = (apo == "0" || apo == null) ? 0 : Convert.ToInt16(Peach.DecriptText(apo))
                            },
                            Observacion = obs,

                            BeneficiarioNombre = ben,
                            BeneficiarioDir1   = di1,
                            BeneficiarioDir2   = di2,
                            BeneficiarioDir3   = di3,

                            Plantilla = oPlantilla,
                            RowAudit  = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        // Validación
                        if (User.Perfil_Nombre == "RINDENTE")
                        {
                            Cuenta.Situacion = new ItemGenerico {
                                IntValue = (int)SitReg_Cuentas.PendienteDeAprobacion
                            };
                        }
                        else
                        {
                            Cuenta.Situacion = new ItemGenerico {
                                IntValue = (int)SitReg_Cuentas.RegistroAprobado
                            };
                        }

                        oResponse           = new BLCuentaCorriente().GrabarObservacion(Cuenta);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }