Exemplo n.º 1
0
        private void OnDrawPage(object obj, Gtk.DrawPageArgs args)
        {
            PrintContext context = args.Context;

            Cairo.Context cr    = context.CairoContext;
            double        width = context.Width;

            cr.Rectangle(0, 0, width, headerHeight);
            cr.SetSourceRGB(0.8, 0.8, 0.8);
            cr.FillPreserve();

            cr.SetSourceRGB(0, 0, 0);
            cr.LineWidth = 1;
            cr.Stroke();

            Pango.Layout layout = context.CreatePangoLayout();

            Pango.FontDescription desc = Pango.FontDescription.FromString("sans 14");
            layout.FontDescription = desc;

            layout.SetText(fileName);
            layout.Width     = (int)width;
            layout.Alignment = Pango.Alignment.Center;

            int layoutWidth, layoutHeight;

            layout.GetSize(out layoutWidth, out layoutHeight);
            double textHeight = (double)layoutHeight / (double)pangoScale;

            cr.MoveTo(width / 2, (headerHeight - textHeight) / 2);
            Pango.CairoHelper.ShowLayout(cr, layout);

            string pageStr = String.Format("{0}/{1}", args.PageNr + 1, numPages);

            layout.SetText(pageStr);
            layout.Alignment = Pango.Alignment.Right;

            cr.MoveTo(width - 2, (headerHeight - textHeight) / 2);
            Pango.CairoHelper.ShowLayout(cr, layout);

            layout = null;
            layout = context.CreatePangoLayout();

            desc      = Pango.FontDescription.FromString("mono");
            desc.Size = (int)(fontSize * pangoScale);
            layout.FontDescription = desc;

            cr.MoveTo(0, headerHeight + headerGap);
            int line = args.PageNr * linesPerPage;

            for (int i = 0; i < linesPerPage && line < numLines; i++)
            {
                layout.SetText(lines[line]);
                Pango.CairoHelper.ShowLayout(cr, layout);
                cr.RelMoveTo(0, fontSize);
                line++;
            }
            (cr as IDisposable).Dispose();
            layout = null;
        }
Exemplo n.º 2
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();
            TreeIter      iter;
            string        toma_descrip_prod;
            string        toma_descrip_alm;

            if (this.treeViewEngineFarmacia.GetIterFirst(out iter))
            {
                imprime_encabezado(cr, layout);
                while (this.treeViewEngineFarmacia.IterNext(ref iter))
                {
                    toma_descrip_alm = (string)this.treeViewEngineFarmacia.GetValue(iter, 11);
                    if (toma_descrip_alm.Length > 22)
                    {
                        toma_descrip_alm = toma_descrip_alm.Substring(0, 21);
                    }

                    toma_descrip_alm = (string)this.treeViewEngineFarmacia.GetValue(iter, 11);
                    if (toma_descrip_alm.Length > 22)
                    {
                        toma_descrip_alm = toma_descrip_alm.Substring(0, 21);
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected override void OnDrawPage(PrintContext context, int page_nr)
        {
            Context cairoContext;

            if (previewSurface != null)
            {
                var file   = System.IO.Path.GetTempFileName();
                var target = new SvgSurface(file,
                                            formArea.Width,
                                            formArea.Height);
                cairoContext = new Context(target);
                pageFiles.Add(file);
            }
            else
            {
                cairoContext = context.CairoContext;
            }

            pageContexts.Add(cairoContext);

            using (var dp = new DrawingProviderCairo(cairoContext, context.CreatePangoLayout())) {
                dp.DrawingScaleX            = drawingScaleX;
                dp.DrawingScaleY            = drawingScaleY;
                formToPrint.DrawingProvider = dp;

                formToPrint.Draw(page_nr, new PointD());
            }
        }
Exemplo n.º 4
0
 void ejecutar_consulta_reporte(PrintContext context)
 {
     Cairo.Context         cr     = context.CairoContext;
     Pango.Layout          layout = context.CreatePangoLayout();
     Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
     // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
     fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
     desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
 }
Exemplo n.º 5
0
        void crea_consentimiento(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            crea_encbezado(cr, layout);
            formato_consentimiento2(cr, layout);
        }
Exemplo n.º 6
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            string descripcion_producto_aplicado;
            int    idgrupoproducto;

            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            fontSize  = 7.0;                                                                                 layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);                               layout.FontDescription = desc;
            imprime_encabezado(cr, layout);
        }
Exemplo n.º 7
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             *      ContextoImp.BeginPage("Pagina 1");
             *
             *      cantidad_de_letras = classpublic.ConvertirCadena(total_descuento.ToString("F"),"PESO");
             *      Gnome.Font fuente2 = Gnome.Font.FindClosest("Bitstream Vera Sans", 8);
             *      //Gnome.Font fuente3 = Gnome.Font.FindClosest("Bitstream Vera Sans", 10);
             *
             *      // ESTA FUNCION ES PARA QUE EL TEXTO SALGA EN NEGRITA
             *      //Gnome.Font fuente4 = Gnome.Font.FindClosestFromWeightSlant("Bitstream Vera Sans", FontWeight.Bold ,false, 12);
             *      //Gnome.Font fuente5 = Gnome.Font.FindClosestFromWeightSlant("Bitstream Vera Sans", FontWeight.Bold ,false, 10);
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *
             *      ContextoImp.MoveTo(400, 780);			ContextoImp.Show(DateTime.Now.ToString("dd        MM     yyyy") );
             *      ContextoImp.MoveTo(130, 740);			ContextoImp.Show(nombredoctor);
             *      ContextoImp.MoveTo(530, 710);			ContextoImp.Show("X" );
             *  ContextoImp.MoveTo(70, 660);			ContextoImp.Show("Pagos de Honorarios Medicos / Folio :"+ folio_servicio.Trim()+" Paciente :"+nombre_paciente.Trim());
             * ContextoImp.MoveTo(100, 650);			ContextoImp.Show(tipo_paciente);
             * ContextoImp.MoveTo(70, 640);			ContextoImp.Show(aseguradora);
             *  ContextoImp.MoveTo(130, 690);			ContextoImp.Show("("+ cantidad_de_letras + ")");
             *  ContextoImp.MoveTo(405, 620);			ContextoImp.Show(hono_medico.ToString("C"));
             *  ContextoImp.MoveTo(460, 620);			ContextoImp.Show(descuento_hono_medico.ToString("C"));
             *  ContextoImp.MoveTo(445, 620);			ContextoImp.Show(" - ");
             *  ContextoImp.MoveTo(170, 720);			ContextoImp.Show(total_descuento.ToString("C"));
             *  ContextoImp.MoveTo(370, 620);			ContextoImp.Show("Total:");
             *  ContextoImp.MoveTo(500, 620);			ContextoImp.Show(total_descuento.ToString("C"));
             *      ContextoImp.ShowPage();
             */
        }
Exemplo n.º 8
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            //string mesage_1 = "NO Tiene Comprobante de Servicio";
            //string mesage_2 = "NO Tiene Comprobante de PAGO o ABONO";
            //string mesage_3 = "NO Tiene Comprobante de PAGARE";
            //string mesage_4 = "NO Tiene PASE QX/URGENCIA";
            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();


            comienzo_linea = 85;
            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);

            // Verifica que la base de datos este conectada
            try{
                imprime_encabezado(cr, layout);
                fontSize  = 8.0; layout = context.CreatePangoLayout();
                desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc;

                conexion.Open();
                NpgsqlCommand comando;
                comando = conexion.CreateCommand();

                int    folioservicio = 0;
                string query_fechas  = " AND to_char(osiris_erp_cobros_enca.fechahora_creacion,'yyyy-MM-dd') >= '" + entry_ano1.Text + "-" + entry_mes1.Text + "-" + entry_dia1.Text + "' " +
                                       " AND to_char(osiris_erp_cobros_enca.fechahora_creacion,'yyyy-MM-dd') <= '" + entry_ano2.Text + "-" + entry_mes2.Text + "-" + entry_dia2.Text + "' ";
                comando.CommandText = "SELECT osiris_erp_cobros_enca.folio_de_servicio,osiris_erp_cobros_enca.pid_paciente AS pidpaciente, " +
                                      "osiris_his_paciente.nombre1_paciente || ' ' || osiris_his_paciente.nombre2_paciente || ' ' || osiris_his_paciente.apellido_paterno_paciente || ' ' || osiris_his_paciente.apellido_materno_paciente AS nombre_completo," +
                                      "osiris_erp_cobros_enca.fechahora_creacion " +
                                      "FROM osiris_erp_cobros_enca,osiris_his_paciente " +
                                      "WHERE osiris_erp_cobros_enca.pid_paciente = osiris_his_paciente.pid_paciente " +
                                      "AND cancelado = 'false' " +
                                      query_fechas + " ORDER BY osiris_erp_cobros_enca.folio_de_servicio;";
                Console.WriteLine(comando.CommandText.ToString());
                NpgsqlDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    folioservicio = (int)lector["folio_de_servicio"];
                    //Console.WriteLine(folioservicio.ToString());
                    if ((string)classpublic.lee_registro_de_tabla("osiris_erp_comprobante_servicio", "folio_de_servicio", "WHERE folio_de_servicio = '" + folioservicio.ToString().Trim() + "'", "folio_de_servicio", "int") == "")
                    {
                        //Console.WriteLine(folioservicio.ToString().Trim()+" NO Tiene Comprobante de Servicio ");
                        if ((string)classpublic.lee_registro_de_tabla("osiris_erp_abonos", "folio_de_servicio", "WHERE folio_de_servicio = '" + folioservicio.ToString().Trim() + "' AND honorario_medico = 'false' ", "folio_de_servicio", "int") == "")
                        {
                            //Console.WriteLine(folioservicio.ToString().Trim()+" NO Tiene Comprobante de PAGO o ABONO ");
                            if ((string)classpublic.lee_registro_de_tabla("osiris_erp_comprobante_pagare", "folio_de_servicio", "WHERE folio_de_servicio = '" + folioservicio.ToString().Trim() + "' ", "folio_de_servicio", "int") == "")
                            {
                                //Console.WriteLine(folioservicio.ToString().Trim()+" NO Tiene Comprobante de PAGARE ");
                                if ((string)classpublic.lee_registro_de_tabla("osiris_erp_pases_qxurg", "folio_de_servicio", "WHERE folio_de_servicio = '" + folioservicio.ToString().Trim() + "' ", "folio_de_servicio", "int") == "")
                                {
                                    //Console.WriteLine(folioservicio.ToString().Trim()+" NO Tiene PASE QX/URGENCIA ");
                                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText("FECHA :" + (string)lector["fechahora_creacion"].ToString() + "N° Atencion :" + folioservicio.ToString() + "      Expediente: " + (string)lector["pidpaciente"].ToString() + "  Paciente: " + (string)lector["nombre_completo"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                                    comienzo_linea += separacion_linea;
                                    salto_de_pagina(cr, layout);
                                    fontSize  = 8.0; layout = context.CreatePangoLayout();
                                    desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc;
                                }
                            }
                        }
                    }
                }
            }catch (NpgsqlException ex) {
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Error, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();                             msgBoxError.Destroy();
            }
            conexion.Close();
        }
Exemplo n.º 9
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * ContextoImp.BeginPage("Pagina "+numpage.ToString());
             * imprime_encabezado(ContextoImp,trabajoImpresion);
             *
             * //Encabezado de pagina
             *
             * NpgsqlConnection conexion;
             * conexion = new NpgsqlConnection (connectionString+nombrebd );
             *
             * // Verifica que la base de datos este conectada
             * try{
             *      conexion.Open ();
             *      NpgsqlCommand comando;
             *      comando = conexion.CreateCommand ();
             *
             *      comando.CommandText = query_facturas;
             *
             *      NpgsqlDataReader lector = comando.ExecuteReader ();
             *
             *      while (lector.Read()){
             *              //Console.WriteLine(" entre");
             *              numerofactura = (int) lector["numero_factura"];
             *              totalfactura = (string) lector["totalfactura"].ToString().Trim();
             *              fechadefectura = (string) lector["fechadefectura"];
             *              foliodeservicio = (int) lector["folio_de_servicio"];
             *              nombrepaciente = (string) lector["nombre1_paciente"] + " " + lector["nombre2_paciente"] + " "+ lector["apellido_paterno_paciente"] + " " +  lector["apellido_materno_paciente"];
             *              fecha_de_envio = (string) lector["fechadeenvio"];
             *              descripcioncliente = (string) lector["descripcion_cliente"];
             *              pagado = Convert.ToString((bool) lector["pagado"]);
             *              //Console.WriteLine(numerofactura);
             *              if(descripcioncliente.Length > 27){
             *                      descripcionclienterecortado = descripcioncliente.Substring(0,27);
             *              }else{
             *                      descripcionclienterecortado = descripcioncliente;
             *              }
             *              if (nombrepaciente.Length > 27){
             *                      nombrepacienterecortado = nombrepaciente.Substring(0,27);
             *              }else{
             *                      nombrepacienterecortado = nombrepaciente;
             *              }
             *              Gnome.Print.Setfont(ContextoImp,fuente1);
             * ContextoImp.MoveTo(33, filas);		ContextoImp.Show(numerofactura.ToString());
             *              ContextoImp.MoveTo(110, filas);		ContextoImp.Show(totalfactura);
             *              ContextoImp.MoveTo(65, filas);		ContextoImp.Show(fechadefectura);
             *              ContextoImp.MoveTo(155, filas);		ContextoImp.Show(foliodeservicio.ToString());
             *              ContextoImp.MoveTo(195, filas);		ContextoImp.Show(fecha_de_envio);
             *              ContextoImp.MoveTo(275, filas);		ContextoImp.Show(nombrepacienterecortado);
             *              ContextoImp.MoveTo(245, filas);		ContextoImp.Show(pagado);
             *      ContextoImp.MoveTo(400, filas);		ContextoImp.Show(descripcionclienterecortado);
             *              ContextoImp.MoveTo(20, filas);		ContextoImp.Show(total_facturas_enviadas.ToString());
             *              contador += 1;
             *              total_facturas_enviadas += 1;
             *              filas -= 10;
             *
             *              salto_pagina(ContextoImp,trabajoImpresion);
             *      }
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente4);
             *      ContextoImp.MoveTo(20, 70);            ContextoImp.Show("TOTAL FACTURAS ENVIADAS:");
             *      ContextoImp.MoveTo(20.5, 70);            ContextoImp.Show("TOTAL FACTURAS ENVIADAS:");
             *      ContextoImp.MoveTo(360, 70);           ContextoImp.Show("TOTAL MONTO FACTURAS:");
             *      ContextoImp.MoveTo(360.5, 70);           ContextoImp.Show("TOTAL MONTO FACTURAS:");
             *      Gnome.Print.Setfont(ContextoImp,fuente5);
             *      ContextoImp.MoveTo(170, 70);            ContextoImp.Show(total_facturas_enviadas.ToString());
             *      ContextoImp.MoveTo(495, 70);           ContextoImp.Show(total_monto_facturas.ToString());
             *
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente);
             *      ContextoImp.MoveTo(270, 744);           ContextoImp.Show( titulo+"");
             *      ContextoImp.MoveTo(270.5, 744);           ContextoImp.Show( titulo+"");
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente2);
             *      ContextoImp.MoveTo(300, 758);            ContextoImp.Show("SISTEMA HOSPITALARIO OSIRIS");
             *  ContextoImp.MoveTo(20, 752);            ContextoImp.Show("SISTEMA HOSPITALARIO OSIRIS");
             *      ContextoImp.MoveTo(20, 744);            ContextoImp.Show("Direccion:");
             *      ContextoImp.MoveTo(20, 736);            ContextoImp.Show("Conmutador:");
             *      ContextoImp.MoveTo(340, 730);			ContextoImp.Show("PAGINA "+numpage);
             *      ContextoImp.MoveTo(340.5, 730);			ContextoImp.Show("PAGINA ");
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente4);
             *  ContextoImp.MoveTo(60, 720);			ContextoImp.Show(entry_buscar);
             *      ContextoImp.MoveTo(60.5, 720);			ContextoImp.Show(entry_buscar);
             *  ContextoImp.MoveTo(455, 720);			ContextoImp.Show(fecha_de_envio);
             *      ContextoImp.MoveTo(455.5, 720);			ContextoImp.Show(fecha_de_envio);
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente4);
             *      ContextoImp.MoveTo(20, 720);			ContextoImp.Show("Cliente:");
             *      ContextoImp.MoveTo(20.5, 720);			ContextoImp.Show("Cliente:");
             *      ContextoImp.MoveTo(390, 720);			ContextoImp.Show("Fecha Envio:");
             *      ContextoImp.MoveTo(390.5, 720);			ContextoImp.Show("Fecha Envio:");
             *      ContextoImp.MoveTo(390, 710);			ContextoImp.Show("Fecha Impresion: "+DateTime.Now.ToString("dd-MM-yyyy HH:mm"));
             *      ContextoImp.MoveTo(390.5, 710);			ContextoImp.Show("Fecha Impresion:");
             *
             *      Gnome.Print.Setfont(ContextoImp,fuente1);
             *      ContextoImp.MoveTo(20, 700);            ContextoImp.Show("Nº de Factura:");
             *      ContextoImp.MoveTo(20.5, 700);          ContextoImp.Show("Nº de Factura:");
             *      ContextoImp.MoveTo(65, 700);			ContextoImp.Show("Fecha Factura:");
             *      ContextoImp.MoveTo(65.5, 700);			ContextoImp.Show("Fecha Factura:");
             *      ContextoImp.MoveTo(110, 700);			ContextoImp.Show("Monto Factura:");
             *      ContextoImp.MoveTo(110.5, 700);			ContextoImp.Show("Monto Factura:");
             *      ContextoImp.MoveTo(155, 700);			ContextoImp.Show("No. Atencion:");
             *      ContextoImp.MoveTo(155.5, 700);			ContextoImp.Show("No. Atencion:");
             *      ContextoImp.MoveTo(195, 700);			ContextoImp.Show("Fecha de Envio:");
             *      ContextoImp.MoveTo(195.5, 700);			ContextoImp.Show("Fecha de Envio:");
             *      ContextoImp.MoveTo(245, 700);			ContextoImp.Show("Pagado:");
             *      ContextoImp.MoveTo(245.5, 700);			ContextoImp.Show("Pagado:");
             *      ContextoImp.MoveTo(275, 700);			ContextoImp.Show("Paciente:");
             *      ContextoImp.MoveTo(275.5, 700);			ContextoImp.Show("Paciente:");
             *      ContextoImp.MoveTo(400, 700);			ContextoImp.Show("Cliente:");
             *      ContextoImp.MoveTo(400.5, 700);			ContextoImp.Show("Cliente:");
             *      filas = 750;
             *      ContextoImp.ShowPage();
             *
             * }catch (NpgsqlException ex){
             *      MessageDialog msgBoxError = new MessageDialog (MyWinError,DialogFlags.DestroyWithParent,
             *                                                     MessageType.Error,
             *                                                     ButtonsType.Close,"PostgresSQL error: {0}",ex.Message);
             *      msgBoxError.Run ();		msgBoxError.Destroy();
             * }
             * conexion.Close();
             */
        }
Exemplo n.º 10
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            decimal total_inventario          = 0;
            int     idgrupoproducto           = 0;
            string  descriopciongrupoproducto = "";
            decimal totales_x_grupo           = 0;

            //Array stringArray = Array.CreateInstance(typeof(String), 20, 2);
            //stringArray.SetValue("Mahesh", 0,0);

            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();
            imprime_encabezado(cr, layout);
            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);
            // Verifica que la base de datos este conectada
            try{
                conexion.Open();
                NpgsqlCommand comando;
                comando = conexion.CreateCommand();
                Console.WriteLine(query_consulta);
                comando.CommandText = query_consulta;

                NpgsqlDataReader lector = comando.ExecuteReader();
                if (lector.Read())
                {
                    idgrupoproducto           = int.Parse(lector["idgrupoproducto"].ToString());
                    descriopciongrupoproducto = lector["descripcion_grupo_producto"].ToString().Trim();
                    comienzo_linea            = 80;
                    fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
                    desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
                    layout.FontDescription.Weight = Weight.Bold;                                // Letra negrita
                    cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_grupo_producto"].ToString().Trim());                         Pango.CairoHelper.ShowLayout(cr, layout);
                    layout.FontDescription.Weight = Weight.Normal;
                    comienzo_linea += separacion_linea;
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["idproducto"].ToString().Trim());                         Pango.CairoHelper.ShowLayout(cr, layout);
                    if (lector["descripcion_producto"].ToString().Length > 65)
                    {
                        cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_producto"].ToString().Trim().Substring(0, 65));                               Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    else
                    {
                        cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_producto"].ToString().Trim());                               Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    cr.MoveTo(340 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["stock"].ToString());                             Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(420 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproducto"].ToString())));               Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["embalaje"].ToString());          Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(540 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim())));                Pango.CairoHelper.ShowLayout(cr, layout);
                    if (tipo_reporte == "inventario_fisico")
                    {
                        cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:F}", decimal.Parse(lector["porcentageganancia"].ToString().Trim())));           Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    if (tipo_reporte == "cargos_x_fecha")
                    {
                        cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["stock"].ToString());             Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    if (tipo_reporte == "inventario_actual")
                    {
                        cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["stock"].ToString());             Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    totales_x_grupo  += decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString());
                    total_inventario += decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString());
                    comienzo_linea   += separacion_linea;
                    while (lector.Read())
                    {
                        if (idgrupoproducto != int.Parse(lector["idgrupoproducto"].ToString()))
                        {
                            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
                            layout.FontDescription.Weight = Weight.Bold;                                        // Letra negrita
                            if (tipo_reporte == "inventario_fisico")
                            {
                                cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                                cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                            }
                            if (tipo_reporte == "cargos_x_fecha")
                            {
                                cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                                cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                                //cr.MoveTo(680*escala_en_linux_windows, comienzo_linea*escala_en_linux_windows);			layout.SetText(string.Format("{0:C}",totales_x_grupo));		Pango.CairoHelper.ShowLayout (cr, layout);
                            }
                            if (tipo_reporte == "inventario_actual")
                            {
                                cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                                cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                            }
                            comienzo_linea = 531;
                            salto_de_pagina(cr, layout);
                            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
                            layout.FontDescription.Weight = Weight.Bold;                                        // Letra negrita
                            cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_grupo_producto"].ToString().Trim());                         Pango.CairoHelper.ShowLayout(cr, layout);
                            comienzo_linea += separacion_linea;
                            salto_de_pagina(cr, layout);
                            idgrupoproducto           = int.Parse(lector["idgrupoproducto"].ToString());
                            descriopciongrupoproducto = lector["descripcion_grupo_producto"].ToString().Trim();
                            totales_x_grupo           = 0;
                            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
                            layout.FontDescription.Weight = Weight.Normal;                                      // Letra normal
                        }
                        cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["idproducto"].ToString().Trim());                         Pango.CairoHelper.ShowLayout(cr, layout);
                        if (lector["descripcion_producto"].ToString().Length > 65)
                        {
                            cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_producto"].ToString().Trim().Substring(0, 65));                               Pango.CairoHelper.ShowLayout(cr, layout);
                        }
                        else
                        {
                            cr.MoveTo(65 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(lector["descripcion_producto"].ToString().Trim());                               Pango.CairoHelper.ShowLayout(cr, layout);
                        }
                        cr.MoveTo(340 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["stock"].ToString());                             Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(420 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproducto"].ToString())));               Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["embalaje"].ToString());          Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(540 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim())));                Pango.CairoHelper.ShowLayout(cr, layout);
                        if (tipo_reporte == "inventario_fisico")
                        {
                            cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:F}", decimal.Parse(lector["porcentageganancia"].ToString().Trim())));           Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                        }
                        if (tipo_reporte == "cargos_x_fecha")
                        {
                            cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(lector["stock"].ToString());             Pango.CairoHelper.ShowLayout(cr, layout);
                        }
                        if (tipo_reporte == "inventario_actual")
                        {
                            cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:F}", decimal.Parse(lector["porcentageganancia"].ToString().Trim())));           Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString())));            Pango.CairoHelper.ShowLayout(cr, layout);
                        }
                        totales_x_grupo  += decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString());
                        total_inventario += decimal.Parse(lector["costoproductounitario"].ToString().Trim()) * decimal.Parse(lector["stock"].ToString());
                        comienzo_linea   += separacion_linea;
                        salto_de_pagina(cr, layout);
                    }
                    desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
                    layout.FontDescription.Weight = Weight.Bold;                                // Letra negrita
                    if (tipo_reporte == "inventario_fisico")
                    {
                        cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                        comienzo_linea += separacion_linea;
                        salto_de_pagina(cr, layout);
                        //cr.MoveTo(680*escala_en_linux_windows, comienzo_linea*escala_en_linux_windows);			layout.SetText(string.Format("{0:C}",total_inventario));		Pango.CairoHelper.ShowLayout (cr, layout);
                    }
                    if (tipo_reporte == "cargos_x_fecha")
                    {
                        cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(600 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                        comienzo_linea += separacion_linea;
                        salto_de_pagina(cr, layout);
                        //cr.MoveTo(600*escala_en_linux_windows, comienzo_linea*escala_en_linux_windows);			layout.SetText(string.Format("{0:C}",total_inventario));		Pango.CairoHelper.ShowLayout (cr, layout);
                    }
                    if (tipo_reporte == "inventario_actual")
                    {
                        cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText("TOTAL " + descriopciongrupoproducto);             Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(680 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText(string.Format("{0:C}", totales_x_grupo));         Pango.CairoHelper.ShowLayout(cr, layout);
                        comienzo_linea += separacion_linea;
                        salto_de_pagina(cr, layout);
                        //cr.MoveTo(680*escala_en_linux_windows, comienzo_linea*escala_en_linux_windows);			layout.SetText(string.Format("{0:C}",total_inventario));		Pango.CairoHelper.ShowLayout (cr, layout);
                    }
                }
            }catch (NpgsqlException ex) {
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Warning, ButtonsType.Ok, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();             msgBoxError.Destroy();
                Console.WriteLine("PostgresSQL error: {0}", ex.Message);
                return;
            }
        }
