Beispiel #1
0
 // The PrintPage event is raised for each page to be printed.
 private void pd_PrintPage(object sender, PrintPageEventArgs ev)
 {
     PrintLecturaResponse[] printLecturaResponses = repository.getLecturaDatos(this.printLecturaRequest);
     foreach (var r in printLecturaResponses)
     {
         PrintLecturaResponse item = new PrintLecturaResponse();
         item.Texto   = r.Texto;
         item.Formato = r.Formato;
         StringFormat format1 = new StringFormat(StringFormatFlags.NoClip);
         Font         tmpFont = new Font(drawFont.Name, drawFont.Size);
         // Por default alineado a la izquierda
         format1.Alignment = StringAlignment.Far;
         string[] formatos = item.Formato.Split('|');
         foreach (var f in formatos)
         {
             if (f == "center")
             {
                 format1.Alignment = StringAlignment.Center;
             }
             else if (f.IndexOf("font") != -1)
             {
                 tmpFont = new Font(f.Split(':')[1], Convert.ToInt32(f.Split(':')[2]));
             }
         }
         pos.X = startX;
         pos.Y = startY + Offset;
         ev.Graphics.DrawString(item.Texto, tmpFont, drawBrush, pos, format1);
         Offset = Offset + 10;
     }
     ev.HasMorePages = false;
 }
Beispiel #2
0
        /// <summary>
        /// Extrae la informacion de la lectura X y Z
        /// </summary>
        /// <param name="folioNotaCredito"></param>
        public PrintLecturaResponse[] getNotaCredito(string folioNotaCredito)
        {
            List <PrintLecturaResponse> printLecturaResponseList = new List <PrintLecturaResponse>();
            var parameters = new Dictionary <string, object>();

            parameters.Add("@folioNotaCredito", folioNotaCredito);
            foreach (var c in data.GetDataReader("dbo.sp_vanti_NotaCredito_EmicionTicket", parameters))
            {
                PrintLecturaResponse printLecturaResponse = new PrintLecturaResponse();
                printLecturaResponse.Texto   = c.GetValue(1).ToString();
                printLecturaResponse.Formato = c.GetValue(0).ToString();
                printLecturaResponseList.Add(printLecturaResponse);
            }
            return(printLecturaResponseList.ToArray());
        }
Beispiel #3
0
        /// <summary>
        /// Extrae la informacion de la Consulta de Saldo
        /// </summary>
        /// <param name="numeroTarjeta"></param>
        public PrintLecturaResponse[] getConsultaSaldo(string numeroTarjeta)
        {
            List <PrintLecturaResponse> printLecturaResponseList = new List <PrintLecturaResponse>();
            var parameters = new Dictionary <string, object>();

            parameters.Add("@NumeroTarjeta", numeroTarjeta);
            foreach (var c in data.GetDataReader("sp_vanti_GetTicketConsultaSaldoMM", parameters))
            {
                PrintLecturaResponse printLecturaResponse = new PrintLecturaResponse();
                printLecturaResponse.Texto   = c.GetValue(1).ToString();
                printLecturaResponse.Formato = c.GetValue(0).ToString();
                printLecturaResponseList.Add(printLecturaResponse);
            }
            return(printLecturaResponseList.ToArray());
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cuponFolio"></param>
        /// <returns></returns>
        public PrintLecturaResponse[] getCupon(string cuponFolio)
        {
            List <PrintLecturaResponse> printLecturaResponseList = new List <PrintLecturaResponse>();
            var parameters = new Dictionary <string, object>();

            parameters.Add("@FolioCupon", cuponFolio);
            foreach (var c in data.GetDataReader("dbo.sp_vanti_DatosTicketLecturas", parameters))
            {
                PrintLecturaResponse printLecturaResponse = new PrintLecturaResponse();
                printLecturaResponse.Texto   = c.GetValue(1).ToString();
                printLecturaResponse.Formato = c.GetValue(0).ToString();
                printLecturaResponseList.Add(printLecturaResponse);
            }
            return(printLecturaResponseList.ToArray());
        }