Beispiel #1
0
        protected void imprimir(Object sender, DataGridCommandEventArgs e)
        {
            string   codRedencion = ((DataBoundLiteralControl)e.Item.Cells[0].Controls[0]).Text.Replace("\n", "").Replace("\r", "").Replace("\t", "");
            Imprimir reporte      = new Imprimir();

            Label     lbvacio = new Label();
            DataTable dt      = new DataTable();

            string[] Formulas    = new string[0];
            string[] ValFormulas = new string[0];
            string   usuario     = ConfigurationManager.AppSettings["UID"];
            string   password    = ConfigurationManager.AppSettings["PWD"];
            Crypto   miCripto    = new Crypto(Crypto.CryptoProvider.TripleDES);

            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd = miCripto.DescifrarCadena(password);
            string nomA   = String.Format("Redencion_{0}", codRedencion);

            dt.Columns.Add("NOMBRE", typeof(string));
            dt.Columns.Add("VALOR", typeof(object));
            DataRow row = dt.NewRow();

            row[0] = "Codigo";
            row[1] = codRedencion;
            dt.Rows.Add(row);

            reporte.DtValPar = dt;
            reporte.PreviewReport2("VIP.Redencion", "", "", 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            Response.Write("<script language:javascript>w=window.open('" + reporte.Documento + "','','HEIGHT=600,WIDTH=600');</script>");

            ViewState["reporte"] = reporte.Documento;
        }
Beispiel #2
0
        private string imprimir(string codFactura)
        {
            Imprimir reporte = new Imprimir();

            Label     lbvacio = new Label();
            DataTable dt      = new DataTable();

            string[] Formulas    = new string[0];
            string[] ValFormulas = new string[0];
            string   usuario     = ConfigurationManager.AppSettings["UID"];
            string   password    = ConfigurationManager.AppSettings["PWD"];
            Crypto   miCripto    = new Crypto(Crypto.CryptoProvider.TripleDES);

            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd = miCripto.DescifrarCadena(password);
            string nomA   = String.Format("Factura_{0}", codFactura);

            dt.Columns.Add("NOMBRE", typeof(string));
            dt.Columns.Add("VALOR", typeof(object));
            DataRow row = dt.NewRow();

            row[0] = "Codigo";
            row[1] = codFactura;
            dt.Rows.Add(row);

            reporte.DtValPar = dt;
            reporte.PreviewReport2("VIP.Facturacion", "", "", 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);

            return(reporte.Documento);
        }
Beispiel #3
0
        protected void generarInforme()
        {
            Label lbvacio = new Label();

            string[] Formulas    = new string[8];
            string[] ValFormulas = new string[8];
            string   header      = "AMS_HEADER.rpt";
            string   footer      = "AMS_FOOTER.rpt";
            DataSet  tempDS      = new DataSet();

            //JFSC 11022008 Poner en comentario por no ser usado
            //string where = "";filtro="";
            //string[] filtros;
            Formulas[0] = "CLIENTE";
            Formulas[1] = "NIT";
            Formulas[2] = "TITULO";
            Formulas[3] = "TITULO1";
            Formulas[4] = "SELECCION1";
            Formulas[5] = "SELECCION2";
            Formulas[6] = "VERSION";
            Formulas[7] = "REPORTE";

            string empresa = DBFunctions.SingleData("select  cemp_nombre from dbxschema.cempresa");

            ValFormulas[0] = "" + empresa + "";         //nombre empresa
            string nit = DBFunctions.SingleData("select  mnit_nit from dbxschema.cempresa");

            DataSet datosReporte = new DataSet();

            ValFormulas[1] = "" + nit + "";
            ValFormulas[2] = "SOLICITUD DE PEDIDO VEHICULOS A PROVEEDOR "; //titulo rpt
            ValFormulas[3] = "SISTEMA DE VEHICULOS";                       //subtitulo Sistema de Nomina
            ValFormulas[4] = " ";                                          //año mes quince
            ValFormulas[5] = "";                                           //
            ValFormulas[6] = "ECAS - AMS VER 3.0.1";

            Imprimir funcion  = new Imprimir();
            string   servidor = ConfigurationManager.AppSettings["Server" + GlobalData.getEMPRESA()];
            string   database = ConfigurationManager.AppSettings["DataBase" + GlobalData.getEMPRESA()];
            string   usuario  = ConfigurationManager.AppSettings["UID"];
            string   password = ConfigurationManager.AppSettings["PWD" + GlobalData.getEMPRESA()];

            AMS.CriptoServiceProvider.Crypto miCripto = new Crypto(AMS.CriptoServiceProvider.Crypto.CryptoProvider.TripleDES);
            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd = miCripto.DescifrarCadena(password);
            //JFSC 11022008 Cambiar nombre de método y cantidad de parámetros
            string nomA = "Solicitud Vehiculos";

            funcion.PreviewReport2("AMS.Vehiculos.SolicitudDePedidosVehiculos", header, footer, 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            hl1.NavigateUrl = funcion.Documento;
            hl1.Visible     = true;
        }
Beispiel #4
0
        protected void generarInforme()
        {
            Label lbvacio = new Label();

            string[] Formulas    = new string[8];
            string[] ValFormulas = new string[8];
            string   header      = "AMS_HEADER.rpt";
            string   footer      = "AMS_FOOTER.rpt";
            DataSet  tempDS      = new DataSet();

            Formulas[0] = "CLIENTE";
            Formulas[1] = "NIT";
            Formulas[2] = "TITULO";
            Formulas[3] = "TITULO1";
            Formulas[4] = "SELECCION1";
            Formulas[5] = "SELECCION2";
            Formulas[6] = "VERSION";
            Formulas[7] = "REPORTE";

            string empresa = DBFunctions.SingleData("select  cemp_nombre from dbxschema.cempresa");

            ValFormulas[0] = "" + empresa + "";         //nombre empresa
            string nit = DBFunctions.SingleData("select  mnit_nit from dbxschema.cempresa");

            DataSet datosReporte = new DataSet();

            ValFormulas[1] = "" + nit + "";
            ValFormulas[2] = "SOLICITUD DE PEDIDO VEHICULOS CLIENTES MAYOR "; //titulo rpt
            ValFormulas[3] = "SISTEMA DE VEHICULOS";                          //subtitulo Sistema de Nomina
            ValFormulas[4] = " ";                                             //año mes quince
            ValFormulas[5] = "";                                              //
            ValFormulas[6] = "ECAS - AMS VER 3.0.1";

            Imprimir funcion  = new Imprimir();
            string   servidor = ConfigurationManager.AppSettings["Server" + GlobalData.getEMPRESA()];
            string   database = ConfigurationManager.AppSettings["DataBase" + GlobalData.getEMPRESA()];
            string   usuario  = ConfigurationManager.AppSettings["UID"];
            string   password = ConfigurationManager.AppSettings["PWD" + GlobalData.getEMPRESA()];

            AMS.CriptoServiceProvider.Crypto miCripto = new Crypto(AMS.CriptoServiceProvider.Crypto.CryptoProvider.TripleDES);
            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd = miCripto.DescifrarCadena(password);
            string nomA   = "Solicitud Vehiculos Mayor";

            funcion.PreviewReport2("AMS.Vehiculos.SolicitudDePedidosVehiculosMayor", header, footer, 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            Response.Write("<script language:javascript>w=window.open('" + funcion.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
            //Utils.MostrarAlerta(Response, "Pedido creado correctamente!");
            //funcion.ReportUnload();
            hl1.NavigateUrl = funcion.Documento;
            hl1.Visible     = true;
        }
Beispiel #5
0
        protected void imprimir_carta(string prefijo, string numero)
        {
            string prefPed = prefijo;
            string numPed  = numero;

            DBFunctions.NonQuery("drop view DBXSCHEMA.VVEHICULOS_PEDIDOSDEVEHICULOSCLIENTES_R");
            DBFunctions.NonQuery("CREATE VIEW DBXSCHEMA.VVEHICULOS_PEDIDOSDEVEHICULOSCLIENTES_R  AS SELECT *  FROM DBXSCHEMA.VVEHICULOS_PEDIDOSDEVEHICULOSCLIENTES where pdoc_codigo='" + prefPed + "' and mped_numepedi=" + numPed + " ");
            ConString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
            Label lbvacio = new Label();

            string[] Formulas    = new string[8];
            string[] ValFormulas = new string[8];
            string   header      = "AMS_HEADER.rpt";
            string   footer      = "AMS_FOOTER.rpt";
            DataSet  tempDS      = new DataSet();

            Formulas[0] = "CLIENTE";
            Formulas[1] = "NIT";
            Formulas[2] = "TITULO";
            Formulas[3] = "TITULO1";
            Formulas[4] = "SELECCION1";
            Formulas[5] = "SELECCION2";
            Formulas[6] = "VERSION";
            Formulas[7] = "REPORTE";

            string empresa = DBFunctions.SingleData("select  cemp_nombre from dbxschema.cempresa");

            ValFormulas[0] = "" + empresa + "";         //nombre empresa
            string nit = DBFunctions.SingleData("select  mnit_nit from dbxschema.cempresa");

            DataSet datosReporte = new DataSet();

            DBFunctions.Request(datosReporte, IncludeSchema.NO, "Select PMES_NOMBRE,PANO_DETALLE from DBXSCHEMA.CVEHICULOS CVEH , DBXSCHEMA.PANO PANO,DBXSCHEMA.PMES PMES WHERE PANO.PANO_ANO=CVEH.PANO_ANO AND PMES.PMES_MES=CVEH.PMES_MES");
            string mes = datosReporte.Tables[0].Rows[0][0].ToString();
            string ano = datosReporte.Tables[0].Rows[0][1].ToString();

            ValFormulas[1] = "" + nit + "";
            ValFormulas[2] = "CARTA DE BIENVENIDA";              //titulo rpt
            ValFormulas[3] = "SISTEMA DE VEHICULOS";             //subtitulo Sistema de Nomina
            ValFormulas[4] = "AÑO:" + ano + " MES:" + mes + " "; //año mes
            ValFormulas[5] = "";                                 //
            ValFormulas[6] = "ECAS - AMS VER 3.0.1";
            Imprimir funcion  = new Imprimir();
            string   servidor = ConfigurationManager.AppSettings["Server" + GlobalData.getEMPRESA()];
            string   database = ConfigurationManager.AppSettings["DataBase" + GlobalData.getEMPRESA()];
            string   usuario  = ConfigurationManager.AppSettings["UID"];
            string   password = ConfigurationManager.AppSettings["PWD" + GlobalData.getEMPRESA()];

            AMS.CriptoServiceProvider.Crypto miCripto = new Crypto(AMS.CriptoServiceProvider.Crypto.CryptoProvider.TripleDES);
            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd   = miCripto.DescifrarCadena(password);
            string nomA     = "Carta Bienvenida";
            string cartarpt = DBFunctions.SingleData("SELECT SFOR_NOMBRPT FROM SFORMATODOCUMENTOCRYSTAL WHERE SFOR_CODIGO = 'FORMCART';");

            try
            {
                funcion.PreviewReport2(cartarpt, header, footer, 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            }
            catch
            {
                funcion.PreviewReport2("AMS.Vehiculos.CartadeBienvenida", header, footer, 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            }

            Response.Write("<script language:javascript>w=window.open('" + funcion.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
        }
Beispiel #6
0
        protected void gen_rpt(object sender, EventArgs e)
        {
            DBFunctions.NonQuery("DROP VIEW DBXSCHEMA.VVEHICULOS_DOCUMENTOS_R");
            DBFunctions.NonQuery("create VIEW DBXSCHEMA.VVEHICULOS_DOCUMENTOS_R AS select * from dbxschema.vvehiculos_documentos where tipo='" + ddlcatalogoS + "' and VIN='" + ddlVinS + "'");

            ConString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
            Label lbvacio = new Label();

            string[] Formulas    = new string[8];
            string[] ValFormulas = new string[8];
            string   header      = "AMS_HEADER.rpt";
            string   footer      = "AMS_FOOTER.rpt";
            DataSet  tempDS      = new DataSet();

            //JFSC 11022008 Poner en comentario por no ser usado
            //string where = "",filtro="";
            //string[] filtros;
            Formulas[0] = "CLIENTE";
            Formulas[1] = "NIT";
            Formulas[2] = "TITULO";
            Formulas[3] = "TITULO1";
            Formulas[4] = "SELECCION1";
            Formulas[5] = "SELECCION2";
            Formulas[6] = "VERSION";
            Formulas[7] = "REPORTE";

            string empresa = DBFunctions.SingleData("select  cemp_nombre from dbxschema.cempresa");

            ValFormulas[0] = "" + empresa + "";         //nombre empresa
            string nit = DBFunctions.SingleData("select  mnit_nit from dbxschema.cempresa");

            DataSet datosReporte = new DataSet();
            string  ruta         = System.Configuration.ConfigurationManager.AppSettings["PathToPreviews"];

            ValFormulas[1] = "" + nit + "";
            ValFormulas[2] = "Acta Entrega Vehiculos"; //titulo rpt
            ValFormulas[3] = "SISTEMA DE VEHICULOS";   //subtitulo Sistema de Nomina
            ValFormulas[4] = "";                       //año mes quince
            ValFormulas[5] = "";                       //
            ValFormulas[6] = "ECAS - AMS VER 1.0.0.";
            Imprimir funcion  = new Imprimir();
            string   servidor = ConfigurationManager.AppSettings["Server" + GlobalData.getEMPRESA()];
            string   database = ConfigurationManager.AppSettings["DataBase" + GlobalData.getEMPRESA()];
            string   usuario  = ConfigurationManager.AppSettings["UID"];
            string   password = ConfigurationManager.AppSettings["PWD" + GlobalData.getEMPRESA()];

            AMS.CriptoServiceProvider.Crypto miCripto = new Crypto(AMS.CriptoServiceProvider.Crypto.CryptoProvider.TripleDES);
            miCripto.IV  = ConfigurationManager.AppSettings["VectorInicialEncriptacion"];
            miCripto.Key = ConfigurationManager.AppSettings["ValorConcatClavePrivada"];
            string newPwd = miCripto.DescifrarCadena(password);
            string nomA   = "Acta Entrega Vehiculos";

            funcion.PreviewReport2("AMS.Vehiculos.Documentos", header, footer, 1, 1, 1, "", "", nomA, "pdf", usuario, newPwd, Formulas, ValFormulas, lbvacio);
            Response.Write("<script language:javascript>w=window.open('" + funcion.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
            DatasToControls param = new DatasToControls();

            param.PutDatasIntoDropDownList(ddlcatalogo, "select distinct pcat_codigo from dbxschema.mvehiculo MV, MCATALOGOVEHICULO MC WHERE MC.MCAT_VIN = MV.MCat_VIN");
            param.PutDatasIntoDropDownList(ddlVin, "SELECT MV.MCAT_VIN AS VIN FROM MVEHICULO MV, mcatalogovehiculo MC WHERE MC.MCAT_VIN = MV.MCAT_VIN AND MC.PCAT_CODIGO='" + ddlcatalogo.SelectedValue + "'");
            param.PutDatasIntoDropDownList(ddlCodDoc, "select pdoc_codigo,pdoc_codigo concat '-'  concat pdoc_nombre from dbxschema.PDOCUMENTOVEHICULO");
            DataSet d = new DataSet();

            DBFunctions.Request(d, IncludeSchema.NO, "select MVEH_CODIGO,PCAT_CODIGO,mvd.MCAT_VIN,PDOC_CODIDOCU,MVEH_NUMEDOCU,MVEH_FECHINGRESO,MVEH_VALODOCU,MVEH_FECHENTREGA,MVEH_OBSERVAC,MVEH_NOMBRETRAMITA,TRES_SINO from dbxschema.mvehiculodocumento mvd, mcatalogovehiculo mc where PCAT_CODIGO='" + ddlcatalogo.SelectedValue + "' and mvd.mcat_vin='" + ddlVin.SelectedValue + "' and PDOC_CODIDOCU='" + ddlCodDoc.SelectedValue + "' and mvd.mcat_vin = mc.mcat_vin  ");
            if (d.Tables[0].Rows.Count > 0)
            {
                txtFechaDoc.Text     = d.Tables[0].Rows[0][5].ToString();
                txtValoDoc.Text      = d.Tables[0].Rows[0][6].ToString();
                txtFechaVencDoc.Text = d.Tables[0].Rows[0][7].ToString();
                txtObserva.Text      = d.Tables[0].Rows[0][8].ToString();
                txtTramitador.Text   = d.Tables[0].Rows[0][9].ToString();
                txtNumDoc.Text       = d.Tables[0].Rows[0][4].ToString();
            }
            else
            {
                txtFechaDoc.Text     = "";
                txtValoDoc.Text      = "";
                txtFechaVencDoc.Text = "";
                txtObserva.Text      = "";
                txtTramitador.Text   = "";
                txtNumDoc.Text       = "";
            }
        }