Exemplo n.º 11
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * int filas = 735;
             * ContextoImp.BeginPage("Pagina 1");
             * Gnome.Print.Setfont (ContextoImp,fuente8);
             * ContextoImp.MoveTo(500, filas);	ContextoImp.Show(fechafactura);
             * filas -= 15;
             * filas -= 15;
             * ContextoImp.MoveTo(030, filas);		ContextoImp.Show(nombrecliente);
             * ContextoImp.MoveTo(497, filas-8);	ContextoImp.Show("CONTADO");
             * filas -= 15;
             * ContextoImp.MoveTo(030, filas);	ContextoImp.Show(direccioncliente+" "+coloniacliente+" "+cpcliente);
             * filas -= 15;
             * ContextoImp.MoveTo(030, filas);	ContextoImp.Show(municipiocliente+" "+estadocliente);
             * ContextoImp.MoveTo(492, filas-8);	ContextoImp.Show("MONTERREY, NL.");
             * filas -= 15;
             * ContextoImp.MoveTo(030, filas);	ContextoImp.Show("R.F.C "+rfccliente);
             * filas -= 15;
             * filas -= 15;
             * bool varpaso = false;
             * decimal variable_paso_03 = 0;
             * Gnome.Print.Setfont (ContextoImp,fuente7);
             * TreeIter iter;
             * if (treeViewEngineDetaFact.GetIterFirst (out iter)){
             *      if ((string)treeview_detalle_de_factura.Model.GetValue (iter,3) == ""){
             *      ContextoImp.MoveTo(090, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,1));
             *      filas -= 08;
             *      }else{
             *
             *      //////
             *              if((bool) treeview_detalle_de_factura.Model.GetValue (iter,4) == false){
             *                              ContextoImp.MoveTo(090, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,1));
             *                              //ContextoImp.MoveTo(450, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,2));
             *                              if ((string)treeview_detalle_de_factura.Model.GetValue (iter,3) == ""){
             *                                      ContextoImp.MoveTo(510, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue(iter,3));
             *                              }else{
             *                                      ContextoImp.MoveTo(510, filas);	ContextoImp.Show(decimal.Parse((string)treeview_detalle_de_factura.Model.GetValue(iter,3)).ToString("C"));
             *                              }
             *                              filas -= 08;
             *                      }else{
             *                              if(varpaso == false){
             *                                      filas = 310;
             *                                      varpaso = true;
             *                              }
             *                              ContextoImp.MoveTo(090, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,1));
             *                              if ((string)treeview_detalle_de_factura.Model.GetValue (iter,3) == ""){
             *                                      ContextoImp.MoveTo(510, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue(iter,3));
             *                              }else{
             *                                      ContextoImp.MoveTo(510, filas);	ContextoImp.Show(decimal.Parse((string)treeview_detalle_de_factura.Model.GetValue(iter,3)).ToString("C"));
             *                              }
             *                              filas -= 08;
             *
             *              }
             *      }
             *      //////
             *      while (treeViewEngineDetaFact.IterNext(ref iter)){
             *              if((bool) treeview_detalle_de_factura.Model.GetValue (iter,4) == false){
             *                      ContextoImp.MoveTo(090, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,1));
             *                      //ContextoImp.MoveTo(450, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,2));
             *                      if ((string)treeview_detalle_de_factura.Model.GetValue (iter,3) == ""){
             *                              ContextoImp.MoveTo(510, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue(iter,3));
             *                      }else{
             *                              ContextoImp.MoveTo(510, filas);	ContextoImp.Show(decimal.Parse((string)treeview_detalle_de_factura.Model.GetValue(iter,3)).ToString("C"));
             *                      }
             *                      filas -= 08;
             *              }else{
             *                      if(varpaso == false){
             *                              filas = 310;
             *                              varpaso = true;
             *                      }
             *                      ContextoImp.MoveTo(090, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue (iter,1));
             *                      if ((string)treeview_detalle_de_factura.Model.GetValue (iter,3) == ""){
             *                              ContextoImp.MoveTo(510, filas);	ContextoImp.Show((string) treeview_detalle_de_factura.Model.GetValue(iter,3));
             *                      }else{
             *                              ContextoImp.MoveTo(510, filas);	ContextoImp.Show(decimal.Parse((string)treeview_detalle_de_factura.Model.GetValue(iter,3)).ToString("C"));
             *                      }
             *                      filas -= 08;
             *              }
             *      }
             * }
             * Gnome.Print.Setfont (ContextoImp,fuente8);
             * filas = 222;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(subtotal_15.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(030, filas+2);	ContextoImp.Show("("+catidadenletras.ToUpper()+")");
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(subtotal_0.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(totaliva.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(subtotal.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(deducible.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(totalcoaseguro.PadLeft(10));
             * filas -= 14;
             * ContextoImp.MoveTo(500, filas);		ContextoImp.Show(totalfactura.PadLeft(10));
             * filas -= (14*6);
             * ContextoImp.MoveTo(300, filas);		ContextoImp.Show(LoginEmpleado+"/"+numerofactura.ToString());
             * ContextoImp.ShowPage();
             */
        }
Exemplo n.º 12
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);

            // Verifica que la base de datos este conectada
            try{
                conexion.Open();
                NpgsqlCommand comando;
                comando             = conexion.CreateCommand();
                comando.CommandText = "SELECT " +
                                      "osiris_erp_cobros_enca.folio_de_servicio,osiris_erp_cobros_enca.pid_paciente, osiris_erp_cobros_enca.id_empleado_admision,osiris_erp_cobros_enca.nombre_medico_encabezado,osiris_erp_cobros_enca.id_medico," +
                                      "osiris_his_paciente.nombre1_paciente,osiris_his_paciente.nombre2_paciente,osiris_his_paciente.apellido_paterno_paciente,osiris_his_paciente.apellido_materno_paciente, " +
                                      "to_char(fecha_nacimiento_paciente, 'dd-MM-yyyy') AS fecha_nac_pa,osiris_his_paciente.sexo_paciente,osiris_his_paciente.direccion_paciente,osiris_his_paciente.numero_casa_paciente, " +
                                      "osiris_his_paciente.numero_departamento_paciente,osiris_his_paciente.colonia_paciente,osiris_his_paciente.municipio_paciente,osiris_his_paciente.codigo_postal_paciente,osiris_his_paciente.estado_paciente, " +
                                      "osiris_his_paciente.estado_civil_paciente,osiris_his_paciente.ocupacion_paciente,osiris_his_paciente.telefono_particular1_paciente, " +
                                      "to_char(to_number(to_char(age('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',fecha_nacimiento_paciente),'yyyy') ,'9999'),'9999') AS edad, " +
                                      "to_char(to_number(to_char(age('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',osiris_his_paciente.fecha_nacimiento_paciente),'MM'),'99'),'99') AS mesesedad," +
                                      "osiris_empresas.descripcion_empresa,osiris_empresas.direccion_empresa,osiris_empresas.telefono1_empresa,osiris_empresas.numero_direccion_empresa,osiris_empresas.colonia_empresa,osiris_his_tipo_pacientes.descripcion_tipo_paciente, " +
                                      "osiris_erp_cobros_enca.responsable_cuenta,osiris_erp_cobros_enca.direccion_responsable_cuenta,osiris_erp_cobros_enca.telefono1_responsable_cuenta, " +
                                      "osiris_erp_cobros_enca.ocupacion_responsable,osiris_erp_cobros_enca.parentezco,osiris_erp_cobros_enca.empresa_labora_responsable, " +
                                      "osiris_erp_cobros_enca.direccion_emp_responsable,osiris_erp_cobros_enca.telefono_emp_responsable,osiris_erp_cobros_enca.paciente_asegurado, " +
                                      "osiris_erp_cobros_enca.numero_poliza,osiris_his_medicos.nombre_medico,osiris_his_medicos.id_especialidad,osiris_his_tipo_especialidad.descripcion_especialidad, osiris_his_medicos.cedula_medico, " +
                                      "osiris_erp_movcargos.folio_de_servicio,to_char(osiris_erp_movcargos.fechahora_admision_registro,'dd-MM-yyyy') AS fecha_reg_adm, " +
                                      "osiris_erp_cobros_enca.nombre_medico_tratante," +
                                      "to_char(fechahora_admision_registro,'HH24:mi:ss') AS hora_reg_adm,osiris_his_tipo_admisiones.descripcion_admisiones, " +
                                      "osiris_his_tipo_cirugias.descripcion_cirugia,osiris_his_tipo_diagnosticos.id_diagnostico, " +
                                      "osiris_his_tipo_diagnosticos.descripcion_diagnostico,descripcion_diagnostico_movcargos,descripcion_aseguradora," +
                                      "osiris_erp_cobros_enca.nombre_empresa_encabezado,observacion_ingreso,osiris_his_paciente.alegias_paciente,osiris_his_paciente.religion_paciente," +
                                      "osiris_erp_cobros_enca.id_empresa AS idempresa_enca,curp_paciente,rfc_paciente,lugar_nacimiento_paciente " +
                                      "FROM osiris_erp_cobros_enca,osiris_his_medicos,osiris_empresas,osiris_erp_movcargos,osiris_his_paciente,osiris_his_tipo_pacientes,osiris_his_tipo_cirugias,osiris_his_tipo_diagnosticos,osiris_his_tipo_admisiones,osiris_his_tipo_especialidad,osiris_aseguradoras " +
                                      "WHERE osiris_erp_cobros_enca.id_medico = osiris_his_medicos.id_medico " +
                                      "AND osiris_erp_cobros_enca.folio_de_servicio = osiris_erp_movcargos.folio_de_servicio " +
                                      "AND osiris_erp_cobros_enca.pid_paciente = osiris_erp_movcargos.pid_paciente " +
                                      "AND osiris_erp_movcargos.pid_paciente = osiris_his_paciente.pid_paciente " +
                                      "AND osiris_his_tipo_cirugias.id_tipo_cirugia = osiris_erp_movcargos.id_tipo_cirugia " +
                                      "AND osiris_his_tipo_diagnosticos.id_diagnostico = osiris_erp_movcargos.id_diagnostico " +
                                      "AND osiris_empresas.id_empresa = osiris_erp_cobros_enca.id_empresa " +
                                      "AND osiris_his_medicos.id_especialidad = osiris_his_tipo_especialidad.id_especialidad " +
                                      "AND osiris_his_tipo_pacientes.id_tipo_paciente = osiris_erp_movcargos.id_tipo_paciente " +
                                      "AND osiris_erp_movcargos.id_tipo_admisiones = osiris_his_tipo_admisiones.id_tipo_admisiones " +
                                      "AND osiris_aseguradoras.id_aseguradora = osiris_erp_cobros_enca.id_aseguradora " +
                                      "AND osiris_his_paciente.pid_paciente = '" + PidPaciente.ToString() + "' " +
                                      "AND osiris_erp_movcargos.folio_de_servicio = '" + folioservicio.ToString() + "'";

                NpgsqlDataReader lector = comando.ExecuteReader();

                if ((bool)lector.Read())
                {
                    medico_tratante = (string)lector["nombre_medico_tratante"];
                    string edadpac  = (string)lector["edad"];
                    string mesespac = (string)lector["mesesedad"];
                    //string varpaso = (string) lector["descripcion_admisiones"];
                    imprime_encabezado(cr, layout);
                    fontSize  = 8.0;
                    desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
                    /////////COMIENZA IMPRESION DE CUERPO DE DOCUMENTO//////////////////
                    layout.FontDescription.Weight = Weight.Bold;                       // Letra Negrita
                    cr.MoveTo(489.5 * escala_en_linux_windows, 20 * escala_en_linux_windows);                                   layout.SetText("Nº Expediente");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(509.5 * escala_en_linux_windows, 30 * escala_en_linux_windows);                                   layout.SetText(" " + PidPaciente.ToString());
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(509.5 * escala_en_linux_windows, 40 * escala_en_linux_windows);                                   layout.SetText("PID");
                    cr.MoveTo(240 * escala_en_linux_windows, 100 * escala_en_linux_windows);                            layout.SetText("DATOS GENERALES DEL PACIENTE");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    layout.FontDescription.Weight = Weight.Normal;                       // Letra Normal
                    int numero_linea = 120;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Nombre: " + (string)lector["nombre1_paciente"].ToString().Trim() + " " +
                                                                                                                                                               (string)lector["nombre2_paciente"].ToString().Trim() + " " +
                                                                                                                                                               (string)lector["apellido_paterno_paciente"].ToString().Trim() + " " +
                                                                                                                                                               (string)lector["apellido_materno_paciente"].ToString().Trim());                                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(56 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("_________________________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(290 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("F. de Nac: " + (string)lector["fecha_nac_pa"]);                                  Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(329 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("________________");                                     Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(410 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Edad: " + edadpac + " años " + mesespac + " Meses");                            Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(430 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("______________________");                                       Pango.CairoHelper.ShowLayout(cr, layout);

                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                    layout.SetText("C.U.R.P.: " + (string)lector["curp_paciente"].ToString().Trim());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(170 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("R.F.C.: " + (string)lector["rfc_paciente"].ToString().Trim());           Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(310 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Lugar Nac.: " + (string)lector["lugar_nacimiento_paciente"].ToString().Trim());          Pango.CairoHelper.ShowLayout(cr, layout);

                    numero_linea += separacionlineas;

                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Dirección: " + (string)lector["direccion_paciente"] + "  " +
                                                                                                                                                               (string)lector["numero_casa_paciente"] + " " + (string)lector["numero_departamento_paciente"] + ", Col. " +
                                                                                                                                                               (string)lector["colonia_paciente"] + ", CP. " + (string)lector["codigo_postal_paciente"] + ", " + (string)lector["municipio_paciente"] + ", " + (string)lector["estado_paciente"]);                                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(58 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("________________________________________________________________________________________________");                                     Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(460 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                           layout.SetText("Telefono :" + (string)lector["telefono_particular1_paciente"].ToString().Trim());                                        Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;

                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Ocupación: " + (string)lector["ocupacion_paciente"]);                                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(58 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("________________________________");                                     Pango.CairoHelper.ShowLayout(cr, layout);

                    if ((int)lector["idempresa_enca"] == 1)
                    {
                        cr.MoveTo(310 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                           layout.SetText("Labora en:  " + (string)lector["nombre_empresa_encabezado"]);            Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    else
                    {
                        cr.MoveTo(310 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                           layout.SetText("Labora en:  " + (string)lector["descripcion_empresa"]);                  Pango.CairoHelper.ShowLayout(cr, layout);
                    }

                    cr.MoveTo(360 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("___________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);

                    numero_linea += separacionlineas;
                    //cr.MoveTo(20*escala_en_linux_windows, numero_linea*escala_en_linux_windows);						layout.SetText("Dirección Empresa:  "+(string) lector["direccion_empresa"]);
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(90*escala_en_linux_windows, numero_linea*escala_en_linux_windows);						layout.SetText("______________________________________");
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(310*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("Tel. de la Empresa:  "+(string) lector["telefono1_empresa"]);
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(380*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("_________________________");
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //numero_linea += separacionlineas;
                    layout.FontDescription.Weight = Weight.Bold;
                    //layout.FontDescription.
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Tipo de paciente:  " + (string)lector["descripcion_tipo_paciente"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(90 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("______________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    layout.FontDescription.Weight = Weight.Normal;
                    cr.MoveTo(310 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Estado Civil:" + " " + (string)lector["estado_civil_paciente"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(357 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("_______________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    string sexo_paciente = "";
                    if ((string)lector["sexo_paciente"] == "H")
                    {
                        sexo_paciente = "Masculino";
                    }
                    else
                    {
                        sexo_paciente = "Femenino";
                    }

                    cr.MoveTo(500 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Sexo: " + sexo_paciente);                 Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(521 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("____________");                                 Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                    layout.SetText("Religion: " + (string)lector["religion_paciente"]);                                      Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(310 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Alergias: " + (string)lector["alegias_paciente"]);                                       Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    //cr.MoveTo(20*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("Referido por: ");					Pango.CairoHelper.ShowLayout (cr, layout);
                    //numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                    layout.SetText("Serv. Medico: " + (string)lector["observacion_ingreso"]);                                        Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    numero_linea += separacionlineas;
                    layout.FontDescription.Weight = Weight.Bold;
                    cr.MoveTo(260 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("DATOS DEL RESPONSABLE");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    layout.FontDescription.Weight = Weight.Normal;
                    numero_linea += separacionlineas;
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Nombre de la persona responsable del paciente:  " + (string)lector["responsable_cuenta"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(193 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("___________________________________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Dirección:  " + (string)lector["direccion_responsable_cuenta"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(56 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("___________________________________________________________________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Tel:  " + (string)lector["telefono1_responsable_cuenta"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(37 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("_________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    //cr.MoveTo(20*escala_en_linux_windows, numero_linea*escala_en_linux_windows);						layout.SetText("Ocupación del responsable:  "+(string) lector["ocupacion_responsable"]);
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(126*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("__________________________________");
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                    layout.SetText("Parentesco:  " + (string)lector["parentezco"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(393 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Empresa donde labora:  " + (string)lector["empresa_labora_responsable"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(103 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("_______________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(345 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("Tel. de Empresa:  " + (string)lector["telefono_emp_responsable"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(406 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                   layout.SetText("________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    //numero_linea += separacionlineas;
                    //cr.MoveTo(20*escala_en_linux_windows, numero_linea*escala_en_linux_windows);						layout.SetText("Responsable de la cuenta(Aseguradora y/o membresia):  "+(string) lector["descripcion_aseguradora"]);
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(224*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("__________________________________________");
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(450*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("Nº de poliza:  "+(string) lector["numero_poliza"]);
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    //cr.MoveTo(498*escala_en_linux_windows, numero_linea*escala_en_linux_windows);					layout.SetText("____________________");
                    //Pango.CairoHelper.ShowLayout (cr, layout);
                    numero_linea += separacionlineas;
                    cr.MoveTo(20 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("Dirección:  " + (string)lector["direccion_emp_responsable"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(60 * escala_en_linux_windows, numero_linea * escala_en_linux_windows);                                            layout.SetText("___________________________________________________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);

                    layout.FontDescription.Weight = Weight.Bold;
                    cr.MoveTo(270 * escala_en_linux_windows, 350 * escala_en_linux_windows);                                    layout.SetText("DATOS DE ADMISION");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(20 * escala_en_linux_windows, 375 * escala_en_linux_windows);                                         layout.SetText("Nº de Ingreso:  " + folioservicio.ToString());
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    layout.FontDescription.Weight = Weight.Normal;
                    cr.MoveTo(79 * escala_en_linux_windows, 375 * escala_en_linux_windows);                                             layout.SetText("__________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(140 * escala_en_linux_windows, 375 * escala_en_linux_windows);                            layout.SetText("Nº de habitacion:  ");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(200 * escala_en_linux_windows, 375 * escala_en_linux_windows);                                    layout.SetText("____________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(280 * escala_en_linux_windows, 375 * escala_en_linux_windows);                            layout.SetText("Fecha de Admision:  " + (string)lector["fecha_reg_adm"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(350 * escala_en_linux_windows, 375 * escala_en_linux_windows);                                    layout.SetText("_____________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(430 * escala_en_linux_windows, 375 * escala_en_linux_windows);                            layout.SetText("Hora de admision:" + " " + (string)lector["hora_reg_adm"]);       //DateTime.Now.ToString("HH:mm"));
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(495 * escala_en_linux_windows, 375 * escala_en_linux_windows);                                    layout.SetText("_____________");
                    Pango.CairoHelper.ShowLayout(cr, layout);

                    if ((int)lector["id_medico"] > 1)
                    {
                        cr.MoveTo(20 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                     layout.SetText("Medico 1º Diag.:  " + (string)lector["nombre_medico"]);
                        Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(80 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                     layout.SetText("_____________________________________________");
                        Pango.CairoHelper.ShowLayout(cr, layout);
                    }
                    else
                    {
                        cr.MoveTo(20 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                     layout.SetText("Medico 1º Diag.:  " + (string)lector["nombre_medico_encabezado"]);
                        Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(80 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                     layout.SetText("_____________________________________________");
                        Pango.CairoHelper.ShowLayout(cr, layout);
                    }

                    cr.MoveTo(350 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                    layout.SetText("Especialidad:  " + (string)lector["descripcion_especialidad"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(400 * escala_en_linux_windows, 390 * escala_en_linux_windows);                                    layout.SetText("____________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(383 * escala_en_linux_windows, 439 * escala_en_linux_windows);                                    layout.SetText("Firma:");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(408 * escala_en_linux_windows, 439 * escala_en_linux_windows);                                    layout.SetText("_______________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(383 * escala_en_linux_windows, 422 * escala_en_linux_windows);                                    layout.SetText("Ced. Prof.:  " + (string)lector["cedula_medico"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(424 * escala_en_linux_windows, 422 * escala_en_linux_windows);                                    layout.SetText("______________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(20 * escala_en_linux_windows, 406 * escala_en_linux_windows);                                             layout.SetText("Cirugia: " + (string)lector["descripcion_cirugia"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(50 * escala_en_linux_windows, 406 * escala_en_linux_windows);                                             layout.SetText("___________________________________________________________________________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(20 * escala_en_linux_windows, 422 * escala_en_linux_windows);                                             layout.SetText("Ingresado por: " + (string)lector["id_empleado_admision"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(75 * escala_en_linux_windows, 422 * escala_en_linux_windows);                                             layout.SetText("________________________________");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(20 * escala_en_linux_windows, 444 * escala_en_linux_windows);                                             layout.SetText("Motivo de Ingreso: " + (string)lector["descripcion_diagnostico_movcargos"]);
                    Pango.CairoHelper.ShowLayout(cr, layout);


                    /*
                     * layout.FontDescription.Weight = Weight.Bold;
                     * cr.MoveTo(220*escala_en_linux_windows, 453*escala_en_linux_windows);					layout.SetText("PARA SER LLENADO POR EL MEDICO TRATANTE");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * layout.FontDescription.Weight = Weight.Normal;
                     * cr.MoveTo(20*escala_en_linux_windows, 465*escala_en_linux_windows);						layout.SetText("Medico Tratante: "+medico_tratante);
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(82*escala_en_linux_windows, 465*escala_en_linux_windows);						layout.SetText("__________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 477*escala_en_linux_windows);						layout.SetText("Diagnostico:  "+(string) lector["descripcion_diagnostico_movcargos"]);
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(70*escala_en_linux_windows, 477*escala_en_linux_windows);						layout.SetText("__________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 489*escala_en_linux_windows);						layout.SetText("Observaciones: ");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(82*escala_en_linux_windows, 489*escala_en_linux_windows);						layout.SetText("_____________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 501*escala_en_linux_windows);						layout.SetText("Diagnostico provisional (Para ser llenado dentro de las primeras 24 Hrs):");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 513*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 525*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 537*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 549*escala_en_linux_windows);						layout.SetText("Diagnostico Final:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 561*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 573*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 585*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 597*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * layout.FontDescription.Weight = Weight.Bold;
                     * cr.MoveTo(270*escala_en_linux_windows, 609*escala_en_linux_windows);					layout.SetText("CAUSA DE EGRESO");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * layout.FontDescription.Weight = Weight.Normal;
                     * cr.MoveTo(20*escala_en_linux_windows, 621*escala_en_linux_windows);						layout.SetText("Por Mejoria:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(60*escala_en_linux_windows, 621*escala_en_linux_windows);						layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 633*escala_en_linux_windows);						layout.SetText("Evolucion:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(60*escala_en_linux_windows, 633*escala_en_linux_windows);						layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(200*escala_en_linux_windows, 633*escala_en_linux_windows);						layout.SetText("Por traslado:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(245*escala_en_linux_windows, 633*escala_en_linux_windows);						layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(200*escala_en_linux_windows, 621*escala_en_linux_windows);					layout.SetText("Alta Voluntaria:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(260*escala_en_linux_windows, 621*escala_en_linux_windows);					layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(383*escala_en_linux_windows, 621*escala_en_linux_windows);					layout.SetText("Por no Mejoria:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(444*escala_en_linux_windows, 621*escala_en_linux_windows);					layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(383*escala_en_linux_windows, 633*escala_en_linux_windows);					layout.SetText("Por Defunción:");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(444*escala_en_linux_windows, 633*escala_en_linux_windows);					layout.SetText("______________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 668*escala_en_linux_windows);					layout.SetText("______________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(40*escala_en_linux_windows, 677*escala_en_linux_windows);					layout.SetText("medico_tratante");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(435*escala_en_linux_windows, 677*escala_en_linux_windows);					layout.SetText("FIRMA DE MEDICO TRATANTE");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(400*escala_en_linux_windows, 668*escala_en_linux_windows);						layout.SetText("____________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     *
                     * cr.MoveTo(220*escala_en_linux_windows, 735*escala_en_linux_windows);						layout.SetText("Nombre y Firma Paciente o responsable");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     * //cr.MoveTo(250*escala_en_linux_windows, 700*escala_en_linux_windows);			            layout.SetText("verificacion de datos");
                     * //Pango.CairoHelper.ShowLayout (cr, layout);
                     * cr.MoveTo(20*escala_en_linux_windows, 724*escala_en_linux_windows);						layout.SetText("____________________________________________________________________________________________________________________________");
                     * Pango.CairoHelper.ShowLayout (cr, layout);
                     */



                    cr.MoveTo(20 * escala_en_linux_windows, 760 * escala_en_linux_windows);                                    layout.SetText("REV.00");
                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(480 * escala_en_linux_windows, 760 * escala_en_linux_windows);                                   layout.SetText("FI-7.5.1/01");
                    Pango.CairoHelper.ShowLayout(cr, layout);


                    //string varpaso = (string) lector["descripcion_admisiones"];
                    //while ((bool) lector.Read()){
                    //		varpaso = varpaso +", "+(string) lector["descripcion_admisiones"];
                    //}
                    //cr.MoveTo(20*escala_en_linux_windows, 410*escala_en_linux_windows);						layout.SetText("Admisión:  "+(string) varpaso);
                    //cr.MoveTo(60*escala_en_linux_windows, 410*escala_en_linux_windows);						layout.SetText("__________________________________________________________________");
                }

                lector.Close();
                conexion.Close();
                //cr.ShowPage();
            }catch (NpgsqlException ex) {
                Console.WriteLine("PostgresSQL error: {0}", ex.Message);
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();     msgBoxError.Destroy();
                return;
            }
        }
Exemplo n.º 13
0
        void HandleM_printDrawPage(object o, DrawPageArgs args)
        {
            // Create a Print Context from the Print Operation
            PrintContext context = args.Context;

            // Create a Cairo Context from the Print Context
            Cairo.Context cr = context.CairoContext;

            // Get the width of the Print Context
            double width = context.Width;

            // Create a rectangle to be used for the Content
            cr.Rectangle(0, 0, width, headerHeight);
            cr.SetSourceRGB(0.95, 0.95, 0.95);
            cr.FillPreserve();

            // Create a Stroke to outline the Content
            cr.SetSourceRGB(0, 0, 0);
            cr.LineWidth = 1;
            cr.Stroke();

            // Create a Pango Layout for the Text
            Pango.Layout layout = context.CreatePangoLayout();
            // Get the Text Height fromt the Height of the layout and the Height of the Page
            int layoutWidth, layoutHeight;

            layout.GetSize(out layoutWidth, out layoutHeight);
            double textHeight = (double)layoutHeight / (double)pangoScale;

            cr.MoveTo(5, (headerHeight - textHeight) / 2);

            // Set the Font and Font Size desired
            Pango.FontDescription desc = Pango.FontDescription.FromString("sans 12");
            layout.FontDescription = desc;

            // Create a Header with the FileName and center it on the page
            layout.SetText(m_cache.Name + " : " + m_cache.CacheName);
            //layout.Width = (int) width *3;
            layout.Alignment = Pango.Alignment.Left;
            Pango.CairoHelper.ShowLayout(cr, layout);


            // cr.MoveTo (width/2, (headerHeight - textHeight) / 2);


            // Set the Page Number in the Footer with a right alignment
            string pageStr = String.Format(Catalog.GetString("Page {0} of {1}"), args.PageNr + 1, m_numPages);

            layout.SetText(pageStr);
            layout.Alignment = Pango.Alignment.Right;

            cr.MoveTo(width - 75, (headerHeight - textHeight) / 2);
            Pango.CairoHelper.ShowLayout(cr, layout);

            // Create a new Pango Layout for the Content
            layout = null;
            layout = context.CreatePangoLayout();

            // Set the Description of the Content
            desc      = Pango.FontDescription.FromString("sans");
            desc.Size = (int)(m_fontSize * pangoScale);
            layout.FontDescription = desc;

            // Move to the beginning of the Content, which is after the Header Height and Gap
            cr.MoveTo(0, headerHeight + headerGap);

            int line = args.PageNr * m_linesPerPage;

            // Draw the lines on the page according to how many lines there are left and how many lines can fit on the page
            for (int i = 0; i < m_linesPerPage && line < m_numLines; i++)
            {
                layout.SetMarkup(m_Lines[line].TrimStart());
                Pango.CairoHelper.ShowLayout(cr, layout);
                cr.RelMoveTo(0, m_fontSize + 0.5);
                line++;
            }

            layout = null;
            context.Dispose();
        }
Exemplo n.º 14
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             *
             * TreeIter iter;
             * //variables para lectura de treviews por fila
             * string numeros_seleccionado = "";
             * string numeros_seleccionado1 = "";
             * string numeros_seleccionado2 = "";
             * string variable_paso_03 = "";
             * string variable_paso_03_1 = "";
             * string variable_paso_03_2 = "";
             * int variable_paso_02 = 0;
             * int variable_paso_02_1 = 0;
             * int variable_paso_02_2 = 0;
             * string precio_empresa_aseguradora = "";
             * string empresa_aseguradora = "";
             *
             * if (checkbutton_tarjeta == true){
             *      if (this.id_aseguradora > 0){
             *              empresa_aseguradora = this.id_aseguradora.ToString().Trim();
             *      }else{
             *              empresa_aseguradora = this.id_empresa.ToString().Trim();
             *      }
             *      precio_empresa_aseguradora = ",to_char(precio_producto_"+this.id_tipopaciente.ToString().Trim()+empresa_aseguradora+",'999999999.99') AS precioempreaseg ";
             * }
             * if (this.checkbutton_especiales == true){
             *      if (this.id_aseguradora > 0){
             *              empresa_aseguradora = this.id_aseguradora.ToString().Trim();
             *      }else{
             *              empresa_aseguradora = this.id_empresa.ToString().Trim();
             *      }
             *      precio_empresa_aseguradora = ",to_char(precio_producto_"+this.id_tipopaciente.ToString().Trim()+empresa_aseguradora.ToString().Trim() +",'999999999.99') AS precioempreaseg ";
             * }
             *
             * // (lee 1 treeview) en este caso 3 treeview y selecciona dicho campo boleano marcado en la lista(palomeado)
             * if (treeViewEnginegrupos.GetIterFirst (out iter)){
             *      if ((bool) this.lista_grupo.Model.GetValue (iter,0) == true){
             *              numeros_seleccionado = (string) lista_grupo.Model.GetValue (iter,2);
             *              variable_paso_02_1 += 1;
             *      }
             *      while (treeViewEnginegrupos.IterNext(ref iter)){
             *              if ((bool) lista_grupo.Model.GetValue (iter,0) == true){
             *              if (variable_paso_02_1 == 0){
             *                              numeros_seleccionado = (string) lista_grupo.Model.GetValue (iter,2);
             *                              variable_paso_02_1 += 1;
             *                      }else{
             *                              variable_paso_03 = (string) lista_grupo.Model.GetValue (iter,2);
             *                              numeros_seleccionado = numeros_seleccionado.Trim() + "','" + variable_paso_03.Trim();
             *                      }
             *              }
             *      }
             * }
             * variable_paso_02 = 0;
             * if (treeViewEnginegrupos1.GetIterFirst (out iter)){
             *      if ((bool) this.lista_grupo1.Model.GetValue (iter,0) == true){
             *              numeros_seleccionado1 = (string) lista_grupo1.Model.GetValue (iter,2);
             *              variable_paso_02 += 1;
             *      }
             *      while (treeViewEnginegrupos1.IterNext(ref iter)){
             *              if ((bool) lista_grupo1.Model.GetValue (iter,0) == true){
             *                      if (variable_paso_02 == 0){
             *                              numeros_seleccionado1 = (string) lista_grupo1.Model.GetValue (iter,2);
             *                              variable_paso_02 += 1;
             *                      }else{
             *                              variable_paso_03_1 = (string) lista_grupo1.Model.GetValue (iter,2);
             *                              numeros_seleccionado1 = numeros_seleccionado1.Trim() + "','" + variable_paso_03_1.Trim();
             *                      }
             *              }
             *      }
             * }
             *
             * variable_paso_02_2 = 0;
             * if (treeViewEnginegrupos2.GetIterFirst (out iter)){
             *      if ((bool) this.lista_grupo2.Model.GetValue (iter,0) == true){
             *              numeros_seleccionado2 = (string) lista_grupo2.Model.GetValue (iter,2);
             *              variable_paso_02_2 += 1;
             *      }
             *      while (treeViewEnginegrupos2.IterNext(ref iter)){
             *              if ((bool) lista_grupo2.Model.GetValue (iter,0) == true){
             *                      if (variable_paso_02_2 == 0){
             *                              numeros_seleccionado2 = (string) lista_grupo2.Model.GetValue (iter,2);
             *                              variable_paso_02_2 += 1;
             *                      }else{
             *                              variable_paso_03_2 = (string) lista_grupo2.Model.GetValue (iter,2);
             *                              numeros_seleccionado2 = numeros_seleccionado2.Trim() + "','" + variable_paso_03_2.Trim();
             *                      }
             *              }
             *      }
             * }
             *      //declarando variables de los querys
             * string query_tarjetas_descuento1 = "";
             * string query_tarjetas_descuento2 = "";
             * string query_precios_especiales = "";
             * string query_in_grupo2 = "";
             * string query_in_grupo = "";
             * string query_in_grupo1 = "";
             *
             * if (checkbutton_tarjeta == true){
             *      precio_empresa_aseguradora = "";
             *      query_tarjetas_descuento1 = ", to_char(hscmty_productos.precio_producto_publico - (hscmty_productos.precio_producto_publico * hscmty_productos.porcentage_descuento) / 100,'99999999.99') AS precio_tarjeta ";
             *      query_tarjetas_descuento2 = "hscmty_productos.aplica_descuento = true ";
             *      query_in_grupo  = " ";
             *      query_in_grupo1 = " ";
             *      query_in_grupo2 = " ";
             * }else{
             *      if (variable_paso_02_1 > 0){
             *              query_in_grupo = "hscmty_productos.id_grupo_producto IN ('"+numeros_seleccionado+"') ";
             *      }
             *      if (variable_paso_02_2 > 0){
             *              query_in_grupo1 = "AND hscmty_productos.id_grupo1_producto IN ('"+numeros_seleccionado1+"') ";
             *      }
             *      if (variable_paso_02_2 > 0){
             *              query_in_grupo2 = "AND hscmty_productos.id_grupo2_producto IN ('"+numeros_seleccionado2+"') ";
             *      }
             * }
             * if (this.checkbutton_especiales == true){
             *      query_precios_especiales = "precio_producto_"+this.id_tipopaciente.ToString().Trim()+empresa_aseguradora.ToString().Trim()+" > 0 ";
             *      query_in_grupo  = " ";
             *      query_in_grupo1 = " ";
             *      query_in_grupo2 = " ";
             * }
             *
             *
             * NpgsqlConnection conexion;
             * conexion = new NpgsqlConnection (connectionString+nombrebd);
             * // Verifica que la base de dato s este conectada
             * try{
             *      conexion.Open ();
             * NpgsqlCommand comando;
             * comando = conexion.CreateCommand ();
             *
             * comando.CommandText ="SELECT to_char(hscmty_productos.id_producto,'999999999999') AS codProducto,"+
             *                              "hscmty_productos.descripcion_producto,hscmty_productos.nombre_articulo,hscmty_productos.nombre_generico_articulo, "+
             *                              "to_char(precio_producto_publico,'99999999.99') AS preciopublico,"+
             *                              "to_char(precio_producto_publico1,'99999999.99') AS preciopublico1,"+
             *                              "to_char(cantidad_de_embalaje,'99999999.99') AS cantidadembalaje,"+
             *                              "aplicar_iva,to_char(porcentage_descuento,'999.99') AS porcentagesdesc,aplica_descuento,cobro_activo,costo_unico,"+
             *                              "descripcion_grupo_producto,descripcion_grupo1_producto,descripcion_grupo2_producto,to_char(costo_por_unidad,'999999999.99') AS costoproductounitario, "+
             *                              "to_char(hscmty_productos.id_grupo_producto,'99999') AS idgrupoproducto,hscmty_productos.id_grupo_producto, "+
             *                              "to_char(hscmty_productos.id_grupo1_producto,'99999') AS idgrupo1producto,hscmty_productos.id_grupo1_producto, "+
             *                              "to_char(hscmty_productos.id_grupo2_producto,'99999') AS idgrupo2producto,hscmty_productos.id_grupo2_producto, "+
             *                              "to_char(porcentage_ganancia,'99999.999') AS porcentageutilidad,to_char(costo_producto,'999999999.99') AS costoproducto "+
             *                              precio_empresa_aseguradora+" "+
             *                              query_tarjetas_descuento1+" "+
             *                              "FROM hscmty_productos,hscmty_grupo_producto,hscmty_grupo1_producto,hscmty_grupo2_producto "+
             *                              "WHERE "+query_in_grupo+
             *                              query_in_grupo1+
             *                              query_in_grupo2+
             *                              query_precios_especiales+
             *                              query_tarjetas_descuento2+
             *                              "AND hscmty_productos.id_grupo_producto = hscmty_grupo_producto.id_grupo_producto "+
             *                              "AND hscmty_productos.id_grupo1_producto = hscmty_grupo1_producto.id_grupo1_producto "+
             *                              "AND hscmty_productos.id_grupo2_producto = hscmty_grupo2_producto.id_grupo2_producto "+
             *                              "ORDER BY hscmty_productos.id_grupo_producto,hscmty_productos.id_grupo1_producto,hscmty_productos.id_grupo2_producto,hscmty_productos.id_producto ;";
             * //Console.WriteLine(comando.CommandText);
             * NpgsqlDataReader lector = comando.ExecuteReader ();
             * ContextoImp.BeginPage("Pagina 1");
             * imprime_encabezado(ContextoImp,trabajoImpresion);
             *
             * int grupo = 0;
             * int grupo1 = 0;
             * int grupo2 = 0;
             * string toma_descrip_prod;
             *      Gnome.Print.Setfont (ContextoImp, fuente6);
             * if (lector.Read()){
             *              grupo2 = (int) lector["id_grupo2_producto"];
             *
             *              if(grupo != (int) lector["id_grupo_producto"]){
             *                      ContextoImp.MoveTo(20, filas); ContextoImp.Show((string) lector["descripcion_grupo_producto"]);
             *                      grupo = (int) lector["id_grupo_producto"];
             *                      filas-=10;
             *                      contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *              }
             *              if(grupo1 != (int) lector["id_grupo1_producto"]){
             *                      ContextoImp.MoveTo(25, filas); ContextoImp.Show((string) lector["descripcion_grupo1_producto"]);
             *                      grupo1 = (int) lector["id_grupo1_producto"];
             *                      filas-=10;
             *                      contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *              }
             *              if(grupo2 != (int) lector["id_grupo2_producto"]){
             *                      ContextoImp.MoveTo(30, filas); ContextoImp.Show((string) lector["descripcion_grupo2_producto"]);
             *                      grupo2 = (int) lector["id_grupo2_producto"];
             *                      filas-=10;
             *                      contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *              }
             *              ContextoImp.MoveTo(35, filas);		ContextoImp.Show((string) lector["codProducto"]);
             *
             *              toma_descrip_prod = (string) lector["descripcion_producto"];
             *
             *              if(toma_descrip_prod.Length > 65){
             *                              toma_descrip_prod = toma_descrip_prod.Substring(0,64);
             *              }
             *              ContextoImp.MoveTo(78, filas);		ContextoImp.Show(toma_descrip_prod);
             *
             *              // operaciones para el iva
             *              if(this.checkbutton_especiales == true){
             *                      precio_por_cantidad = decimal.Parse((string) lector["precioempreaseg"]);
             *              }else{
             *                      precio_por_cantidad = decimal.Parse((string) lector["preciopublico"]);
             *              }
             *              ivaproducto = (precio_por_cantidad*15)/100;
             *
             *              total = ivaproducto + decimal.Parse((string) lector["preciopublico"]);
             *
             *              if(this.radiobutton_con_iva == true){
             *                      if(this.checkbutton_tarjeta == true){
             *                              //operaciones para iva
             *                              precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                              ivaproducto2 = (precio_por_cantidad2*15)/100;
             *
             *                              total2 = ivaproducto2 + decimal.Parse((string) lector["precio_tarjeta"]);
             *
             *                              ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad2.ToString("C"));
             *                              ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto2.ToString("C"));
             *                              ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total2.ToString("C"));
             *                      }else{
             *
             *                              ContextoImp.MoveTo(350, filas);		ContextoImp.Show(precio_por_cantidad.ToString("C"));
             *                              ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto.ToString("C"));
             *                              ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total.ToString("C"));
             *                      }
             *              }
             *              if(this.radiobutton_sin_iva == true){
             *                      if(this.checkbutton_tarjeta == true){
             *                              //operaciones para iva
             *                              precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                              ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad2.ToString("C"));
             *
             *                      }else{
             *                              ContextoImp.MoveTo(350, filas);		ContextoImp.Show(precio_por_cantidad.ToString("C"));
             *                      }
             *              }
             *              if(this.radiobutton_desglosado == true ){
             *                      if(this.checkbutton_tarjeta == true){
             *
             *                              //operaciones para iva
             *                              precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                              ivaproducto2 = (precio_por_cantidad2*15)/100;
             *
             *                              total2 = ivaproducto2 + decimal.Parse((string) lector["precio_tarjeta"]);
             *                              // opreraciones de descuento
             *                              descuento = decimal.Parse((string) lector["porcentagesdesc"]);
             *                              descuento_pesos = (descuento * precio_por_cantidad2) / 100;
             *                              total_desc = descuento_pesos + total2;
             *
             *                              ContextoImp.MoveTo(345, filas);		ContextoImp.Show((string) lector["precio_tarjeta"]);
             *                              ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto2.ToString("C"));
             *                              ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total2.ToString("C"));
             *                              ContextoImp.MoveTo(470, filas);		ContextoImp.Show((string) lector["porcentagesdesc"]);
             *                              ContextoImp.MoveTo(510, filas);		ContextoImp.Show(descuento_pesos.ToString("C"));
             *                              ContextoImp.MoveTo(550, filas);		ContextoImp.Show(total_desc.ToString("C"));
             *                      }else{
             *                              ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad.ToString("C"));
             *                              ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto.ToString("C"));
             *                              ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total.ToString("C"));
             *                      }
             *              }
             *              filas-=10;
             *              contador+=1;
             *      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *              //Console.WriteLine(filas);
             *              while (lector.Read()){
             *                      if(grupo != (int) lector["id_grupo_producto"]){
             *                              ContextoImp.MoveTo(20, filas); ContextoImp.Show((string) lector["descripcion_grupo_producto"]);
             *                              grupo = (int) lector["id_grupo_producto"];
             *                              filas-=10;
             *                              contador+=1;
             *                      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *                      }
             *                      if(grupo1 != (int) lector["id_grupo1_producto"]){
             *                              ContextoImp.MoveTo(25, filas); ContextoImp.Show((string) lector["descripcion_grupo1_producto"]);
             *                              grupo1 = (int) lector["id_grupo1_producto"];
             *                              filas-=10;
             *                              contador+=1;
             *                      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *                      }
             *                      if(grupo2 != (int) lector["id_grupo2_producto"]){
             *                              ContextoImp.MoveTo(30, filas); ContextoImp.Show((string) lector["descripcion_grupo2_producto"]);
             *                              grupo2 = (int) lector["id_grupo2_producto"];
             *                              filas-=10;
             *                              contador+=1;
             *                      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *                      }
             *                      ContextoImp.MoveTo(35, filas);		ContextoImp.Show((string) lector["codProducto"]);
             *
             *                      toma_descrip_prod = (string) lector["descripcion_producto"];
             *                      if(toma_descrip_prod.Length > 65){
             *                              toma_descrip_prod = toma_descrip_prod.Substring(0,64);
             *                      }
             *                      ContextoImp.MoveTo(78, filas);		ContextoImp.Show(toma_descrip_prod);
             *
             *                      if(this.checkbutton_especiales == true){
             *                              precio_por_cantidad = decimal.Parse((string) lector["precioempreaseg"]);
             *                      }else{
             *                              precio_por_cantidad = decimal.Parse((string) lector["preciopublico"]);
             *                      }
             *                      ivaproducto = (precio_por_cantidad*15)/100;
             *
             *                      total = ivaproducto + precio_por_cantidad;
             *
             *                      if(this.radiobutton_con_iva == true){
             *                              if(this.checkbutton_tarjeta == true){
             *                                      //operaciones para iva
             *                                      precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                                      ivaproducto2 = (precio_por_cantidad2*15)/100;
             *
             *                                      total2 = ivaproducto2 + decimal.Parse((string) lector["precio_tarjeta"]);
             *
             *                                      ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad2.ToString("C"));
             *                                      ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto2.ToString("C"));
             *                                      ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total2.ToString("C"));
             *                              }else{
             *                                      ContextoImp.MoveTo(350, filas);		ContextoImp.Show(precio_por_cantidad.ToString("C"));
             *                                      ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto.ToString("C"));
             *                                      ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total.ToString("C"));
             *                              }
             *                      }
             *                      if(this.radiobutton_sin_iva == true){
             *                              if(this.checkbutton_tarjeta == true){
             *                                      //operaciones para iva
             *                                      precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                                      ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad2.ToString("C"));
             *                              }else{
             *                                      ContextoImp.MoveTo(350, filas);		ContextoImp.Show((string) lector["preciopublico"]);
             *                              }
             *                      }
             *                      if(this.radiobutton_desglosado == true ){
             *                              if(this.checkbutton_tarjeta == true){
             *                              //operaciones para iva
             *                                      precio_por_cantidad2 = decimal.Parse((string) lector["precio_tarjeta"]);
             *                                      ivaproducto2 = (precio_por_cantidad2*15)/100;
             *
             *                                      total2 = ivaproducto2 + decimal.Parse((string) lector["precio_tarjeta"]);
             *                                      // opreraciones de descuento
             *                                      descuento = decimal.Parse((string) lector["porcentagesdesc"]);
             *                                      descuento_pesos = (descuento * precio_por_cantidad2) / 100;
             *                                      total_desc = descuento_pesos + total2;
             *
             *                                      ContextoImp.MoveTo(345, filas);		ContextoImp.Show((string) lector["precio_tarjeta"]);
             *                                      ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto2.ToString("C"));
             *                                      ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total2.ToString("C"));
             *                                      ContextoImp.MoveTo(470, filas);		ContextoImp.Show((string) lector["porcentagesdesc"]);
             *                                      ContextoImp.MoveTo(510, filas);		ContextoImp.Show(descuento_pesos.ToString("C"));
             *                                      ContextoImp.MoveTo(550, filas);		ContextoImp.Show(total_desc.ToString("C"));
             *                              }else{
             *                                      ContextoImp.MoveTo(345, filas);		ContextoImp.Show(precio_por_cantidad.ToString("C"));
             *                                      ContextoImp.MoveTo(390, filas);		ContextoImp.Show(ivaproducto.ToString("C"));
             *                                      ContextoImp.MoveTo(430, filas);		ContextoImp.Show(total.ToString("C"));
             *                              }
             *                      }
             *                      filas-=10;
             *                      contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *              }
             *      }
             *      ContextoImp.ShowPage();
             * }catch (NpgsqlException ex){
             *      MessageDialog msgBoxError = new MessageDialog (MyWinError,DialogFlags.DestroyWithParent,
             *      MessageType.Warning, ButtonsType.Ok, "PostgresSQL error: {0}",ex.Message);
             *      msgBoxError.Run ();
             *      msgBoxError.Destroy();
             * }
             */
        }
Exemplo n.º 15
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * NpgsqlConnection conexion;
             * conexion = new NpgsqlConnection (connectionString+nombrebd);
             * // Verifica que la base de datos este conectada
             * try{
             * conexion.Open ();
             * NpgsqlCommand comando;
             * comando = conexion.CreateCommand ();
             * comando.CommandText ="SELECT "+
             *                                              "hscmty_erp_cobros_enca.folio_de_servicio, "+
             *                                              "hscmty_erp_cobros_enca.pid_paciente, "+
             *                                              "hscmty_his_paciente.nombre1_paciente, "+
             *                                              "hscmty_his_paciente.nombre2_paciente, "+
             *                                              "hscmty_his_paciente.apellido_paterno_paciente, "+
             *                                              "hscmty_his_paciente.apellido_materno_paciente, "+
             *                                              "hscmty_his_paciente.direccion_paciente, "+
             *                                              "hscmty_his_paciente.numero_casa_paciente, "+
             *                                              "hscmty_his_paciente.numero_departamento_paciente, "+
             *                                              "hscmty_his_paciente.colonia_paciente, "+
             *                                              "hscmty_his_paciente.codigo_postal_paciente, "+
             *                                              "hscmty_his_paciente.municipio_paciente, "+
             *                                              "hscmty_his_paciente.estado_paciente, "+
             *                                              "hscmty_his_paciente.telefono_particular1_paciente, "+
             *                                              "hscmty_erp_cobros_enca.responsable_cuenta, "+
             *                                              "hscmty_erp_cobros_enca.direccion_responsable_cuenta, "+
             *                                              "hscmty_erp_cobros_enca.telefono1_responsable_cuenta, "+
             *                                              "to_char(hscmty_erp_cobros_enca.fechahora_creacion, 'dd-MM-yyyy') AS fecha_ing, "+
             *                                              "to_char(hscmty_erp_cobros_enca.fechahora_creacion, 'HH:mm') AS hora_ing, "+
             *                                              "hscmty_erp_cobros_enca.id_medico, "+
             *                                              "hscmty_his_medicos.nombre_medico "+
             *                                              "FROM hscmty_erp_cobros_enca,hscmty_his_medicos,hscmty_his_paciente "+
             *                                              "WHERE hscmty_erp_cobros_enca.id_medico = hscmty_his_medicos.id_medico "+
             *                                              "AND hscmty_erp_cobros_enca.id_medico = hscmty_his_medicos.id_medico "+
             *                                      "AND hscmty_his_paciente.pid_paciente = '"+PidPaciente.ToString()+"' "+
             *                                      "AND hscmty_erp_cobros_enca.folio_de_servicio = '"+folioservicio.ToString()+"'";
             *
             * NpgsqlDataReader lector = comando.ExecuteReader ();
             *      ContextoImp.BeginPage("Pagina 1");
             *      //NUEVO
             *      // Crear una fuente
             *      Gnome.Font fuente = Gnome.Font.FindClosest("Bitstream Vera Sans", 12);
             *      Gnome.Font fuente1 = Gnome.Font.FindClosest("Bitstream Vera Sans", 36);
             *      Gnome.Font fuente2 = Gnome.Font.FindClosest("Bitstream Vera Sans", 8);
             *      Gnome.Font fuente3 = Gnome.Font.FindClosest("Bitstream Vera Sans", 6);
             *
             *      //Encabezado de pagina
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(19.5, 750);
             *  ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             *  ContextoImp.MoveTo(20, 750);
             *  ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(19.5, 740);
             *  ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             *  ContextoImp.MoveTo(20, 740);
             *  ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             *      ContextoImp.MoveTo(19.5, 730);
             *  ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *  ContextoImp.MoveTo(20, 730);
             *  ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *  Gnome.Print.Setfont (ContextoImp, fuente);
             *      ContextoImp.MoveTo(89.5, 708);
             *  ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *      ContextoImp.MoveTo(90, 708);
             *  ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *  Gnome.Print.Setfont (ContextoImp, fuente1);
             *  ContextoImp.MoveTo(20, 708);
             *      ContextoImp.Show("____________________________");
             * int filatex=680;
             *  //DATOS GENERALES DEL USUARIO
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(19.5, filatex);
             *      ContextoImp.Show("DATOS GENERALES DEL USUARIO:");
             *      ContextoImp.MoveTo(20, filatex);
             *      ContextoImp.Show("DATOS GENERALES DEL USUARIO:");
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(20, filatex-10);
             *      ContextoImp.Show("Nombre:_______________________________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-20);
             *      ContextoImp.Show("Domicilio:_______________________________________________________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-30);
             *      ContextoImp.Show("Telefono:_____________________________________________________________________________");
             *      //DATOS DEL DEMANDANTE
             *      Gnome.Print.Setfont (ContextoImp, fuente3);
             *      ContextoImp.MoveTo(19.5, filatex-50);
             *      ContextoImp.Show("DATOS GENERALES DEL DEMANDANTE DEL SERVICIO:");
             *      ContextoImp.MoveTo(20, filatex-50);
             *      ContextoImp.Show("DATOS GENERALES DEL DEMANDANTE DEL SERVICIO:");
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(20, filatex-60);
             *      ContextoImp.Show("Nombre:________________________________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-70);
             *      ContextoImp.Show("Domicilio:__________________________________________________________________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-80);
             *      ContextoImp.Show("Telefono:______________________________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-90);
             *      ContextoImp.Show("Nombre del medico tratante del usuario:_____________________________________________________________");
             *      ContextoImp.MoveTo(20, filatex-100);
             *      ContextoImp.Show("Fecha y hora de ingreso:____________________________________________________________________________");
             *      //PARRAFO 1
             *      Gnome.Print.Setfont (ContextoImp, fuente3);
             *      ContextoImp.MoveTo(20, filatex-120);
             *      ContextoImp.Show("CONTRATO  DE  PRESTACION  DE  SERVICIOS  HOSPITALARIOS,  que  celebran  por  una  parte el Hospital  Santa  Cecilia  de  Monterrey  SA. de CV.  En lo sucesivo  ''EL HOSPITAL''  y  por  otra");
             *      ContextoImp.MoveTo(20, filatex-128);
             *      ContextoImp.Show("parte ''EL USUARIO Y/O DEMANDENTE DEL SERVICIO'' cuyos datos aparecen en la caratula del presente documento, al tenor de las siguientes declaraciones y clausulas:");
             *      ContextoImp.MoveTo(269.5, filatex-140);
             *      ContextoImp.Show("D E C L A R A C I O N E S");
             *      ContextoImp.MoveTo(270, filatex-140);
             *      ContextoImp.Show("D E C L A R A C I O N E S");
             *      ContextoImp.MoveTo(19.5, filatex-145);
             *      ContextoImp.Show("I.DECLARA ''EL HOSPITAL'':");
             *      ContextoImp.MoveTo(20, filatex-145);
             *      ContextoImp.Show("I.DECLARA ''EL HOSPITAL'':");
             *      ContextoImp.MoveTo(20, filatex-150);
             *      ContextoImp.Show("I.1  Que  es  una  empresa  legalmente  constituida  conforme la Legislacion Mexicana,  autorizada  por la  secretaria  de Hacienda  y  Credito Publico, según consta  en  la   Escritura  Publica");
             *      ContextoImp.MoveTo(20, filatex-158);
             *      ContextoImp.Show("no.24423  del  05  de  noviembre  del  2002,  pasada ante fe  del  notario  Publico  no. 96 de  la  ciudad de Monterrey  NL.  Lic. Everardo Alanis Guerra,  Inscrita  en  el  registro  publico  de  la");
             *      ContextoImp.MoveTo(20, filatex-166);
             *      ContextoImp.Show("propiedad  y  del comercio  del Estado de Nuevo León,  folio numero 11421  de fecha 18 de noviembre del 2002,  la  cual  fue  modificada  en su razon  y  objeto  social,   mediante   escritura");
             *      ContextoImp.MoveTo(20, filatex-174);
             *      ContextoImp.Show("9508  ante  el  Notario publico 113  Lic. Gonzalo Trevino Sada  en fecha  de 08 de Julio del 2005,  registrada  en el registro publico  de la  propiedad  y  del comercio  mediante folio  mercantil");
             *      ContextoImp.MoveTo(20, filatex-182);
             *      ContextoImp.Show("electronico No. 82769*1 el 11 de julio del 2005.");
             *      //DECLARACIONES
             *      ContextoImp.MoveTo(20, filatex-198);
             *      ContextoImp.Show("I.2 Que su registro federal de contribuyentes es HSC-021105D5A");
             *      ContextoImp.MoveTo(20, filatex-206);
             *      ContextoImp.Show("I.3 Que su domicilio fiscal se encuentra ubicado en Galeana 200 Ote. Monterrey centro entre J. Treviño e Isaac garza, colonia Centro Monterrey N.L.; Codigo postal 64000.");
             *      ContextoImp.MoveTo(20, filatex-214);
             *  ContextoImp.Show("I.4 Que dentro de sus principales actividades se encuentre el porporcionar servicios para la atención de enfermos que se internen para su diagnostico, tratamiento o rehabilitación");
             *      ContextoImp.MoveTo(19.5, filatex-230);
             *  ContextoImp.Show("II. DECLARA ''EL USUARIO O DEMANDANTE DEL SERVICIO:");
             *      ContextoImp.MoveTo(20, filatex-230);
             *  ContextoImp.Show("II. DECLARA ''EL USUARIO O DEMANDANTE DEL SERVICIO");
             *      ContextoImp.MoveTo(20, filatex-238);
             *  ContextoImp.Show("II.1 Que cuenta con la capacidad legal para celebrar el  presente contrato y  es su deseo  contratar los servicios  de ''EL HOSPITAL'' en los terminos  y condiciones que adelante se  establecen.");
             *  ContextoImp.MoveTo(20, filatex-246);
             *  ContextoImp.Show("II.2 Ser lo suficientemente  solvente(s)  economicamente  y  con la liquidez  necesaria para  pagar a  ''EL HOSPITAL'' todos  y   cada uno  de  los  servicios  hospitalarios materia del  presente");
             *  ContextoImp.MoveTo(20, filatex-254);
             *  ContextoImp.Show("contrato.");
             *  //CLAUSULAS
             *  ContextoImp.MoveTo(279.5, filatex-266);
             *  ContextoImp.Show("C L A U S U L A S");
             *  ContextoImp.MoveTo(280, filatex-266);
             *  ContextoImp.Show("C L A U S U L A S");
             *      ContextoImp.MoveTo(19.5, filatex-276);
             *  ContextoImp.Show("PRIMERA:  OBJETO.-  ''EL HOSPITAL''");
             *      ContextoImp.MoveTo(20, filatex-276);
             *  ContextoImp.Show("PRIMERA:  OBJETO.-  ''EL HOSPITAL''  prestara  los  servicios   de   atención   medica,   hospitalaria,   quirurgica,   de   urgencias   y   servicios   clinicos   internos,   extetrnos   y   auxiliares   de");
             *  ContextoImp.MoveTo(20, filatex-284);
             *  ContextoImp.Show("diagnostico  y  tratamiento  en sus instalaciones  de  acuerdo  con  sus normas  y  reglamentos  y  con el equipo,  personal, materiales y medicamentos de  que  sea  posible disponer, y que");
             *  ContextoImp.MoveTo(20, filatex-292);
             *  ContextoImp.Show("sean  indicados  por  su  medico  tratante  y/o  aquellos  que  sean  necesarios   en  caso  de  urgencia,  de  acuerdo a la  capacidad resolutiva  e  instalada de  ''EL HOSPITAL'' conforme a los");
             *  ContextoImp.MoveTo(20, filatex-300);
             *  ContextoImp.Show("procedimientos y normatividad legal aplicable en el ramo de salud.");
             *  ContextoImp.MoveTo(19.5, filatex-316);
             *  ContextoImp.Show("SEGUNDA:  LOS  SERVICIOS.- ");
             *      ContextoImp.MoveTo(20, filatex-316);
             *  ContextoImp.Show("SEGUNDA:  LOS  SERVICIOS.-  Podran  consistir enunciativa  y  no  limitativamente  en  uso  de  equipos  medicos  e  infraestructura   hospitalaria,  exámenes  de  diagnostico  y  tratamiento,");
             *  ContextoImp.MoveTo(20, filatex-324);
             *  ContextoImp.Show("servicios   de   enfermeria  y  personal  paramedico,  suministro   de   medicamentos  e  insumos   para  las  curaciones,  tratamientos  medicos  y  terapeuticos,   interveciones   quirurgicas  y");
             *      ContextoImp.MoveTo(20, filatex-332);
             *  ContextoImp.Show("procedimientos  medicos  que  se  requieran  con  motivo  del  padecimiento  del  usuario  y  de  las  posibles  eventualidades  que   se  pudieran  presentarse  durante  los  tratamientos   y/o");
             *      ContextoImp.MoveTo(20, filatex-340);
             *  ContextoImp.Show("intervenciones    quirurgicas.   Por   su   parte    ''EL  USUARIO   Y/O   DEMANDANTE   DEL   SERVICIO''   se   obliga(n)   a    pagar   a   ''EL HOSPITAL''  el   importe  de  los   servicios  que   sean");
             *      ContextoImp.MoveTo(20, filatex-348);
             *  ContextoImp.Show("proporcionados por motivos del presente contrato.");
             *      ContextoImp.MoveTo(19.5, filatex-364);
             *  ContextoImp.Show("TERCERA: PAQUETE  DE  SERVICIOS.- ");
             *  ContextoImp.MoveTo(20, filatex-364);
             *  ContextoImp.Show("TERCERA: PAQUETE  DE  SERVICIOS.-  Cuando  se  contrate  un paquete  de  servicios,  se  especificará  en  forma  anexa  sus precios  y sus servicios que  lo integran y  dicho  anexo  una vez");
             *  ContextoImp.MoveTo(20, filatex-372);
             *  ContextoImp.Show("firmado por  ''EL USUARIO  Y/O  DEMANDANTE  DEL  SERVICIO''  formara  parte  integrante  de este  contrato.  Todos  los servicios   que   no  se  encuentren  incluidos   en  la  descripcion  del");
             *  ContextoImp.MoveTo(20, filatex-380);
             *  ContextoImp.Show("paquete  repectivo,  o  que  excedan  de  los  limites de dicho paquete deberán de  ser pagados conforme  a los precios  de lista autorizados  de ''EL HOSPITAL'' y que se encuentren vigentes.");
             *  ContextoImp.MoveTo(19.5, filatex-396);
             *  ContextoImp.Show("CUARTA: LUGAR  DE  LA  PRESTACION  DE LOS  SERVICIOS.-");
             *  ContextoImp.MoveTo(20, filatex-396);
             *  ContextoImp.Show("CUARTA: LUGAR  DE  LA  PRESTACION  DE LOS  SERVICIOS.-  Los servicios  serán  proporcionados  en  las instalaciones  de ''EL HOSPITAL'',  las cuales  se ubican  en  Isaac  Garza  200  oriente,");
             *  ContextoImp.MoveTo(20, filatex-404);
             *  ContextoImp.Show("Colonia Centro, entre Galeana y Guerrero en Monterrey N.L. Mexico. C.P. 64000");
             *  ContextoImp.MoveTo(19.5, filatex-420);
             *  ContextoImp.Show("QUINTA:  INSUMOS   Y   MEDICAMENTOS.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO''");
             *  ContextoImp.MoveTo(20, filatex-420);
             *  ContextoImp.Show("QUINTA:  INSUMOS   Y   MEDICAMENTOS.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO''    reconoce(n)     y     manifiesta(n)   su    conformidad    en    que   ''EL   HOSPITAL''    proveera    los");
             *  ContextoImp.MoveTo(20, filatex-428);
             *  ContextoImp.Show("insumos  y  medicamentos  de  uso  común  que  se  requieran  para  la  atención  medica, durante la estancia  hospitalaria,  conforme  a  la  dosis,  cantidades  y  terminos que ordene(n) por");
             *  ContextoImp.MoveTo(20, filatex-436);
             *  ContextoImp.Show("escrito el (los) medicos tratantes(s)");
             *  ContextoImp.MoveTo(19.5, filatex-452);
             *  ContextoImp.Show("SEXTA:   REQUISITOS   PARA   LA  ADMISION   HOSPITALARIA.-  ''EL USUARIO  Y/O  DEMANDANTE  DEL SERVICIO''");
             *  ContextoImp.MoveTo(20, filatex-452);
             *  ContextoImp.Show("SEXTA:   REQUISITOS   PARA   LA  ADMISION   HOSPITALARIA.-  ''EL USUARIO  Y/O  DEMANDANTE  DEL SERVICIO'' debera(n)  registrarse  en el  departamento  de  Admision  de  ''EL HOSPITAL'',");
             *  ContextoImp.MoveTo(20, filatex-460);
             *  ContextoImp.Show("proporcionando    todos    los    datos    generales   e   información   necesaria   para   su   registro,   asi   mismo   deberán  otorgar   el   anticipo   y/o   deposito   en   garantia de  pago   que");
             *  ContextoImp.MoveTo(20, filatex-468);
             *  ContextoImp.Show("establezca el catálogo de precios vigente de ''EL HOSPITAL'', de acuerdo con el motivo de ingreso  y/o  servicio hospitalario al que ingresara ''EL  USUARIO'', recabando el  comprobante  que");
             *  ContextoImp.MoveTo(20, filatex-476);
             *  ContextoImp.Show("al efecto expida ''EL HOSPITAL''.");
             *  ContextoImp.MoveTo(20, filatex-492);
             *  ContextoImp.Show("En  caso  de  que  ''EL USUARIO'' cuente  con  una  poliza  de  seguro de accidente  y/o  enfermedad en los ramos de accidentes personales,  gastos  medicos y/o salud, con una institución de ");
             *  ContextoImp.MoveTo(20, filatex-500);
             *  ContextoImp.Show("seguros legalmente constituida o sea derechohabiente de algúna institución publica a privada la cual tenga convenio celebrado con ''EL HOSPITAL'' para pago directo de los servicios materia");
             *  ContextoImp.MoveTo(20, filatex-508);
             *  ContextoImp.Show("del  presente  contrato, ''EL USUARIO Y/O DEMANDANTE  DEL  SERVICIO''  tendrá(n)   la   obligacion   de   comúnicarlo   al   personal   de   Admision  de  ''EL HOSPITAL''   al   momento   de  su");
             *  ContextoImp.MoveTo(20, filatex-516);
             *  ContextoImp.Show("admision   hospitalaria,   a   fin  de  que  se  lleven  a  cabo   los   procedimientos   convenidos   entre   la   aseguradora  o  institución  correspondiente  y  ''EL  HOSPITAL''.  En  caso de que la");
             *  ContextoImp.MoveTo(20, filatex-524);
             *  ContextoImp.Show("aseguradora   o   institución   no  asuma  la  obligacion  de pago de  los  servicios  ''EL USUARIO  Y/O  DEMANDANTE  DEL  SERVICIO'' tendrá(n)  la obligacion de  pagar  a  ''EL  HOSPITAL'',  en");
             *  ContextoImp.MoveTo(20, filatex-532);
             *  ContextoImp.Show("los terminos señalados en la clausula decima primera, todos los servicios prestados con motivo del presente contrato.");
             *  ContextoImp.MoveTo(20, filatex-548);
             *  ContextoImp.Show("Asi mismo ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' se obligan al pago de todos los cargos de los servicios no incluidos, no cubiertos, por la aseguradora o institución correspondiente,");
             *  ContextoImp.MoveTo(20, filatex-556);
             *  ContextoImp.Show("asi como el pago de coaseguro, deducibles o cualquier otra cantidad establecida por su aseguradora o institución.");
             *  ContextoImp.MoveTo(19.5, filatex-572);
             *  ContextoImp.Show("SEPTIMA: INGRESO DE OBJETOS PERSONALES.- ''EL HOSPITAL''");
             *  ContextoImp.MoveTo(20, filatex-572);
             * ContextoImp.Show("SEPTIMA: INGRESO DE OBJETOS PERSONALES.- ''EL HOSPITAL'' no se hace responsable por la perdida, daño o robo de los objetos o valores de ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO''");
             *  ContextoImp.MoveTo(20, filatex-580);
             *  ContextoImp.Show("que se introduzcan a ''EL HOSPITAL''. En los casos de pacientes programados, no presentarse con objetos de valor a ''EL HOSPITAL''.");
             *  //Pie de pagina
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(490, filatex-620);
             *  ContextoImp.Show("FO-DMH-08/REV.02/04-OCT-06");
             *  Gnome.Print.Setfont (ContextoImp, fuente1);
             *  ContextoImp.MoveTo(20, filatex-640);
             *      ContextoImp.Show("____________________________");
             *
             *
             *  if ((bool) lector.Read())
             *      {
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(20, filatex-10);
             *              ContextoImp.Show("Nombre: "+(string) lector["nombre1_paciente"]+" "+(string) lector["nombre2_paciente"]+" "+(string) lector["apellido_paterno_paciente"]+" "+(string) lector["apellido_materno_paciente"]);
             *              ContextoImp.MoveTo(50, filatex-10);
             *              ContextoImp.MoveTo(20, filatex-20);
             *              ContextoImp.Show("Domicilio: "+(string) lector["direccion_paciente"]+" "+(string) lector["numero_casa_paciente"]+" "+(string) lector["numero_departamento_paciente"]+" "+(string) lector["colonia_paciente"]+" "+(string) lector["codigo_postal_paciente"]+" "+(string) lector["municipio_paciente"]+" "+(string) lector["estado_paciente"]);
             *              ContextoImp.MoveTo(20, filatex-30);
             *              ContextoImp.Show("Telefono: "+(string) lector["telefono_particular1_paciente"]+" ");
             *              ContextoImp.MoveTo(20, filatex-60);
             *              ContextoImp.Show("Nombre: "+(string) lector["responsable_cuenta"]+" ");
             *              ContextoImp.MoveTo(20, filatex-70);
             *              ContextoImp.Show("Domicilio: "+(string) lector["direccion_responsable_cuenta"]+" ");
             *              ContextoImp.MoveTo(20, filatex-80);
             *              ContextoImp.Show("Telefono: "+(string) lector["telefono1_responsable_cuenta"]+" ");
             *              ContextoImp.MoveTo(20, filatex-90);
             *              ContextoImp.Show("Nombre del medico tratante del usuario: "+medico.ToString()); //(string) lector["nombre_medico"]+" ");
             *              ContextoImp.MoveTo(20, filatex-100);
             *              ContextoImp.Show("Fecha y hora de ingreso: "+(string) lector["fecha_ing"]+"      "+(string) lector["hora_ing"]);
             *      }
             * lector.Close ();
             *      ContextoImp.ShowPage();
             * //PAGINA 2
             * ContextoImp.BeginPage("Pagina 2");
             * //Encabezado de pagina
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(19.5, 750);
             * ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             * ContextoImp.MoveTo(20, 750);
             * ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(19.5, 740);
             *  ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             * ContextoImp.MoveTo(20, 740);
             * ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             *      ContextoImp.MoveTo(19.5, 730);
             *  ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *  ContextoImp.MoveTo(20, 730);
             * ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *      Gnome.Print.Setfont (ContextoImp, fuente);
             *      ContextoImp.MoveTo(89.5, 708);
             * ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *      ContextoImp.MoveTo(90, 708);
             * ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *      Gnome.Print.Setfont (ContextoImp, fuente1);
             * ContextoImp.MoveTo(20, 708);
             * ContextoImp.Show("____________________________");
             *  //CONTINUACION CLAUSULAS
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(19.5, filatex);
             *  ContextoImp.Show("OCTAVA: CONSENTIMIENTO INFORMADO.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO''");
             *  ContextoImp.MoveTo(20, filatex);
             *  ContextoImp.Show("OCTAVA: CONSENTIMIENTO INFORMADO.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' manifiesta(n) que ha(n)  sido  inforado(s)  de  los  riesgos  que  implican cualquier  atención  medica,");
             *  ContextoImp.MoveTo(20, filatex-8);
             *  ContextoImp.Show("asi como de sus beneficios, de los cuales esta(n) conciente(s), por lo que reconoce(n) que pueden presentarse eventualidades que varien o modifiquen el diagnostico y/o tratamiento medico ");
             * ContextoImp.MoveTo(20, filatex-16);
             *      ContextoImp.Show("inicial. Sin embargo autorizan expresamente a ''EL HOSPITAL'' y a su(s) medico(s) tratante(s) para que presenen y practiquen al usuario los procedimientos medicos, quirurgicos, hospitalarios,");
             * ContextoImp.MoveTo(20, filatex-24);
             *  ContextoImp.Show("exámenes  y  curaciones  que  sean necesarios  de  acuerdo  al  padecimiento  y  a  las  posibles eventualidades  que  pudieran presentarse durante los mismos. De igual forma, otorga(n) su");
             *  ContextoImp.MoveTo(20, filatex-32);
             *  ContextoImp.Show("consentimiento  para  que  el/los  medico(s)  tratante(s)  de  ''EL USUARIO''  ordene(n)  la  practica  de  exámenes,  curaciones,  tratamientos e intervenciones de otros medicos,  asi  como  la");
             * ContextoImp.MoveTo(20, filatex-40);
             * ContextoImp.Show("administracion de anestesicos, sangre y/o medicamentos que consideren oportunos.");
             * ContextoImp.MoveTo(19.5, filatex-56);
             * ContextoImp.Show("NOVENA: REGLAMENTO PARA VISITANTES.-");
             * ContextoImp.MoveTo(20, filatex-56);
             * ContextoImp.Show("NOVENA: REGLAMENTO PARA VISITANTES.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' se compromete(n) a cumplir el reglamento patra visitantes de ''EL HOSPITAL'' el cual manifiesta(n)");
             * ContextoImp.MoveTo(20, filatex-62);
             *  ContextoImp.Show("conocer por haberlo leido antes de la firma del presente contrato. Un ejemplar del dicho reglamento queda a dispocision de ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' para su consulta ");
             *  ContextoImp.MoveTo(20, filatex-70);
             *  ContextoImp.Show("en el departamento de admision de ''EL HOSPITAL''.");
             *  ContextoImp.MoveTo(19.5, filatex-86);
             *  ContextoImp.Show("DECIMA: PRECIO.-");
             *  ContextoImp.MoveTo(20, filatex-86);
             *  ContextoImp.Show("DECIMA: PRECIO.-Las partes contratantes convienen en que el precio de los servicios que sean proporcionados con motivo del presente contrato, sera  el que resulte  de aplicar los precios y ");
             *  ContextoImp.MoveTo(20, filatex-94);
             *  ContextoImp.Show("tarifas que ''EL HOSPITAL'' tenga vigentes en la fecha de contratacion de los servicios, por lo que ''EL HOSPITAL'' deja a dispocicion  de  ''EL  USUARIO  Y/O  DEMANDANTE  DEL  SERVICIO''  el ");
             *  ContextoImp.MoveTo(20, filatex-102);
             *  ContextoImp.Show("catálogo o lista de precios y tarifas vigentes.");
             *  ContextoImp.MoveTo(20, filatex-110);
             *  ContextoImp.Show("FO-DMH-08/REV.02/04-OCT-06");
             *  ContextoImp.MoveTo(19.5, filatex-126);
             *  ContextoImp.Show("DECIMA PRIMERA: PROCEDIMIENTO DE PAGO.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO''");
             *  ContextoImp.MoveTo(20, filatex-126);
             *  ContextoImp.Show("DECIMA PRIMERA: PROCEDIMIENTO DE PAGO.- ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' se obliga(n)  a  pagar diariamente a  ''EL HOSPITAL''  los servicios proporcionados, conforme  al ");
             *  ContextoImp.MoveTo(20, filatex-134);
             *  ContextoImp.Show("estado de cuenta correspondiente, el cual ''EL HOSPITAL'' pondra a su dispocision en forma diaria, de tal manera que  al  final  de  cada dia hospitalario  se  encuentren cubiertos los servicios ");
             *  ContextoImp.MoveTo(20, filatex-142);
             *  ContextoImp.Show("otorgados al usuario.");
             *  ContextoImp.MoveTo(20, filatex-150);
             *  ContextoImp.Show("Tratandose  de  paquetes  de  servicios  el  precio  y  forma  de pago  de  los  mismos serán  establecidos de forma anexa al presente contrato, en el entendido que todos los servicios que no");
             *  ContextoImp.MoveTo(20, filatex-158);
             *  ContextoImp.Show("se  encuentren  incluidos  en  la  descripcion  del  paquete  respectivo,  o  que  excedan  los  limites  de  dichos  paquetes  deberán   ser   pagados  en  los   terminos   del   presente  contrato.");
             *  ContextoImp.MoveTo(19.5, filatex-174);
             *  ContextoImp.Show("DECIMA SEGUNDA: OBLIGACION DEL PAGO.- ");
             *  ContextoImp.MoveTo(20, filatex-174);
             *  ContextoImp.Show("DECIMA SEGUNDA: OBLIGACION DEL PAGO.- Las partes contratantes convienen en que la responsabilidad  por  el  pago  de  los  servicios, conforme al catálogo  de precios  y  tarifas vigente");
             *  ContextoImp.MoveTo(20, filatex-182);
             *  ContextoImp.Show("de ''EL HOSPITAL'', recaera solidariamente sobre ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'', de conformidad  con los  dispuestos en los  articulos 181,  1883, 1892  y  1896  del  Codigo ");
             *  ContextoImp.MoveTo(20, filatex-190);
             *  ContextoImp.Show("Civil vigente en el Estado de Nuevo León.");
             *  ContextoImp.MoveTo(20, filatex-198);
             *  ContextoImp.Show("Las partes contratantes convienen en que si el monto llegara a rebasar la capacidad economica y/o liquidez de ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'', este(os)  debera(n)  informar");
             *  ContextoImp.MoveTo(20, filatex-206);
             *  ContextoImp.Show("a ''EL HOSPITAL'' y trasladar de inmediato al usuario a otra institución hospitalaria. Con el fin de evitar incurrir en mora o falta de pago de los servicios.");
             *  ContextoImp.MoveTo(20, filatex-222);
             *  ContextoImp.Show("En caso que no se cumpla lo establecido  en  el  párrafo  anterior,  ''EL HOSPITAL''  podrá  realizar  el  traslado  del  usuarios  a  una institución hospitalaria pública, quedando  ''EL HOSPITAL''");
             *  ContextoImp.MoveTo(20, filatex-230);
             *  ContextoImp.Show("liberado   del   incumplimiento  de  las  obligaciones  que  corran  a  su  cargo  con  motivo  del  presente  contrato  y  contando  desde  ahora  con  el  consentimiento  de  ''EL  USUARIO   Y/O");
             *  ContextoImp.MoveTo(20, filatex-238);
             *  ContextoImp.Show("DEMANDANTE DEL  SERVICIO''  para  ese  efecto,  en  el  entendido  que  el  tras  lado  del  usuario no extinguirá la obligación  de pago  de los servicios  proporcionados  y  no pagados  antes");
             *  ContextoImp.MoveTo(20, filatex-246);
             *  ContextoImp.Show("de realizarse  el  traslado.  Antes  de  realizar  el  traslado,  ''EL HOSPITAL'' se  obliga  a dar  aviso  fehacientemente  al  usuario  y/o  demandante  del  servicio  de   que   se   efectuará  dicho");
             *  ContextoImp.MoveTo(20, filatex-254);
             *  ContextoImp.Show("traslado, especificando los datos de la Unidad Médica receptora.");
             *  ContextoImp.MoveTo(20, filatex-270);
             *  ContextoImp.Show("Las  partes  contratantes  convienen  en que  sobre  las  cantidades vencidas  y  no pagadas,  ''EL HOSPITAL''  podrá cobrar intereses moratorios aplicando el TIEE  por  tres  anual,  desde  el");
             *  ContextoImp.MoveTo(20, filatex-278);
             *  ContextoImp.Show("día siguiente en que debió haberse realizado el pago y hasta el momento en que se liquide el adeudo.");
             *  ContextoImp.MoveTo(20, filatex-294);
             *  ContextoImp.Show("Para efectos del presente contrato, TIEE  significa  Tasa  de  Interés  Interbancaria  de  Equilibrio  a   28   días,  publicada  por  el  Banco  de  México  al  momento   de  ser  aplicable  la  pena");
             *  ContextoImp.MoveTo(20, filatex-302);
             *  ContextoImp.Show("convencional que establece este contrato.");
             *  ContextoImp.MoveTo(19.5, filatex-318);
             *  ContextoImp.Show("DECIMA TERCERA: PROCEDIMIENTO PARA EL ALTA DEL USUARIO.- ");
             *  ContextoImp.MoveTo(20, filatex-318);
             *  ContextoImp.Show("DECIMA TERCERA: PROCEDIMIENTO PARA EL ALTA DEL USUARIO.- El egreso (alta) del usuario de ''EL HOSPITAL'' se verificara cuando el médico tratante  del  usuario haga constar  por  escrito");
             *  ContextoImp.MoveTo(20, filatex-326);
             *  ContextoImp.Show("en el expediente clínico del usuario la orden de alta respectiva o cuando  se  solicite  el  egreso voluntario  del  usuario  y  se  firme  el  formato  que  para  tal  efecto elabore  un  médico  de");
             *  ContextoImp.MoveTo(20, filatex-334);
             *  ContextoImp.Show("''EL HOSPITAL''. Previo  a  su  retiro, ''EL USUARIO Y/O DEMANDANTE DEL SERVICIO'' deberá(n) liquidar  en  la  caja  de  pago  de  ''EL  HOSPITAL'',  el   total   de   la  cuenta  de  los  servicios ");
             *  ContextoImp.MoveTo(20, filatex-342);
             *  ContextoImp.Show("proporcionados, debiendo recabar en dicha caja la papelería que contenga el pase de salida correspondiente,  mismo  que  deberá  ser  entregado  por  ''EL USUARIO  Y/O DEMANDANTE DEL");
             *  ContextoImp.MoveTo(20, filatex-350);
             *  ContextoImp.Show("SERVICIO'' a la Jefa de Enfermeras de ''EL HOSPITAL'' al momento de su egreso.");
             *  ContextoImp.MoveTo(20, filatex-366);
             *  ContextoImp.Show("El anticipo y/o depósito en garantía será aplicado a la cuenta al momento  de  liquidar el  importe total  de los  servicios proporcionados, es decir, el  día  en  que  el usuario sea dado de alta");
             *  ContextoImp.MoveTo(20, filatex-374);
             *  ContextoImp.Show("y previamente a que abandone las instalaciones de ''EL HOSPITAL''; en el entendido que cualquier excedente será devuelto de inmediato por ''EL HOSPITAL''");
             *  ContextoImp.MoveTo(19.5, filatex-390);
             *  ContextoImp.Show("DECIMA CUARTA: LÍMITES PARA LA CONTRATACIÓN DE SERVICIOS CON TERCEROS.- ");
             *  ContextoImp.MoveTo(20, filatex-390);
             *  ContextoImp.Show("DECIMA CUARTA: LÍMITES PARA LA CONTRATACIÓN DE SERVICIOS CON TERCEROS.- Las partes contratantes convienen expresamente que  ''EL HOSPITAL'' no asume  ninguna responsabilidad");
             *  ContextoImp.MoveTo(20, filatex-398);
             *  ContextoImp.Show("sobre  la  actuación  profesional  de  los  médicos  particulares (médicos  tratantes)   del   usuario  y/o   de  terceras  personas  que  proporcionen  servicio  de  atención  medica   al   usuario,");
             *  ContextoImp.MoveTo(20, filatex-406);
             *  ContextoImp.Show("cuando tales profesionistas y/o servicios sean contratados directamente por 'EL USUARIO Y/O DEMANDANTE DEL SERVICIO'', por lo que reconocen que el pago de estos servicios");
             *  ContextoImp.MoveTo(20, filatex-414);
             *  ContextoImp.Show("será liquidado de manera independiente a la cuenta de los servicios materia del presente contrato.");
             *  ContextoImp.MoveTo(19.5, filatex-430);
             *  ContextoImp.Show("DECIMA QUINTA: CONFIDENCIALIDAD.- ");
             *      ContextoImp.MoveTo(20, filatex-430);
             *  ContextoImp.Show("DECIMA QUINTA: CONFIDENCIALIDAD.-  Salvo  en  los  casos  que  ''EL  HOSPITAL''  debe  proporcionar  información  del  usuario  a  la  autoridad  competente,  ''EL HOSPITAL''  se  obliga  a");
             *  ContextoImp.MoveTo(20, filatex-438);
             *  ContextoImp.Show("dar trato confidencial a la  información  contenida  en  el  expediente  del  usuario,  comprometiéndose  a  no  revelar  a  terceros  sin  autorización  escrita  de  éste. Desde este momento ''EL");
             *  ContextoImp.MoveTo(20, filatex-446);
             *  ContextoImp.Show("USUARIO  Y/O  DEMANDANTE  DEL  SERVICIO''  autoriza(n)  a  ''EL HOSPITAL''  para  que  proporcione  toda  la  información,  y  en  su  caso  documentación  referente a la  hospitalización  del");
             *  ContextoImp.MoveTo(20, filatex-454);
             *  ContextoImp.Show("usuario, la compañía de seguros con quien tenga(n) contratada una póliza de seguro de accidentes personales, gastos médicos y/o salud, o la institución de la que sea(n) derechohabiente(s).");
             *  ContextoImp.MoveTo(20, filatex-462);
             *  ContextoImp.Show("");
             *  ContextoImp.MoveTo(19.5, filatex-478);
             *  ContextoImp.Show("DECIMA SEXTA: PROCEDIMIENTO PARA PRESENTAR SUGERENCIA, RECLAMACIONES O QUEJAS.-”EL USUARIO Y/O DEMANDANTE DEL SERVICIO”");
             *  ContextoImp.MoveTo(20, filatex-478);
             *  ContextoImp.Show("DECIMA SEXTA: PROCEDIMIENTO PARA PRESENTAR SUGERENCIA, RECLAMACIONES O QUEJAS.-”EL USUARIO Y/O DEMANDANTE DEL SERVICIO”  podrá(n) presentar sugerencia,  reclamaciones");
             *  ContextoImp.MoveTo(20, filatex-486);
             *  ContextoImp.Show("o quejas relativas a los servicios materia del  presente contrato en el  departamento jurídico de  “EL HOSPITAL”, mismas que deberán ser atendidas en  un  tiempo  máximo  de 15-quince  días");
             *  ContextoImp.MoveTo(20, filatex-494);
             *  ContextoImp.Show("hábiles.");
             *  ContextoImp.MoveTo(20, filatex-510);
             *  ContextoImp.Show("En caso que algúna de las partes contratantes incurra en una o varias de las causales de incumplimiento adelante señaladas, deberán pagar a la otra parte, como pena convencional, el 10% ");
             *  ContextoImp.MoveTo(20, filatex-518);
             *  ContextoImp.Show("del monto total de los servicios proporcionados  y  facturados  por  ''EL  HOSPITAL'' con motivo  del  presente  contrato.  Sin  que ello libere al  usuario  y/o  demandante  del  servicio  de  sus");
             *  ContextoImp.MoveTo(20, filatex-526);
             *  ContextoImp.Show("obligaciones de pago de dichos servicios.");
             *  ContextoImp.MoveTo(19.5, filatex-542);
             *  ContextoImp.Show("DECIMA SEPTIMA: CAUSAS DE INCLUMPLIMIENTO DE “EL HOSPITAL”.-");
             *  ContextoImp.MoveTo(20, filatex-542);
             *  ContextoImp.Show("DECIMA SEPTIMA: CAUSAS DE INCLUMPLIMIENTO DE “EL HOSPITAL”.-");
             *  ContextoImp.MoveTo(50, filatex-550);
             *  ContextoImp.Show("a)No proporcionar los servicios hospitalarios contratados conforme a su capacidad resolutiva e instalada.");
             *  ContextoImp.MoveTo(50, filatex-558);
             *  ContextoImp.Show("b)No respetar el precio de los servicios en los términos contratados.");
             *  ContextoImp.MoveTo(50, filatex-566);
             *  ContextoImp.Show("c)No proporcionar los insumos y medicamentos de uso común que soliciten los médicos tratantes e ínter consultantes durante la estancia hospitalaria del usuario.");
             *  //PIE DE PAGINA
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(490, filatex-620);
             *  ContextoImp.Show("FO-DMH-08/REV.02/04-OCT-06");
             *  Gnome.Print.Setfont (ContextoImp, fuente1);
             *  ContextoImp.MoveTo(20, filatex-640);
             *      ContextoImp.Show("____________________________");
             *      ContextoImp.ShowPage();
             *  //PAGINA TRES
             *  ContextoImp.BeginPage("Pagina 3");
             *  //Encabezado de pagina
             *      Gnome.Print.Setfont (ContextoImp, fuente2);
             *      ContextoImp.MoveTo(19.5, 750);
             *  ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             *  ContextoImp.MoveTo(20, 750);
             *  ContextoImp.Show("Hospital Santa Cecilia de Monterrey");
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(19.5, 740);
             *  ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             *  ContextoImp.MoveTo(20, 740);
             *  ContextoImp.Show("Dirección: Isaac Garza #200 Ote. Centro Monterrey, NL.");
             *      ContextoImp.MoveTo(19.5, 730);
             *  ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *  ContextoImp.MoveTo(20, 730);
             *  ContextoImp.Show("Conmutador:(81) 81-25-56-10");
             *  Gnome.Print.Setfont (ContextoImp, fuente);
             *      ContextoImp.MoveTo(89.5, 708);
             *  ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *      ContextoImp.MoveTo(90, 708);
             *  ContextoImp.Show("CONTRATO DE PRESTACIONES DE SERVICIOS MEDICOS HOSPITALARIOS");
             *  Gnome.Print.Setfont (ContextoImp, fuente1);
             *  ContextoImp.MoveTo(20, 708);
             *      ContextoImp.Show("____________________________");
             *  //CONTINUACION CLAUSULAS
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(20, filatex);
             *  ContextoImp.Show("Leído que fue el presente contrato y enteradas  las  partes contratantes del contenido y alcance legal, lo firman de conformidad  en  la  Ciudad  de  Monterrey  N.L.,  en  la  fecha  de  ingreso");
             *  ContextoImp.MoveTo(20, filatex-8);
             * ContextoImp.Show("hospitalario  que  aparece  en  la  carátula  de  éste   documento,  manifestando desde este momento que para el caso  de  controversia sobre  su  interpretación, cumplimiento ejecución  se");
             * ContextoImp.MoveTo(20, filatex-16);
             * ContextoImp.Show("someterán  a las  leyes aplicables  y  a  la  competencia  de  los  tribunales de la Ciudad de Monterrey N.L. renunciando expresamente a cualquier otro fuero que pudiera corresponderles por");
             *  ContextoImp.MoveTo(20, filatex-24);
             *  ContextoImp.Show("razón  de  su  domicilio presente o  futuro  o  cualquier  otra  causa,  en  el  entendido  que  cualquier  reclamación  de  ''EL  USUARIO   Y/O   DEMANDANTE   DEL   SERVICIO''  deberá   agotar");
             *  ContextoImp.MoveTo(20, filatex-32);
             *  ContextoImp.Show("previamente  el  procedimiento conciliatorio de la  Procuraduría Federal del Consumidor.  En la  Ciudad de Monterrey,  Nuevo León siendo  el día "+DateTime.Now.ToString("dd")+ "  del  "+ DateTime.Now.ToString("MM")+"  del año  "+DateTime.Now.ToString("yyyy"));
             *  ContextoImp.MoveTo(30, filatex-190);
             *  ContextoImp.Show("_______________________________________________________");
             *  ContextoImp.MoveTo(45, filatex-190);
             *  ContextoImp.Show((string) lector["nombre1_paciente"]+" "+(string) lector["nombre2_paciente"]+" "+(string) lector["apellido_paterno_paciente"]+" "+(string) lector["apellido_materno_paciente"]);
             *  ContextoImp.MoveTo(420, filatex-190);
             *  ContextoImp.Show("______________________________________");
             *  ContextoImp.MoveTo(89.5, filatex-200);
             *  ContextoImp.Show("EL USUARIO");
             *  ContextoImp.MoveTo(90, filatex-200);
             *  ContextoImp.Show("EL USUARIO");
             *  ContextoImp.MoveTo(459.5, filatex-200);
             *  ContextoImp.Show("EL HOSPITAL");
             *  ContextoImp.MoveTo(460, filatex-200);
             *  ContextoImp.Show("EL HOSPITAL");
             *  ContextoImp.MoveTo(220, filatex-400);
             *  ContextoImp.Show("________________________________________________");
             *  ContextoImp.MoveTo(249.5, filatex-410);
             *  ContextoImp.Show("EL DEMANDANTE DEL SERVICIO");
             *  ContextoImp.MoveTo(250, filatex-410);
             *  ContextoImp.Show("EL DEMANDANTE DEL SERVICIO");
             *          //Pie de pagina
             *  Gnome.Print.Setfont (ContextoImp, fuente3);
             *  ContextoImp.MoveTo(490, filatex-620);
             *  ContextoImp.Show("FO-DMH-08/REV.02/04-OCT-06");
             *  Gnome.Print.Setfont (ContextoImp, fuente1);
             *  ContextoImp.MoveTo(20, filatex-640);
             * ContextoImp.Show("____________________________");
             *
             *      conexion.Close ();
             *      //TERMINAN de funcionar la conexion con postgresql
             *      ContextoImp.ShowPage();
             * }catch (NpgsqlException ex){
             *      Console.WriteLine ("PostgresSQL error: {0}",ex.Message);
             *      return;
             * }
             */
        }
Exemplo n.º 16
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * ContextoImp.MoveTo(150, 775);
             * ContextoImp.Show("COORDINACIÓN DE SERVICIOS AL PERSONAL");
             * ContextoImp.MoveTo(152, 760);
             * ContextoImp.Show("RECURSOS HUMANOS - REGISTRO DE ALTA");
             *
             * //ContextoImp.MoveTo(150, );
             *
             * //Registro de Alta:
             * Gnome.Print.Setfont (ContextoImp, fuente2);
             * int linea = 735;
             * int separacion = -10;
             * ContextoImp.MoveTo(20, linea);
             * linea +=  separacion;
             * ContextoImp.Show("NUM. DE EMPLEADO: " +id_empleado);
             * ContextoImp.MoveTo(365, 735);
             * ContextoImp.Show("NUM. DE LOCKERS:  "+locker);
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("NOMBRE: " + appaterno+ " " + apmaterno+ " " +nom1 + " " + nom2 +"");
             * linea +=  separacion;
             * ContextoImp.MoveTo(365, 715);
             * ContextoImp.Show("FECHA DE NACIMIENTO: " +dia_nac+ "/"+mes_nac+ "/"+anno_nac);
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("LUGAR DE NACIMIENTO: " +lugar_nac );
             * ContextoImp.MoveTo(365, 695);
             * ContextoImp.Show("EDAD: " +edad );
             * linea +=  separacion;
             * ContextoImp.MoveTo(420, 695);
             * ContextoImp.Show("" );
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("DOMICILIO PARTICULAR: "+calle_empleado+ " " +numcalle_empleado+    "    Colonia: " +colonia_empleado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(315, 675);
             * ContextoImp.Show("");
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, 655);
             * ContextoImp.Show("MUNICIPIO: " +tmp_municipios);
             * linea +=  separacion;
             * ContextoImp.MoveTo(365, 655);
             * ContextoImp.Show("ESTADO: " +tmp_estado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("CODIGO POSTAL: " + codigo_postal);
             * linea +=  separacion;
             * ContextoImp.MoveTo(200, 635);
             * ContextoImp.Show("CASA: "+var_tipo_casa  );
             * ContextoImp.MoveTo(365, 635);
             * ContextoImp.Show("TIEMPO DE RESIDENCIA:" +residencia_empleado+ "años");
             * linea +=  separacion;
             * ContextoImp.MoveTo(20,  linea);
             * ContextoImp.Show("ESTADO CIVIL: " +tmp_estado_civil );
             * linea +=  separacion;
             * ContextoImp.MoveTo(200, 615);
             * ContextoImp.Show("TELEFONO: " +tel1);
             * ContextoImp.MoveTo(365, 615);
             * ContextoImp.Show("R.F.C. " +rfc_empleado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("No. SEGURO SOCIAL: " +imss_empleado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(365, 595);
             * ContextoImp.Show("CURP: " +curp_empleado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(20, linea);
             * ContextoImp.Show("INFONAVIT: " +infonavit_empleado);
             * linea +=  separacion;
             * ContextoImp.MoveTo(365, 575);
             * ContextoImp.Show("AFORE: " + afore_empleado);
             * ContextoImp.MoveTo(240, 530);
             * Gnome.Print.Setfont (ContextoImp, fuente4);
             * ContextoImp.Show("DATOS CONTRATO");
             * Gnome.Print.Setfont (ContextoImp, fuente2);
             * ContextoImp.MoveTo(20, 495);
             * ContextoImp.Show("FECHA DE INGRESO: " +dia_ingreso+ "/"+mes_ingreso+ "/"+anno_ingreso);
             * ContextoImp.MoveTo(300, 495);
             * ContextoImp.Show("PUESTO: " +nombrepuesto);
             * ContextoImp.MoveTo(300, 475);
             * ContextoImp.Show("DEPARTAMENTO: " +depto_empleado);
             * ContextoImp.MoveTo(20, 475);
             * ContextoImp.Show("SUELDO : $"+sueldo_actual_oculta);
             * ContextoImp.MoveTo(20, 455);
             * ContextoImp.Show("TIPO CONTRATO: " +contrato_empleado);
             * ContextoImp.MoveTo(300, 455);
             * ContextoImp.Show("TIPO DE PAGO: "+tipo_pago_oculta);
             * ContextoImp.MoveTo(240, 415);
             * Gnome.Print.Setfont (ContextoImp, fuente4);
             * ContextoImp.Show("DATOS FAMILIARES");
             * Gnome.Print.Setfont (ContextoImp, fuente2);
             * ContextoImp.MoveTo(20, 385);
             * ContextoImp.Show("NOMBRE PADRE: " +nom_padre);
             * ContextoImp.MoveTo(20, 365);
             * ContextoImp.Show("NOMBRE MADRE: " +nom_madre);
             * ContextoImp.MoveTo(30,330);
             * Gnome.Print.Setfont (ContextoImp, fuente4);
             * ContextoImp.Show("NOTAS:");
             * Gnome.Print.Setfont (ContextoImp, fuente2);
             * ContextoImp.MoveTo(90, 330);
             * ContextoImp.Show(notas_empleado);
             * ContextoImp.MoveTo(20, 200);
             * Gnome.Print.Setfont (ContextoImp, fuente4);
             * ContextoImp.Show(""+nom1 +  " " + nom2 +  " "+ appaterno+ " "+ apmaterno+"");
             * ContextoImp.MoveTo(365,200); ContextoImp.Show("JEFE DE RECURSOS HUMANOS");
             * ContextoImp.MoveTo(200,80);	ContextoImp.Show("GENERADOR DE NOMINAS");
             * ContextoImp.ShowPage();
             */
        }
Exemplo n.º 17
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * filas=690;
             * contador=1;
             * string tomovalor1 = "";
             * int contadorprocedimientos = 0;
             * NpgsqlConnection conexion;
             * conexion = new NpgsqlConnection (connectionString+nombrebd);
             * // Verifica que la base de datos este conectada
             * try{
             *      conexion.Open ();
             *      NpgsqlCommand comando;
             *      comando = conexion.CreateCommand ();
             *      comando.CommandText = "SELECT osiris_catalogo_almacenes.id_almacen,to_char(osiris_productos.id_producto,'999999999999') AS codProducto,"+
             *                                      "osiris_productos.descripcion_producto AS descripcion, "+
             *                                      "to_char(osiris_catalogo_almacenes.stock,'999999999999.99') AS stock,"+
             *                                      "to_char(osiris_catalogo_almacenes.minimo_stock,'999999999999.99') AS minstock,"+
             *                                      "to_char(osiris_catalogo_almacenes.maximo,'999999999999.99') AS maxstock,"+
             *                                      "to_char(osiris_catalogo_almacenes.punto_de_reorden,'999999999999.99') AS reorden,"+
             *                                      "to_char(osiris_catalogo_almacenes.fechahora_ultimo_surtimiento,'yyyy-MM-dd') AS fechsurti, "+
             *                                      "descripcion_grupo_producto,descripcion_grupo1_producto,descripcion_grupo2_producto, "+
             *                                      "to_char(precio_producto_publico,'99999999.99') AS preciopublico,"+
             *                                      "to_char(costo_por_unidad,'999999999.99') AS costoproductounitario, "+
             *                                      "to_char(costo_producto,'999999999.99') AS costoproducto, "+
             *                                      "to_char(cantidad_de_embalaje,'999999999.99') AS embalaje "+
             *                                      "FROM osiris_catalogo_almacenes,osiris_productos,osiris_grupo_producto,osiris_grupo1_producto,osiris_grupo2_producto "+
             *                                      "WHERE osiris_catalogo_almacenes.id_producto = osiris_productos.id_producto "+
             *                                      "AND osiris_productos.id_grupo_producto = osiris_grupo_producto.id_grupo_producto "+
             *                                      "AND osiris_productos.id_grupo1_producto = osiris_grupo1_producto.id_grupo1_producto "+
             *                                      "AND osiris_productos.id_grupo2_producto = osiris_grupo2_producto.id_grupo2_producto "+
             *                                      "AND osiris_catalogo_almacenes.id_producto = osiris_productos.id_producto "+
             *                                      "AND osiris_grupo_producto.agrupacion4 = 'ALM' "+
             *                                      "AND osiris_productos.cobro_activo = 'true' "+
             *                                      "AND osiris_catalogo_almacenes.eliminado = 'false' "+
             *                                      query_grupo+
             *                                      query_grupo1+
             *                                      query_grupo2+
             *                                      query_stock+
             *                                      " AND osiris_catalogo_almacenes.id_almacen = '"+idsubalmacen.ToString().Trim()+"' "+
             *                                      "ORDER BY descripcion_producto; ";
             *      NpgsqlDataReader lector = comando.ExecuteReader ();
             *      ContextoImp.BeginPage("Pagina 1");
             *      imprime_encabezado(ContextoImp,trabajoImpresion);
             *      Gnome.Print.Setfont (ContextoImp, fuente6);
             *      if (lector.Read())
             *      {
             *              ContextoImp.MoveTo(15, filas);		ContextoImp.Show((string) lector["codProducto".Trim()]);
             *              tomovalor1 = (string) lector["descripcion"];
             *              if(tomovalor1.Length > 65)
             *              {
             *                      tomovalor1 = tomovalor1.Substring(0,65);
             *              }
             *              ContextoImp.MoveTo(65, filas);		ContextoImp.Show(tomovalor1);
             *              ContextoImp.MoveTo(300, filas);		ContextoImp.Show((string) lector["stock"]);
             *              ContextoImp.MoveTo(340, filas);		ContextoImp.Show("_____");
             *              ContextoImp.MoveTo(350, filas);		ContextoImp.Show((string) lector["minstock"]);
             *              ContextoImp.MoveTo(380, filas);		ContextoImp.Show((string) lector["maxstock"]);
             *              ContextoImp.MoveTo(430, filas);		ContextoImp.Show((string) lector["reorden".Trim()]);
             *              ContextoImp.MoveTo(510, filas);		ContextoImp.Show((string) lector["fechsurti"]);
             *              filas-=10;
             *              contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      }
             *      while (lector.Read()){
             *              ContextoImp.MoveTo(15, filas);		ContextoImp.Show((string) lector["codProducto".Trim()]);
             *              tomovalor1 = (string) lector["descripcion"];
             *              if(tomovalor1.Length > 65){
             *                      tomovalor1 = tomovalor1.Substring(0,65);
             *              }
             *              ContextoImp.MoveTo(65, filas);		ContextoImp.Show(tomovalor1);
             *              ContextoImp.MoveTo(300, filas);		ContextoImp.Show((string) lector["stock"]);
             *              ContextoImp.MoveTo(340, filas);		ContextoImp.Show("_____");
             *              ContextoImp.MoveTo(350, filas);		ContextoImp.Show((string) lector["minstock"]);
             *              ContextoImp.MoveTo(380, filas);		ContextoImp.Show((string) lector["maxstock"]);
             *              ContextoImp.MoveTo(430, filas);		ContextoImp.Show((string) lector["reorden".Trim()]);
             *              ContextoImp.MoveTo(510, filas);		ContextoImp.Show((string) lector["fechsurti"]);
             *              filas-=10;
             *              contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      }
             *      Gnome.Print.Setfont (ContextoImp, fuente9);
             *      contadorprocedimientos += 1;
             *      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      ContextoImp.ShowPage();
             * }catch(NpgsqlException ex){
             *              Console.WriteLine("PostgresSQL error: {0}",ex.Message);
             *              MessageDialog msgBoxError = new MessageDialog (MyWinError,DialogFlags.DestroyWithParent,
             *                                              MessageType.Error,ButtonsType.Close,"PostgresSQL error: {0}",ex.Message);
             *              msgBoxError.Run ();		msgBoxError.Destroy();
             * }
             */
        }
Exemplo n.º 18
0
        void ejecutar_consulta_reporte1(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * filas=690;
             * contador=1;
             * string tomovalor1 = "";
             * int contadorprocedimientos = 0;
             * NpgsqlConnection conexion;
             * conexion = new NpgsqlConnection (connectionString+nombrebd);
             * // Verifica que la base de datos este conectada
             * try{
             *      conexion.Open ();
             *      NpgsqlCommand comando;
             *      comando = conexion.CreateCommand ();
             *      comando.CommandText = "SELECT to_char(osiris_his_solicitudes_deta.id_producto,'999999999999') AS codProducto,"+
             *                                      "osiris_productos.descripcion_producto AS descripcion, "+
             *                                      "to_char(osiris_his_solicitudes_deta.cantidad_autorizada,'999999999999') AS cantAut,"+
             *                                      "osiris_his_solicitudes_deta.id_almacen_origen, "+
             *                                      "osiris_his_solicitudes_deta.id_almacen, "+
             *                                      "to_char(osiris_his_solicitudes_deta.fechahora_traspaso,'yyyy-MM-dd HH:mm:ss') AS fechatraspaso, "+
             *                                      "osiris_his_solicitudes_deta.id_quien_traspaso, "+
             *                                      "osiris_his_solicitudes_deta.numero_de_traspaso "+
             *                                      "FROM osiris_his_solicitudes_deta,osiris_productos "+//,osiris_catalogo_almacenes,osiris_productos,osiris_grupo_producto,osiris_grupo1_producto,osiris_grupo2_producto "+
             *                                      "WHERE osiris_his_solicitudes_deta.id_producto = osiris_productos.id_producto "+
             *                                      "AND osiris_his_solicitudes_deta.traspaso = 'true' "+
             *                                      "AND osiris_his_solicitudes_deta.eliminado = 'false' "+
             *                                      //query_stock+
             *                                      //" AND osiris_catalogo_almacenes.id_almacen = '"+idsubalmacen.ToString().Trim()+"' "+
             *                                      "ORDER BY osiris_productos.descripcion_producto; ";
             *      NpgsqlDataReader lector = comando.ExecuteReader ();
             *      ContextoImp.BeginPage("Pagina 1");
             *      imprime_encabezado(ContextoImp,trabajoImpresion);
             *      Gnome.Print.Setfont (ContextoImp, fuente6);
             *      if (lector.Read()){
             *              ContextoImp.MoveTo(15, filas);		ContextoImp.Show((string) lector["codProducto".Trim()]);
             *              tomovalor1 = (string) lector["descripcion"];
             *              if(tomovalor1.Length > 65){
             *                      tomovalor1 = tomovalor1.Substring(0,65);
             *              }
             *              ContextoImp.MoveTo(65, filas);		ContextoImp.Show(tomovalor1);
             *              ContextoImp.MoveTo(300, filas);		ContextoImp.Show((string) lector["cantAut"]);
             *              //ContextoImp.MoveTo(340, filas);		ContextoImp.Show("_____");
             *              ContextoImp.MoveTo(350, filas);		ContextoImp.Show((string) lector["id_almacen_origen"].ToString().Trim());
             *              ContextoImp.MoveTo(380, filas);		ContextoImp.Show((string) lector["id_almacen"].ToString().Trim());
             *              ContextoImp.MoveTo(430, filas);		ContextoImp.Show((string) lector["fechatraspaso"]);
             *              ContextoImp.MoveTo(510, filas);		ContextoImp.Show((string) lector["id_quien_traspaso"]);
             *              ContextoImp.MoveTo(600, filas);		ContextoImp.Show((string) lector["numero_de_traspaso"].ToString().Trim());
             *              filas-=10;
             *              contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      }
             *      while (lector.Read()){
             *              ContextoImp.MoveTo(15, filas);		ContextoImp.Show((string) lector["codProducto".Trim()]);
             *              tomovalor1 = (string) lector["descripcion"];
             *              if(tomovalor1.Length > 65){
             *                      tomovalor1 = tomovalor1.Substring(0,65);
             *              }
             *              ContextoImp.MoveTo(65, filas);		ContextoImp.Show(tomovalor1);
             *              ContextoImp.MoveTo(300, filas);		ContextoImp.Show((string) lector["cantAut"]);
             *              //ContextoImp.MoveTo(340, filas);		ContextoImp.Show("_____");
             *              ContextoImp.MoveTo(350, filas);		ContextoImp.Show((string) lector["id_almacen_origen"].ToString().Trim());
             *              ContextoImp.MoveTo(380, filas);		ContextoImp.Show((string) lector["id_almacen"].ToString().Trim());
             *              ContextoImp.MoveTo(430, filas);		ContextoImp.Show((string) lector["fechatraspaso"]);
             *              ContextoImp.MoveTo(510, filas);		ContextoImp.Show((string) lector["id_quien_traspaso"]);
             *              ContextoImp.MoveTo(600, filas);		ContextoImp.Show((string) lector["numero_de_traspaso"].ToString().Trim());
             *              filas-=10;
             *              contador+=1;
             *              salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      }
             *      Gnome.Print.Setfont (ContextoImp, fuente9);
             *      contadorprocedimientos += 1;
             *      salto_pagina(ContextoImp,trabajoImpresion,contador);
             *      ContextoImp.ShowPage();
             * }catch(NpgsqlException ex){
             *              Console.WriteLine("PostgresSQL error: {0}",ex.Message);
             *              MessageDialog msgBoxError = new MessageDialog (MyWinError,DialogFlags.DestroyWithParent,
             *                                              MessageType.Error,ButtonsType.Close,"PostgresSQL error: {0}",ex.Message);
             *              msgBoxError.Run ();		msgBoxError.Destroy();
             * }
             */
        }
Exemplo n.º 19
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            if (this.checkbutton_todas_fechas.Active == false)
            {
                rango1       = entry_dia1.Text + "/" + entry_mes1.Text + "/" + entry_ano1.Text;
                rango2       = entry_dia2.Text + "/" + entry_mes2.Text + "/" + entry_ano2.Text;
                query_fechas = "AND to_char(osiris_erp_cobros_deta.fechahora_creacion,'yyyy-MM-dd') >= '" + entry_ano1.Text + "-" + entry_mes1.Text + "-" + entry_dia1.Text + "' " +
                               "AND to_char(osiris_erp_cobros_deta.fechahora_creacion,'yyyy-MM-dd') <= '" + entry_ano2.Text + "-" + entry_mes2.Text + "-" + entry_dia2.Text + "' ";
            }


            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);
            // Verifica que la base de datos este conectada
            try{
                conexion.Open();
                NpgsqlCommand comando;
                comando = conexion.CreateCommand();
                // asigna el numero de folio de ingreso de paciente (FOLIO)
                comando.CommandText = "SELECT DISTINCT(osiris_erp_movcargos.folio_de_servicio),to_char(osiris_erp_cobros_deta.folio_de_servicio,'999999999999') AS folioservicio, " +
                                      "to_char(osiris_erp_cobros_deta.pid_paciente,'999999999999') AS pidpaciente, " +
                                      "nombre1_paciente || ' ' || nombre2_paciente || ' ' || apellido_paterno_paciente || ' ' || apellido_materno_paciente AS nombre_completo, " +
                                      "to_char(to_number(to_char(age('" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "',osiris_his_paciente.fecha_nacimiento_paciente),'yyyy') ,'9999'),'9999') AS edad, " +
                                      "osiris_his_paciente.sexo_paciente," +
                                      "to_char(osiris_his_paciente.fecha_nacimiento_paciente,'dd-MM-yyyy') AS fecha_nac, " +
                                      "osiris_his_tipo_admisiones.descripcion_admisiones, " +
                                      "osiris_productos.descripcion_producto, " +
                                      "osiris_erp_cobros_enca.nombre_medico_tratante, " +
                                      "osiris_erp_cobros_enca.id_medico, " +
                                      "osiris_erp_cobros_deta.pid_paciente, " +
                                      "to_char(osiris_erp_cobros_deta.fechahora_creacion,'dd-MM-yyyy') AS fecha_crea, " +
                                      "osiris_his_tipo_pacientes.id_tipo_paciente, " +
                                      "to_char(osiris_erp_cobros_deta.folio_interno_dep,'999999999999') AS foliointernodep," +
                                      "to_char(osiris_erp_cobros_deta.fechahora_solicitud,'dd-MM-yyyy HH24:mi:ss') AS fechahorasolicitud," +
                                      "costo_por_unidad,precio_producto_publico,porcentage_ganancia " +
                                      "FROM osiris_productos,osiris_erp_movcargos,osiris_erp_cobros_enca,osiris_his_medicos,osiris_his_tipo_admisiones,osiris_his_paciente,osiris_grupo_producto,osiris_grupo1_producto,osiris_his_tipo_pacientes,osiris_grupo2_producto,osiris_erp_cobros_deta " +         //
                                      "WHERE osiris_productos.id_grupo_producto = osiris_grupo_producto.id_grupo_producto " +
                                      "AND osiris_productos.id_grupo1_producto = osiris_grupo1_producto.id_grupo1_producto " +
                                      "AND osiris_productos.id_grupo2_producto = osiris_grupo2_producto.id_grupo2_producto " +
                                      "AND osiris_erp_cobros_deta.id_producto =  osiris_productos.id_producto " +
                                      "AND osiris_erp_cobros_deta.pid_paciente = osiris_his_paciente.pid_paciente " +
                                      "AND osiris_erp_cobros_enca.pid_paciente = osiris_his_paciente.pid_paciente " +
                                      "AND osiris_erp_movcargos.id_tipo_paciente = osiris_his_tipo_pacientes.id_tipo_paciente " +
                                      "AND osiris_erp_cobros_deta.folio_de_servicio = osiris_erp_cobros_enca.folio_de_servicio " +
                                      "AND osiris_erp_movcargos.folio_de_servicio = osiris_erp_cobros_enca.folio_de_servicio " +
                                      "AND osiris_erp_cobros_enca.id_medico = osiris_his_medicos.id_medico " +
                                      "AND osiris_erp_cobros_deta.id_tipo_admisiones2 = osiris_his_tipo_admisiones.id_tipo_admisiones " +
                                      "AND osiris_erp_cobros_deta.cantidad_aplicada > 0 " +
                                      " " + query_fechas + " " +
                                      " " + query_sexo + " " +
                                      " " + query_tipo_reporte + " " +
                                      " " + query_solicitado + " " +
                                      querytipo_reporte +
                                      //"AND osiris_erp_cobros_deta.id_tipo_admisiones = '400' "+
                                      "ORDER BY " + query_orden + " ;";
                Console.WriteLine(comando.CommandText.ToString());
                NpgsqlDataReader lector = comando.ExecuteReader();

                if (lector.Read())
                {
                    imprime_encabezado(cr, layout);

                    while (lector.Read())
                    {
                    }
                }
            }catch (NpgsqlException ex) {
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Error, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();             msgBoxError.Destroy();
            }
        }
Exemplo n.º 20
0
        void imprime_encabezado(Cairo.Context cr, Pango.Layout layout)
        {
            //cr.Rotate(90);  //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra negrita
            cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows);                       layout.SetText(classpublic.nombre_empresa);                     Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows);                       layout.SetText(classpublic.direccion_empresa);          Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows);                       layout.SetText(classpublic.telefonofax_empresa);        Pango.CairoHelper.ShowLayout(cr, layout);
            fontSize  = 6.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            cr.MoveTo(650 * escala_en_linux_windows, 05 * escala_en_linux_windows);                      layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));              Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(650 * escala_en_linux_windows, 15 * escala_en_linux_windows);                      layout.SetText("N° Page :" + numpage.ToString().Trim());          Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows);                       layout.SetText("Sistema Hospitalario OSIRIS");          Pango.CairoHelper.ShowLayout(cr, layout);

            fontSize  = 11.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra negrita
            layout.Alignment = Pango.Alignment.Center;

            double width = context.Width;

            layout.Width     = (int)width;
            layout.Alignment = Pango.Alignment.Center;
            //layout.Wrap = Pango.WrapMode.Word;
            //layout.SingleParagraphMode = true;
            layout.Justify = false;
            cr.MoveTo(width / 2, 45 * escala_en_linux_windows);  layout.SetText("PACIENTES_NO_INGRESADOS_A_CAJA");       Pango.CairoHelper.ShowLayout(cr, layout);
            //cr.MoveTo(225*escala_en_linux_windows, 35*escala_en_linux_windows);			layout.SetText(titulo_rpt);				Pango.CairoHelper.ShowLayout (cr, layout);
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Normal;                      // Letra negrita
        }
Exemplo n.º 21
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            TreeIter iter;

            if (treeViewEngineResumen.GetIterFirst(out iter))
            {
                imprime_encabezado(cr, layout);
                toma_descrip_prod = (string)lista_resumen_productos.Model.GetValue(iter, 1);
                if (toma_descrip_prod.Length > 61)
                {
                    toma_descrip_prod = toma_descrip_prod.Substring(0, 60);
                }
                cr.MoveTo(09 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText(toma_descrip_prod);                      Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(120 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)lista_resumen_productos.Model.GetValue(iter, 2));                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 1) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 3)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 2) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 4)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 3) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 5)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 4) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 6)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 5) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 7)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 6) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 8)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 7) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 9)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 8) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 10)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 9) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 11)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 10) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 12)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 11) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 13)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(comienzo_mese + (espacio_mese * 12) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 14)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(685 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 15)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(710 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 18)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                comienzo_linea += separacion_linea;
                while (treeViewEngineResumen.IterNext(ref iter))
                {
                    toma_descrip_prod = (string)lista_resumen_productos.Model.GetValue(iter, 1);
                    if (toma_descrip_prod.Length > 61)
                    {
                        toma_descrip_prod = toma_descrip_prod.Substring(0, 60);
                    }
                    cr.MoveTo(09 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText(toma_descrip_prod);                      Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(120 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)lista_resumen_productos.Model.GetValue(iter, 2));                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 1) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 3)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 2) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 4)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 3) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 5)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 4) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 6)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 5) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 7)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 6) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 8)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 7) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 9)).ToString().Trim());                        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 8) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 10)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 9) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                       layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 11)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 10) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 12)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 11) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 13)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(comienzo_mese + (espacio_mese * 12) * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                      layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 14)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(685 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 15)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(710 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(float.Parse((string)lista_resumen_productos.Model.GetValue(iter, 18)).ToString().Trim());                       Pango.CairoHelper.ShowLayout(cr, layout);

                    comienzo_linea += separacion_linea;
                }
            }
        }
Exemplo n.º 22
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             * TreeIter iter;
             *      string tomovalor1 = "";
             *      fila = -75;
             *      int contadorprocedimientos = 0;
             *      contador = 0;
             *      numpage = 1;
             *      imprime_encabezado(ContextoImp,trabajoImpresion);
             *      if (this.treeViewEngineocupacion.GetIterFirst (out iter)){
             *              Gnome.Print.Setfont (ContextoImp, fuente6);
             *          ContextoImp.MoveTo(43, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,2));//pid
             *              ContextoImp.MoveTo(70, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,1));//folio
             *              ContextoImp.MoveTo(110.5, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,3));//fecha ingreso
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,0);
             *              if(tomovalor1.Length > 30){
             *                      tomovalor1 = tomovalor1.Substring(0,30);
             *              }
             *              ContextoImp.MoveTo(254.5,fila);					ContextoImp.Show(tomovalor1);//nombre
             *              ContextoImp.MoveTo(375.5, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,5));//abono
             *
             *
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,6);
             *              if(tomovalor1.Length > 30){
             *                      tomovalor1 = tomovalor1.Substring(0,30);
             *              }
             *
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,7);
             *              if(tomovalor1.Length > 20){
             *              tomovalor1 = tomovalor1.Substring(0,20);
             *              }
             *              ContextoImp.MoveTo(440,fila);					ContextoImp.Show(tomovalor1);//medico
             *
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,9);//diagnostico
             *              if(tomovalor1.Length > 30){
             *                      tomovalor1 = tomovalor1.Substring(0,30);
             *              }
             *              ContextoImp.MoveTo(530,fila);					ContextoImp.Show(tomovalor1);
             *
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,10);
             *              if(tomovalor1.Length > 20){
             *              tomovalor1 = tomovalor1.Substring(0,20);
             *              }
             *              ContextoImp.MoveTo(650,fila);					ContextoImp.Show(tomovalor1);//topo paciente
             *
             *              tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,11);
             *              if(tomovalor1.Length > 25){
             *              tomovalor1 = tomovalor1.Substring(0,25);
             *              }
             *              ContextoImp.MoveTo(715,fila);					ContextoImp.Show(tomovalor1);//topo paciente
             *
             *          tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,12);
             *              if(tomovalor1.Length > 25){
             *              tomovalor1 = tomovalor1.Substring(0,25);
             *              }
             *          ContextoImp.MoveTo(170, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,12));//fecha reservacion
             *          //ContextoImp.MoveTo(725, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,10));//empresa
             *              fila -= 08;
             *              //contador+=1;
             *              contadorprocedimientos += 0;
             *              salto_pagina(ContextoImp,trabajoImpresion);
             *
             *              while (this.treeViewEngineocupacion.IterNext(ref iter)){
             *                      Gnome.Print.Setfont (ContextoImp, fuente6);
             *                      ContextoImp.MoveTo(43, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,2));//pid
             *                      ContextoImp.MoveTo(70, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,1));//folio
             *                      ContextoImp.MoveTo(110.5, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,3));//fecha ingreso
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,0);
             *                      if(tomovalor1.Length > 30){
             *                              tomovalor1 = tomovalor1.Substring(0,30);
             *                      }
             *                      ContextoImp.MoveTo(254.5,fila);					ContextoImp.Show(tomovalor1);//nombre
             *
             *                      ContextoImp.MoveTo(375.5, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,5));//abono
             *
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,6);
             *                      if(tomovalor1.Length > 30){
             *                              tomovalor1 = tomovalor1.Substring(0,30);
             *                      }
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,7);
             *                      if(tomovalor1.Length > 20){
             *                      tomovalor1 = tomovalor1.Substring(0,20);
             *                      }
             *                      ContextoImp.MoveTo(440,fila);					ContextoImp.Show(tomovalor1);//medico
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,9);//diagnostico
             *                      if(tomovalor1.Length > 30){
             *                              tomovalor1 = tomovalor1.Substring(0,30);
             *                      }
             *                      ContextoImp.MoveTo(530,fila);					ContextoImp.Show(tomovalor1);
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,10);
             *                      if(tomovalor1.Length > 20){
             *                      tomovalor1 = tomovalor1.Substring(0,20);
             *                      }
             *                      ContextoImp.MoveTo(650,fila);					ContextoImp.Show(tomovalor1);//topo paciente
             *
             *                      tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,11);
             *                      if(tomovalor1.Length > 25){
             *                      tomovalor1 = tomovalor1.Substring(0,25);
             *                      }
             *                      ContextoImp.MoveTo(715,fila);					ContextoImp.Show(tomovalor1);//topo paciente
             *
             *                  tomovalor1 = (string) this.treeViewEngineocupacion.GetValue (iter,12);
             *                  if(tomovalor1.Length > 25){
             *                  tomovalor1 = tomovalor1.Substring(0,25);
             *                  }
             *              ContextoImp.MoveTo(170, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,12));//fecha reservacion
             *
             *                      //ContextoImp.MoveTo(725, fila);	ContextoImp.Show((string) this.treeViewEngineocupacion.GetValue (iter,10));//empresa
             *
             *                      fila -= 08;
             *                      contador+=1;
             *                      contadorprocedimientos += 1;
             *                      salto_pagina(ContextoImp,trabajoImpresion);
             *              }
             *              fila-=10;
             *              contador+=1;
             *              contadorprocedimientos += 1;
             *              salto_pagina(ContextoImp,trabajoImpresion);
             *      }
             *  Gnome.Print.Setfont (ContextoImp, fuente9);
             *      ContextoImp.MoveTo(99.5,fila);				ContextoImp.Show("TOTAL PROC. "+contadorprocedimientos.ToString());
             *      ContextoImp.MoveTo(100,fila);				ContextoImp.Show("TOTAL PROC. "+contadorprocedimientos.ToString());
             *      ContextoImp.MoveTo(384.5,fila);				ContextoImp.Show("TOT. ABONOS" );
             *      ContextoImp.MoveTo(385,fila);				ContextoImp.Show("TOT. ABONOS" );
             *      ContextoImp.MoveTo(459.5,fila);				ContextoImp.Show(totabono.ToString("C"));
             *      ContextoImp.MoveTo(460,fila);				ContextoImp.Show(totabono.ToString("C"));
             *      //contadorprocedimientos += 1;
             *      salto_pagina(ContextoImp,trabajoImpresion);
             */
        }
Exemplo n.º 23
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context         cr     = context.CairoContext;
            Pango.Layout          layout = context.CreatePangoLayout();
            Pango.FontDescription desc   = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            imprime_encabezado(cr, layout);
            comienzo_linea += separacion_linea;
            //cr.Rotate(90);  //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 9.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra negrita
            cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText(this.nombre_estudio);            Pango.CairoHelper.ShowLayout(cr, layout);
            layout.FontDescription.Weight = Weight.Normal;                      // Letra negrita

            cr.MoveTo(570 * escala_en_linux_windows, (comienzo_linea + separacion_linea) * escala_en_linux_windows);
            cr.LineTo(05, comienzo_linea + separacion_linea);                   // Linea Horizontal 4
            cr.Stroke();

            fontSize        = 8.0;
            desc.Size       = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            comienzo_linea += separacion_linea;
            comienzo_linea += separacion_linea;
            cr.MoveTo(100 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText("PARAMETROS");           Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(250 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText("RESULTADOS");           Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText("V.R.");         Pango.CairoHelper.ShowLayout(cr, layout);
            comienzo_linea += separacion_linea;
            comienzo_linea += separacion_linea;

            int lineahorizontal = comienzo_linea;

            TreeIter iter;

            if (this.treeViewEngineresultados.GetIterFirst(out iter))
            {
                if ((bool)this.lista_de_resultados.Model.GetValue(iter, 5) == true)
                {
                    if ((string)this.lista_de_resultados.Model.GetValue(iter, 0) != "")
                    {
                        cr.MoveTo(570 * escala_en_linux_windows, (comienzo_linea) * escala_en_linux_windows);
                        cr.LineTo(05, comienzo_linea);                                  // Linea Horizontal 4
                        cr.LineWidth = 0.1;
                        cr.Stroke();
                    }
                    cr.MoveTo(25 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 0));              Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(230 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 1));              Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 2));              Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(570 * escala_en_linux_windows, (comienzo_linea + separacion_linea) * escala_en_linux_windows);
                    cr.LineTo(05, comienzo_linea + separacion_linea);                           // Linea Horizontal 4
                    cr.Stroke();
                    comienzo_linea += separacion_linea;
                }
                while (treeViewEngineresultados.IterNext(ref iter))
                {
                    if ((bool)this.lista_de_resultados.Model.GetValue(iter, 5) == true)
                    {
                        if ((string)this.lista_de_resultados.Model.GetValue(iter, 0) != "")
                        {
                            cr.MoveTo(570 * escala_en_linux_windows, (comienzo_linea) * escala_en_linux_windows);
                            cr.LineTo(05, comienzo_linea);                                      // Linea Horizontal 4
                            cr.LineWidth = 0.1;
                            cr.Stroke();
                        }
                        cr.MoveTo(25 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 0));              Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(230 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 1));              Pango.CairoHelper.ShowLayout(cr, layout);
                        cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_de_resultados.Model.GetValue(iter, 2));              Pango.CairoHelper.ShowLayout(cr, layout);
                        comienzo_linea += separacion_linea;
                    }
                }
            }
            cr.MoveTo(570 * escala_en_linux_windows, (comienzo_linea) * escala_en_linux_windows);
            cr.LineTo(05, comienzo_linea);
            cr.LineWidth = 0.1;

            cr.MoveTo(05 * escala_en_linux_windows, lineahorizontal * escala_en_linux_windows);
            cr.LineTo(05, comienzo_linea);

            cr.MoveTo(570 * escala_en_linux_windows, lineahorizontal * escala_en_linux_windows);
            cr.LineTo(570, comienzo_linea);

            cr.Stroke();
            comienzo_linea += separacion_linea;
            comienzo_linea += separacion_linea;
            cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText("Observaciones: " + observa);              Pango.CairoHelper.ShowLayout(cr, layout);

            cr.MoveTo(300 * escala_en_linux_windows, 660 * escala_en_linux_windows);             layout.SetText("Quimico: ");            Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(300 * escala_en_linux_windows, 670 * escala_en_linux_windows);             layout.SetText(quimicoautorizado);      Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(300 * escala_en_linux_windows, 680 * escala_en_linux_windows);             layout.SetText("Ced.Prof. " + cedulaquimico);             Pango.CairoHelper.ShowLayout(cr, layout);

            Gtk.Image image5 = new Gtk.Image();
            image5.Name = "image5";
            //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg"));
            image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/firma_quimica.jpg");               // en Linux
            //image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear);
            //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,05,comienzo_linea*escala_en_linux_windows);
            //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1);
            //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(130, 91, Gdk.InterpType.Bilinear),300*escala_en_linux_windows,570*escala_en_linux_windows);
            Gdk.CairoHelper.SetSourcePixbuf(cr, image5.Pixbuf, 300 * escala_en_linux_windows, 570 * escala_en_linux_windows);
            cr.Fill();
            cr.Paint();
            cr.Restore();
        }
Exemplo n.º 24
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            //string nombre = "";
            int contador = 1;
            //TreeModel model;
            TreeIter iter;

            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();
            imprime_encabezado(cr, layout);
            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            if (this.treeViewEngineRequisicion.GetIterFirst(out iter))
            {
                // N. partida
                cr.MoveTo(07 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText(contador.ToString().Trim());                                     Pango.CairoHelper.ShowLayout(cr, layout);
                // cantidad solicitada
                cr.MoveTo(27 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 0).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                // unidad de medida
                cr.MoveTo(60 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 4).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                // Embalaje
                cr.MoveTo(102 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 3).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                // Descripcion del Producto
                cr.MoveTo(140 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 1).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                desc      = Pango.FontDescription.FromString("Courier New");
                fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
                desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
                // Precio del Producto
                cr.MoveTo(477 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(String.Format("${0,10:F}", float.Parse((string)this.lista_requisicion_productos.Model.GetValue(iter, 22).ToString().Trim())));                                   Pango.CairoHelper.ShowLayout(cr, layout);
                desc      = Pango.FontDescription.FromString("Sans");
                fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
                desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

                contador       += 1;
                comienzo_linea += separacion_linea;
                while (this.treeViewEngineRequisicion.IterNext(ref iter))
                {
                    // N. partida
                    cr.MoveTo(07 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText(contador.ToString().Trim());                                     Pango.CairoHelper.ShowLayout(cr, layout);
                    // Cantidad Solicitada
                    cr.MoveTo(27 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 0).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                    // unidad de medida
                    cr.MoveTo(60 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                   layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 4).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                    // Embalaje
                    cr.MoveTo(102 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                 layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 3).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);
                    // Descripcion del Producto
                    cr.MoveTo(140 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText((string)this.lista_requisicion_productos.Model.GetValue(iter, 1).ToString().Trim());                                    Pango.CairoHelper.ShowLayout(cr, layout);

                    desc = Pango.FontDescription.FromString("Courier New");
                    // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
                    fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
                    desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
                    // Precio del Producto
                    cr.MoveTo(477 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);                  layout.SetText(String.Format("${0,10:F}", float.Parse((string)this.lista_requisicion_productos.Model.GetValue(iter, 22).ToString().Trim())));                                   Pango.CairoHelper.ShowLayout(cr, layout);

                    desc = Pango.FontDescription.FromString("Sans");
                    // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
                    fontSize        = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
                    desc.Size       = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
                    contador       += 1;
                    comienzo_linea += separacion_linea;
                    salto_de_pagina(cr, layout);
                }
            }
        }
Exemplo n.º 25
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr                = context.CairoContext;
            Pango.Layout  layout            = context.CreatePangoLayout();
            string        toma_descrip_prod = "";

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;

            /*
             *  Gnome.Print.Setfont (ContextoImp, fuente4);
             *
             *      ContextoImp.MoveTo(150, 750);
             *  ContextoImp.Show("CONTRATO INDIVIDUAL DE TRABAJO");
             *
             * // if para tipo de contrato
             *  if (tipocontrato == "PRACTICAS")
             *  {ContextoImp.MoveTo(230, 735);
             *  ContextoImp.Show("PRACTICAS");
             *  tiempoc = "tiempo determinado";}
             *  else {
             *
             *                  if(tipocontrato == "HONORARIOS (ASIMILABLES)")
             *                  {ContextoImp.MoveTo(170, 735);
             *                  ContextoImp.Show( tipocontrato);
             *                  tiempocontrato = "determinado";
             *                  tiempoc = "determinado";}
             *                  else {
             *                           if(tipocontrato=="INDETERMINADO")
             *                           {ContextoImp.MoveTo(160, 735);
             *                           ContextoImp.Show("POR TIEMPO " + tipocontrato);
             *                           tiempoc = "tiempo " + tipocontrato;
             *                           Gnome.Print.Setfont (ContextoImp, fuente2);
             *
             *                               ContextoImp.MoveTo(20, 660);
             *                           ContextoImp.Show("que hemos convenido en celebrar un Contrato Individual de Trabajo y como personal "+ funcion+ " al tenor de las");
             *                           ContextoImp.MoveTo(20, 650);
             *                           ContextoImp.Show("siguientes:");
             *
             *                           ContextoImp.MoveTo(20, 540);
             *           ContextoImp.Show("SEGUNDA: La vigencia del presente contrato es por tiempo Indeterminado a partir del "+fechacontrato);
             *
             *           }
             *
             *                              else{
             *                              ContextoImp.MoveTo(140, 735);
             *                              ContextoImp.Show("POR TIEMPO " + tipocontrato);
             *                              tiempocontrato = "Indeterminado";
             *                              tiempoc = "tiempo " +tipocontrato;
             *                              Gnome.Print.Setfont (ContextoImp, fuente2);
             *
             *                              ContextoImp.MoveTo(20, 660);
             *                                      ContextoImp.Show("que hemos convenido en celebrar un Contrato Individual de Trabajo por " + tiempoc+" y como personal ");
             *                              ContextoImp.MoveTo(20, 650);
             *                              ContextoImp.Show(funcion+ " al tenor de las siguientes:");
             *
             *                              ContextoImp.MoveTo(20, 540);
             *              ContextoImp.Show("SEGUNDA: La vigencia del presente contrato es de 1 a 3 meses por tiempo determinado a partir del "+fechacontrato);
             *
             *
             *                              }
             *                            }
             *
             *   }
             *
             *  //contrato
             *
             *
             *  Gnome.Print.Setfont (ContextoImp, fuente2);
             *
             *
             *
             *      ContextoImp.MoveTo(20, 700);
             *      ContextoImp.Show("En la ciudad de Monterrey, Nuevo León  a " + DateTime.Today.ToLongDateString()+ ", los que suscribimos el presente, por una parte HOSPITAL ");
             *      ContextoImp.MoveTo(20, 690);
             *      ContextoImp.Show("SANTA CECILIA DE MONTERREY, S.A. DE C.V. con registro Federal de Contribuyentes de HSC021105D5A  con una actividad");
             *      ContextoImp.MoveTo(20, 680);
             * ContextoImp.Show("de Servicios Hospitalarios y con domicilio fiscal en Galeana 641-A Nte. Colonia Centro que en lo sucesivo se le denominará");
             * ContextoImp.MoveTo(20, 670);
             * ContextoImp.Show("''EL PATRON'' y por la otra, a "+ appaterno+ " " + apmaterno+ " " +nom1 + " " +nom2 + " su propio derecho como TRABAJADOR, hacemos constar");
             *
             * //linea en el if
             * //linea en el if
             * ContextoImp.MoveTo(20, 620);
             * ContextoImp.Show("CLAUSULAS:");
             * ContextoImp.MoveTo(20, 600);
             * ContextoImp.Show("PRIMERA: Para los efectos del articulo 25 de la Ley Federal del Trabajo, el HOSPITAL SANTA CECILIA DE MONTERREY, S.A. ");
             * ContextoImp.MoveTo(20, 590);
             * ContextoImp.Show("DE C.V. El trabajador declara llamarse, "+ appaterno+ " " +apmaterno+ " "+nom1+ " "+nom2+" de "+edad+" años de edad, nacionalidad ");
             * ContextoImp.MoveTo(20, 580);
             * ContextoImp.Show(nacionalidad + ", y con domicilio en calle " + calle+" #"+numero+", Colonia: "+colonia + " el prestador se obliga a realizar");
             * ContextoImp.MoveTo(20, 570);
             * ContextoImp.Show("los trabajos de tipo de funcion "+funcion + ", que se le asignen en el area de "+depto+" ocupando " );
             * ContextoImp.MoveTo(20, 560);
             * ContextoImp.Show("el puesto de "+puesto+ " para los cuales fue contratado.");
             *
             *
             *
             * //segunda clausula esta en el if
             *
             * ContextoImp.MoveTo(20, 520);
             * ContextoImp.Show("TERCERO: El prestador se obliga a brindar los servicios personales que se especifican en la cláusla anterior, subordinado ");
             * ContextoImp.MoveTo(20, 510);
             * ContextoImp.Show("jurídicamente al patrón, con esmero y eficiencia, en las oficinas (o talleres) del patrón y en cualquier lugar de esta ciudad");
             * ContextoImp.MoveTo(20, 500);
             * ContextoImp.Show("donde el patrón desempeñe actividades queda expresamenteconvenido que el trabajador acatará en el desempeño de su ");
             * ContextoImp.MoveTo(20, 490);
             * ContextoImp.Show("trabajo todas las disposiciones del Reglamento Interior de Trabajo,  todas las ordenes, circulares y disposiciones que dicte");
             * ContextoImp.MoveTo(20, 480);
             * ContextoImp.Show("el patrón y todos los ordenamientos legales que le sean aplicables");
             *
             *
             * ContextoImp.MoveTo(20, 460);
             * ContextoImp.Show("CUARTA: La duración de la jornada será inicialmente de "+jornada+" horas diarias, teniendo "+tiempocomida + " para ingerir sus alimentos.");
             * ContextoImp.MoveTo(20, 450);
             * ContextoImp.Show("El horario se podrá modificar de acuerdo a las necesidades de la institución y/o el servicio.");
             *
             * ContextoImp.MoveTo(20, 430);
             * ContextoImp.Show("QUINTA: El tiempo extra se autorizará solo previa solicitud por escrito siempre y cuando se justifique la tarea a realizar.");
             * ContextoImp.MoveTo(20, 420);
             * ContextoImp.Show("Está deberá ser solicitada por el jefe inmediato y autorizada por el Cordinador del área.");
             *
             * ContextoImp.MoveTo(20, 400);
             * ContextoImp.Show("SEXTA: El trabajador esta obligado a registrar la entrada y salida de sus labores, por lo que el incumplimiento de este registro ");
             * ContextoImp.MoveTo(20, 390);
             * ContextoImp.Show("indicara la falta de injusticia a sus labores, para todos los efectos legales.");
             *
             * ContextoImp.MoveTo(20, 370);
             * ContextoImp.Show("SEPTIMA: El trabajador percibirá por la prestación de los servicios a que se refiere este contrato, un salario nominal de ");
             * ContextoImp.MoveTo(20, 360);
             * ContextoImp.Show("$"+sueldo+" pesos mensuales los cuales cobrara "+tipopagosubstring+ " y al cual se aplicará la parte proporcional correspondiente al ");
             * ContextoImp.MoveTo(20, 350);
             * ContextoImp.Show("descanso semanal, conforme a lo dispuesto en el artículo 72 de la Ley Federal del Trabajo.");
             * ContextoImp.MoveTo(20, 340);
             * ContextoImp.Show("El sueldo se le cubrirá los días "+fechacobro+", en moneda de curso legal y en las oficinas del patrónestando obligados ");
             * ContextoImp.MoveTo(20, 330);
             * ContextoImp.Show("el trabajador a firmar las constancias de pago respectivas, teniendo en cuenta lo dispuesto en los articulos 108 y 109 ");
             * ContextoImp.MoveTo(20, 320);
             * ContextoImp.Show("de la Ley de la Materia.");
             *
             * ContextoImp.MoveTo(20, 300);
             * ContextoImp.Show("OCTAVA: Por cada seis días de trabajo el trabajador tendrá un descanso semanal de un día con pago de salario íntegro, ");
             * ContextoImp.MoveTo(20, 290);
             * ContextoImp.Show("deacuerdo al que se le asigne en el área. También disfrutara de los días de descandso obligatorios señalados en Ley Federal ");
             * ContextoImp.MoveTo(20, 280);
             * ContextoImp.Show("del Trabajo que caigan dentro de la temporalidad de este contrato.");
             *
             *
             *
             * ContextoImp.MoveTo(20, 260);
             * ContextoImp.Show("NOVENA: El trabajador percibirá por concepto de vacaciones una remuneración ''proporcionada al tiempo de servicios prestados");
             * ContextoImp.MoveTo(20, 250);
             * ContextoImp.Show("con una prima del 25%'' sobre el salario correspondiente a las mismas, teniendo en cuenta el término de la relaciacón de trabajo");
             * ContextoImp.MoveTo(20, 240);
             * ContextoImp.Show("con arreglo a lo dispuesto en los articulos 76/79 y 80 de la Ley Federal del Trabajo. Tambien percibira con base en un aguinaldo");
             * ContextoImp.MoveTo(20, 230);
             * ContextoImp.Show("anual fijado el equivalente a 15 días de salario, la parte proporcional el tiempo trabajado, conforme al parrafo segundo  del ");
             * ContextoImp.MoveTo(20, 220);
             * ContextoImp.Show("articulo 87 de la Ley Federal del Trabajo en vigor.");
             *
             * ContextoImp.MoveTo(20, 200);
             * ContextoImp.Show("DECIMA: En caso de faltas injustificadas al trabajo, se podrán deducir dichas faltas del periodo de prestación de servicios ");
             * ContextoImp.MoveTo(20, 190);
             * ContextoImp.Show("computables para fijar las vacaciones, reduciendose estas proporcionalmente.");
             *
             * ContextoImp.MoveTo(20, 170);
             * ContextoImp.Show("DECIMA PRIMERA: El trabajador conviene en someterse a los reconocimientos médicos que periódicamente ordene el patrón");
             * ContextoImp.MoveTo(20, 160);
             * ContextoImp.Show("en los términos de la Fracción X de articulo 134 de la Ley Federal del Trabajo, en la inteligencia de que el médico que practique");
             * ContextoImp.MoveTo(20, 150);
             * ContextoImp.Show("será retribuido por el patrón.");
             *
             * ContextoImp.MoveTo(20,130);
             * ContextoImp.Show("DECIMA SEGUNDA: El trabajador será capacitado o adiestrado en los términos de los planes y programas establecidos que se ");
             * ContextoImp.MoveTo(20,120);
             * ContextoImp.Show("establezcan por el patrón.");
             *
             * ContextoImp.MoveTo(20,100);
             * ContextoImp.Show("DECIMA TERCERA: Son causa de rescicion de contrato el incumplimiento a cualquiera de sus dispociciones establecidas que se ");
             * ContextoImp.MoveTo(20,90);
             * ContextoImp.Show("establezcan por el patrón.");
             *
             *
             * ContextoImp.ShowPage();
             * ContextoImp.BeginPage("Pagina 2");
             * Gnome.Print.Setfont (ContextoImp, fuente2);
             *
             *
             * ContextoImp.MoveTo(20,750 );
             * ContextoImp.Show("DECIMO CUARTA: Ambas partes convienen en que al vencimiento del término estipulado en este contrato quedará terminado ");
             * ContextoImp.MoveTo(20,740 );
             * ContextoImp.Show("automáticamente, sin necesidad de aviso ni de ningún otro requisito, y cesarán todos sus efectos, de acuerdo con la fracción III");
             * ContextoImp.MoveTo(20,730 );
             * ContextoImp.Show("del artículo 53 de la Ley Federal del Trabajo.");
             *
             * ContextoImp.MoveTo(20,710 );
             * ContextoImp.Show("DECIMO QUINTA: Este contrato se podra terminar sin responsabilidad para las partes con quince dias naturales de anticipación");
             * ContextoImp.MoveTo(20,700);
             * ContextoImp.Show("mediante aviso por escrito.");
             *
             * ContextoImp.MoveTo(20,680);
             * ContextoImp.Show("DECIMO SEXTA: Ambas partes declararan que respecto a las obligaciones y derechos que mutuamente les corresponden y que no hayan ");
             * ContextoImp.MoveTo(20,670);
             * ContextoImp.Show("sido motivo de la cláusula expresa en el presente contrato se sujetan a las dispociciones de la Ley de la Materia.");
             *
             * ContextoImp.MoveTo(20,650);
             * ContextoImp.Show("Leído que fue por ambas partes éste contrato, impuestas de su contenido, lo firmaran al calce para su Constancia Legal el dia ");
             * ContextoImp.MoveTo(20,640);
             * ContextoImp.Show(DateTime.Today.Day.ToString() + " del mes "+ DateTime.Today.ToLongDateString().Substring(3,DateTime.Today.ToLongDateString().Length -11) + " del año "+ DateTime.Today.Year.ToString());
             *
             * ContextoImp.MoveTo(150,90);
             *
             *
             *
             * Gnome.Print.Setfont (ContextoImp, fuente4);
             * ContextoImp.MoveTo(160, 460);
             * ContextoImp.Show("Monterrey, N.L. a " + DateTime.Today.ToLongDateString());
             *
             * ContextoImp.MoveTo(80,300);
             * ContextoImp.Show("EL PATRON");
             * ContextoImp.MoveTo(400,300);
             * ContextoImp.Show("EL PRESTADOR");
             *
             *
             * Gnome.Print.Setfont (ContextoImp, fuente3);
             * ContextoImp.MoveTo(20,275);
             * ContextoImp.Show("HOSPITAL SANTA CECILIA DE MONTERREY,S.A. DE C.V.");
             * ContextoImp.MoveTo(20,260);
             * ContextoImp.Show("REPRESENTANTE LEGAL");
             * ContextoImp.MoveTo(90,185);
             * ContextoImp.Show("TESTIGOS");
             * ContextoImp.MoveTo(20,140);
             * ContextoImp.Show("________________________________________");
             * ContextoImp.MoveTo(30,125);
             * ContextoImp.Show("LIC. BLANCA ALICIA FLORES BERNAL");
             *
             *  ContextoImp.MoveTo(340,290);
             * ContextoImp.Show("________________________________________");
             * ContextoImp.MoveTo(340,275);
             * ContextoImp.Show(nom1+ " "+nom2+ " " +appaterno+ " " +apmaterno);
             *
             *
             * ContextoImp.MoveTo(420,185);
             * ContextoImp.Show("TESTIGOS");
             * ContextoImp.MoveTo(340,140);
             * ContextoImp.Show("__________________________________________");
             * ContextoImp.MoveTo(340,125);
             * ContextoImp.Show("C.P. JUAN ANTONIO GONZALEZ GOMEZ");
             *
             * Gnome.Print.Setfont (ContextoImp, fuente5);
             * ContextoImp.MoveTo(40,110);
             * ContextoImp.Show("JEFA DE RECURSOS HUMANOS");
             * ContextoImp.MoveTo(370,110);
             * ContextoImp.Show("GENERADOR DE NOMINAS");
             *
             * ContextoImp.ShowPage();
             */
        }
Exemplo n.º 26
0
        void imprime_encabezado(Cairo.Context cr, Pango.Layout layout)
        {
            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            fontSize  = 8.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra normal
            //cr.Rotate(90);  //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows);                       layout.SetText(classpublic.nombre_empresa);                     Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows);                       layout.SetText(classpublic.direccion_empresa);          Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows);                       layout.SetText(classpublic.telefonofax_empresa);        Pango.CairoHelper.ShowLayout(cr, layout);
            fontSize  = 6.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            cr.MoveTo(479 * escala_en_linux_windows, 05 * escala_en_linux_windows);                      layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));              Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(479 * escala_en_linux_windows, 15 * escala_en_linux_windows);                      layout.SetText("N° Page :" + numpage.ToString().Trim());          Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows);                       layout.SetText("Sistema Hospitalario OSIRIS");          Pango.CairoHelper.ShowLayout(cr, layout);
            // Cambiando el tamaño de la fuente
            fontSize  = 10.0;
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra negrita
            layout.Alignment = Pango.Alignment.Center;
            double width = context.Width;

            layout.Width     = (int)width;
            layout.Alignment = Pango.Alignment.Center;
            //layout.Wrap = Pango.WrapMode.Word;
            //layout.SingleParagraphMode = true;
            layout.Justify = false;
            cr.MoveTo(width / 2, 45 * escala_en_linux_windows);  layout.SetText("DEVOLUCIONES"); Pango.CairoHelper.ShowLayout(cr, layout);
            fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Bold;                        // Letra normal
            cr.MoveTo(05 * escala_en_linux_windows, 65 * escala_en_linux_windows);               layout.SetText("N° Atencion: " + numeroatencion);                                 Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(120 * escala_en_linux_windows, 65 * escala_en_linux_windows);              layout.SetText("N° Expe.: " + pidpaciente);                                               Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(220 * escala_en_linux_windows, 65 * escala_en_linux_windows);              layout.SetText("Nombre Paciente: " + nombrepaciente);                             Pango.CairoHelper.ShowLayout(cr, layout);
            layout.FontDescription.Weight = Weight.Normal;                      // Letra normal
            cr.MoveTo(05 * escala_en_linux_windows, 75 * escala_en_linux_windows);               layout.SetText("Procedimiento: ");                              Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(300 * escala_en_linux_windows, 75 * escala_en_linux_windows);              layout.SetText("Diagnostico: ");                                Pango.CairoHelper.ShowLayout(cr, layout);
            cr.Rectangle(05 * escala_en_linux_windows, 85 * escala_en_linux_windows, 565 * escala_en_linux_windows, 15 * escala_en_linux_windows);
            cr.FillExtents();              //. FillPreserve();
            cr.SetSourceRGB(0, 0, 0);
            cr.LineWidth = 0.5;
            cr.Stroke();
            layout.FontDescription.Weight = Weight.Bold;                        // Letra normal
            cr.MoveTo(18 * escala_en_linux_windows, 88 * escala_en_linux_windows);                      layout.SetText("Codigo");                               Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(150 * escala_en_linux_windows, 88 * escala_en_linux_windows);                     layout.SetText("Descripción Producto"); Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(350 * escala_en_linux_windows, 88 * escala_en_linux_windows);                     layout.SetText("Cargado");      Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(390 * escala_en_linux_windows, 88 * escala_en_linux_windows);                     layout.SetText("Solicitado");           Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(435 * escala_en_linux_windows, 88 * escala_en_linux_windows);                     layout.SetText("Devolucion");           Pango.CairoHelper.ShowLayout(cr, layout);
            cr.MoveTo(500 * escala_en_linux_windows, 88 * escala_en_linux_windows);                     layout.SetText("Departamento");         Pango.CairoHelper.ShowLayout(cr, layout);
            layout.FontDescription.Weight = Weight.Normal;                      // Letra normal
        }
Exemplo n.º 27
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            string  tomovalor1             = "";
            int     contadorprocedimientos = 0;
            decimal total = 0;

            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();
            desc      = Pango.FontDescription.FromString("Sans");
            fontSize  = 7.0;                                                                                 layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);                                       layout.FontDescription = desc;

            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);
            // Verifica que la base de datos este conectada
            try{
                conexion.Open();
                NpgsqlCommand comando;
                comando             = conexion.CreateCommand();
                comando.CommandText = "SELECT to_char(osiris_erp_abonos.folio_de_servicio,'9999999999') AS folio, " +
                                      "to_char(osiris_erp_abonos.id_abono,'9999999999') AS idabono, " +
                                      "to_char(numero_recibo_caja,'9999999999') AS recibocaja, " +
                                      "id_quien_creo, " +
                                      "to_char(osiris_erp_abonos.monto_de_abono_procedimiento,'9,999,999,999.99') AS abono, " +
                                      "osiris_erp_abonos.concepto_del_abono AS concepto, " +
                                      "osiris_erp_abonos.eliminado, " +
                                      "osiris_erp_abonos.id_quien_elimino, " +
                                      "osiris_erp_abonos.fechahora_eliminado, " +
                                      "to_char(osiris_erp_abonos.fecha_abono,'yyyy-MM-dd') AS fechaabono, " +
                                      "osiris_erp_abonos.id_forma_de_pago, " +
                                      "osiris_erp_forma_de_pago.id_forma_de_pago,descripcion_forma_de_pago AS descripago, " +
                                      "osiris_his_paciente.pid_paciente || '   ' || nombre1_paciente || ' ' || nombre2_paciente || ' ' || apellido_paterno_paciente || ' ' || apellido_materno_paciente AS nombre_completo " +
                                      "FROM osiris_erp_abonos,osiris_erp_forma_de_pago,osiris_erp_cobros_enca,osiris_his_paciente " +
                                      "WHERE osiris_erp_abonos.eliminado = false " +
                                      "AND osiris_erp_abonos.id_forma_de_pago = osiris_erp_forma_de_pago.id_forma_de_pago " +
                                      "AND osiris_erp_abonos.folio_de_servicio = osiris_erp_cobros_enca.folio_de_servicio " +
                                      "AND osiris_erp_cobros_enca.pid_paciente = osiris_his_paciente.pid_paciente " +
                                      " " + query_fechas + " " +
                                      "ORDER BY osiris_erp_abonos.folio_de_servicio;";
                //Console.WriteLine(comando.CommandText);
                NpgsqlDataReader lector = comando.ExecuteReader();
                imprime_encabezado(cr, layout);
                while (lector.Read())
                {
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lector["folio"].ToString().Trim());     Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(40 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(string.Format("{0:C}", decimal.Parse(lector["abono"].ToString())));       Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(93 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(lector["fechaabono"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(125 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText(lector["recibocaja"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(171 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText(lector["nombre_completo"].ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);

                    comienzo_linea         += separacion_linea;
                    total                  += decimal.Parse((string)lector["abono"]);
                    contadorprocedimientos += 1;

                    /*
                     * tomovalor1 = (string) lector["concepto"];
                     * if(tomovalor1.Length > 40)
                     * {
                     *      tomovalor1 = tomovalor1.Substring(0,40);
                     * }
                     * ContextoImp.MoveTo(351, filas);		ContextoImp.Show(tomovalor1);
                     * ContextoImp.MoveTo(501, filas);		ContextoImp.Show((string) lector["descripago"]);
                     */
                }
                comienzo_linea += separacion_linea;
                cr.MoveTo(300 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText("TOTAL DE PAGOS/ABONOS " + string.Format("{0:C}", decimal.Parse(total.ToString())));        Pango.CairoHelper.ShowLayout(cr, layout);
                comienzo_linea += separacion_linea;
                cr.MoveTo(300 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText("TOTAL N° ATENCION " + contadorprocedimientos.ToString()); Pango.CairoHelper.ShowLayout(cr, layout);
            }catch (NpgsqlException ex) {
                Console.WriteLine("PostgresSQL error: {0}", ex.Message);
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Error, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();             msgBoxError.Destroy();
            }
        }
Exemplo n.º 28
0
        protected override void OnBeginPrint(PrintContext context)
        {
            cancelled = false;
            Cleanup();

            if (context == null)
            {
                throw new NullReferenceException("context is null");
            }

            if (context.PageSetup == null)
            {
                throw new NullReferenceException("context.PageSetup is null");
            }

            if (formToPrint == null)
            {
                throw new NullReferenceException("formToPrint is null");
            }

            if (formToPrint.PageMargins == null)
            {
                throw new NullReferenceException("formToPrint.PageMargins is null");
            }

            using (var dp = new DrawingProviderCairo(context.CairoContext, context.CreatePangoLayout())) {
                drawingScaleX               = (float)(context.Width / (context.PageSetup.GetPageWidth(Unit.Pixel) * SD_SCALE));
                drawingScaleY               = (float)(context.Height / (context.PageSetup.GetPageHeight(Unit.Pixel) * SD_SCALE));
                drawingScaleIsValid         = true;
                dp.DrawingScaleX            = drawingScaleX;
                dp.DrawingScaleY            = drawingScaleY;
                formToPrint.DrawingProvider = dp;

                if (formToPrint.PageMargins.Top == int.MaxValue)
                {
                    formToPrint.PageMargins.Top    = UseFullPage ? 0 : (int)Math.Round(context.PageSetup.GetTopMargin(Unit.Pixel) * SD_SCALE);
                    formToPrint.PageMargins.Bottom = UseFullPage ? 0 : (int)Math.Round(context.PageSetup.GetBottomMargin(Unit.Pixel) * SD_SCALE);
                    formToPrint.PageMargins.Left   = UseFullPage ? 0 : (int)Math.Round(context.PageSetup.GetLeftMargin(Unit.Pixel) * SD_SCALE);
                    formToPrint.PageMargins.Right  = UseFullPage ? 0 : (int)Math.Round(context.PageSetup.GetRightMargin(Unit.Pixel) * SD_SCALE);
                }

                if (formToPrint.PageWidth <= 0)
                {
                    formToPrint.PageWidth = pageWidth != null ?
                                            pageWidth.Value :
                                            (int)Math.Round(context.PageSetup.GetPageWidth(Unit.Pixel) * SD_SCALE);
                }

                if (formToPrint.PageHeight <= 0)
                {
                    formToPrint.PageHeight = (int)Math.Round(context.PageSetup.GetPageHeight(Unit.Pixel) * SD_SCALE);
                }

                formArea.X      = (int)(formToPrint.PageMargins.Left * drawingScaleX);
                formArea.Y      = (int)(formToPrint.PageMargins.Top * drawingScaleY);
                formArea.Width  = (int)(formToPrint.PageWidth * drawingScaleX);
                formArea.Height = (int)(formToPrint.PageHeight * drawingScaleY);
                paperWidth      = formArea.Width + (int)((formToPrint.PageMargins.Left + formToPrint.PageMargins.Right) * drawingScaleX);
                paperHeight     = formArea.Height + (int)((formToPrint.PageMargins.Top + formToPrint.PageMargins.Bottom) * drawingScaleY);
                ErrorHandling.LogError(string.Format("OnBeginPrint Paper: {0}x{1}, Form Area: {2}x{3}, Form Size: {4}x{5}, Orientation: {6}",
                                                     paperWidth,
                                                     paperHeight,
                                                     formArea.Width,
                                                     formArea.Height,
                                                     formToPrint.PageWidth,
                                                     formToPrint.PageHeight,
                                                     context.PageSetup.Orientation), ErrorSeverity.Information);

                totalPages  = formToPrint.GetTotalPages();
                pageColumns = formToPrint.GetPageColumns();
                pageRows    = formToPrint.GetPageRows();

                NPages = totalPages;
                formToPrint.DrawingProvider = null;
            }

            base.OnBeginPrint(context);
        }
Exemplo n.º 29
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr               = context.CairoContext;
            Pango.Layout  layout           = context.CreatePangoLayout();
            float         subtota_por_prod = 0;

            Pango.FontDescription desc = Pango.FontDescription.FromString("Sans");
            // cr.Rotate(90)  Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna
            fontSize  = 8.0;            layout = null;            layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);        layout.FontDescription = desc;
            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);
            // Verifica que la base de datos este conectada
            try{
                imprime_encabezado(cr, layout);
                fontSize  = 6.0;            layout = null;            layout = context.CreatePangoLayout();
                desc.Size = (int)(fontSize * pangoScale);        layout.FontDescription = desc;
                conexion.Open();
                NpgsqlCommand comando;
                comando             = conexion.CreateCommand();
                comando.CommandText = query1;
                //Console.WriteLine(comando.CommandText.ToString());
                NpgsqlDataReader lector     = comando.ExecuteReader();
                string           codigoprod = "";
                if (lector.Read())
                {
                    codigoprod = (string)lector["idproducto"];
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["idproducto"]);                    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(75 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["descripcion_producto"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                    comienzo_linea += separacion_linea;

                    cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["foliodeservicio"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["fechahoracreacion"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(lector ["cantidadaplicada"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["pidpaciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["nombre_paciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                    busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim());
                    cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(tipo_paciente);        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["descripcion_empresa"]);        Pango.CairoHelper.ShowLayout(cr, layout);     comienzo_linea += separacion_linea;
                    salto_de_pagina(cr, layout);
                    subtota_por_prod = float.Parse(lector ["cantidadaplicada"].ToString());
                    busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim());
                    while (lector.Read())
                    {
                        if (codigoprod != (string)lector["idproducto"])
                        {
                            cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(subtota_por_prod.ToString());                    Pango.CairoHelper.ShowLayout(cr, layout);

                            comienzo_linea += separacion_linea;
                            salto_de_pagina(cr, layout);
                            codigoprod = (string)lector["idproducto"];
                            cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["idproducto"]);                    Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(75 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["descripcion_producto"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            comienzo_linea += separacion_linea;
                            salto_de_pagina(cr, layout);
                            cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["foliodeservicio"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["fechahoracreacion"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(lector ["cantidadaplicada"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["pidpaciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["nombre_paciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim());
                            cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(tipo_paciente);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["descripcion_empresa"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            comienzo_linea += separacion_linea;
                            salto_de_pagina(cr, layout);
                            subtota_por_prod = float.Parse(lector ["cantidadaplicada"].ToString());
                        }
                        else
                        {
                            cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["foliodeservicio"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["fechahoracreacion"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(lector ["cantidadaplicada"].ToString());        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["pidpaciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["nombre_paciente"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim());
                            cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(tipo_paciente);        Pango.CairoHelper.ShowLayout(cr, layout);
                            cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText((string)lector["descripcion_empresa"]);        Pango.CairoHelper.ShowLayout(cr, layout);
                            comienzo_linea += separacion_linea;
                            salto_de_pagina(cr, layout);
                            subtota_por_prod += float.Parse(lector ["cantidadaplicada"].ToString());
                        }
                    }
                }
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);            layout.SetText(subtota_por_prod.ToString());                    Pango.CairoHelper.ShowLayout(cr, layout);
            }catch (NpgsqlException ex) {
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Error,
                                                              ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();        msgBoxError.Destroy();
            }
        }
Exemplo n.º 30
0
        void ejecutar_consulta_reporte(PrintContext context)
        {
            Cairo.Context cr     = context.CairoContext;
            Pango.Layout  layout = context.CreatePangoLayout();
            desc = Pango.FontDescription.FromString("Sans");

            imprime_encabezado(cr, layout);
            fontSize  = 7.0;                 layout = null;                  layout = context.CreatePangoLayout();
            desc.Size = (int)(fontSize * pangoScale);               layout.FontDescription = desc;
            layout.FontDescription.Weight = Weight.Normal;

            string   descripcion_producto_aplicado = "";
            TreeIter iter;

            if (treeViewEngine1.GetIterFirst(out iter))
            {
                layout.FontDescription.Weight = Weight.Bold;                            // Letra negrita
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText("Producto Cargados Desde el Stock del Sub-Almacen (sin solicitud)");     Pango.CairoHelper.ShowLayout(cr, layout);
                comienzo_linea += separacion_linea;
                layout.FontDescription.Weight = Weight.Normal;                          // Letra normal
                descripcion_producto_aplicado = (string)lista_cargos_desde_stock.Model.GetValue(iter, 1).ToString().Trim();
                if (descripcion_producto_aplicado.Length > 62)
                {
                    descripcion_producto_aplicado = descripcion_producto_aplicado.Substring(0, 62);
                }
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 0).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(70 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(descripcion_producto_aplicado);  Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 2).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 3).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(440 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 4).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(500 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 5).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                comienzo_linea += separacion_linea;
                while (treeViewEngine1.IterNext(ref iter))
                {
                    descripcion_producto_aplicado = (string)lista_cargos_desde_stock.Model.GetValue(iter, 1).ToString().Trim();
                    if (descripcion_producto_aplicado.Length > 62)
                    {
                        descripcion_producto_aplicado = descripcion_producto_aplicado.Substring(0, 62);
                    }
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 0));      Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(70 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(descripcion_producto_aplicado);  Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 2).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 3).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(440 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 4).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(500 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_cargos_desde_stock.Model.GetValue(iter, 5).ToString().Trim());    Pango.CairoHelper.ShowLayout(cr, layout);
                    comienzo_linea += separacion_linea;
                    salto_de_pagina(cr, layout);
                }
            }

            if (treeViewEngine2.GetIterFirst(out iter))
            {
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                layout.FontDescription.Weight = Weight.Bold;
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText("Producto Solicitados y NO Cargados");   Pango.CairoHelper.ShowLayout(cr, layout);
                layout.FontDescription.Weight = Weight.Normal;
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                descripcion_producto_aplicado = (string)lista_solicitado_no_cargado.Model.GetValue(iter, 1).ToString().Trim();
                if (descripcion_producto_aplicado.Length > 62)
                {
                    descripcion_producto_aplicado = descripcion_producto_aplicado.Substring(0, 62);
                }
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 0));   Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(70 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(descripcion_producto_aplicado);  Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 2).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 3).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(440 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 4).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                cr.MoveTo(500 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 5).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                while (treeViewEngine2.IterNext(ref iter))
                {
                    descripcion_producto_aplicado = (string)lista_solicitado_no_cargado.Model.GetValue(iter, 1).ToString().Trim();
                    if (descripcion_producto_aplicado.Length > 62)
                    {
                        descripcion_producto_aplicado = descripcion_producto_aplicado.Substring(0, 62);
                    }
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 0));   Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(70 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(descripcion_producto_aplicado);  Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 2).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 3).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(440 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 4).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(500 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitado_no_cargado.Model.GetValue(iter, 5).ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout);
                    comienzo_linea += separacion_linea;
                    salto_de_pagina(cr, layout);
                }
            }
            if (treeViewEngine3.GetIterFirst(out iter))
            {
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                layout.FontDescription.Weight = Weight.Bold;
                cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText("Producto Solicitados y Cargados (Devoluciones)");       Pango.CairoHelper.ShowLayout(cr, layout);
                layout.FontDescription.Weight = Weight.Normal;
                comienzo_linea += separacion_linea;
                salto_de_pagina(cr, layout);
                while (treeViewEngine3.IterNext(ref iter))
                {
                    descripcion_producto_aplicado = (string)lista_solicitados_y_cargados.Model.GetValue(iter, 1).ToString().Trim();
                    if (descripcion_producto_aplicado.Length > 62)
                    {
                        descripcion_producto_aplicado = descripcion_producto_aplicado.Substring(0, 62);
                    }
                    cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText((string)lista_solicitados_y_cargados.Model.GetValue(iter, 0));  Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(70 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);           layout.SetText(descripcion_producto_aplicado);  Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(360 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitados_y_cargados.Model.GetValue(iter, 2).ToString().Trim());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(400 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitados_y_cargados.Model.GetValue(iter, 3).ToString().Trim());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(440 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitados_y_cargados.Model.GetValue(iter, 4).ToString().Trim());        Pango.CairoHelper.ShowLayout(cr, layout);
                    cr.MoveTo(500 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows);          layout.SetText((string)lista_solicitados_y_cargados.Model.GetValue(iter, 5).ToString().Trim());        Pango.CairoHelper.ShowLayout(cr, layout);
                    comienzo_linea += separacion_linea;
                    salto_de_pagina(cr, layout);
                }
            }
        }