public FormatoCheque() { tamFuente = 9; nombreFuente = "Arial"; cantidadLetra = new Punto(); inicio = 0.0; fecha = new Punto(); factura = new Punto(); cantidadNumero = new Punto(); leyenda = new Punto(); nombre = new Punto(); nomConf = ""; activo = false; concepto = new Punto(); }
public FormatoNota() { fecha = new Punto(); folio = new Punto(); nombre = new Punto(); direccion = new Punto(); ciudad = new Punto(); cantidad = new Punto(); concepto = new Punto(); precio = new Punto(); importe = new Punto(); totalLetra = new Punto(); totalNumerico = new Punto(); interlineado = 0.0; inicio = 0.0; activo = false; nombreConf = ""; tipoFuente = "Arial"; tamFuente = 9; }
public bool setTotalNumerico(string x, string y) { double valorX, valorY; try { valorX = Convert.ToDouble(x.Trim()); valorY = Convert.ToDouble(y.Trim()); totalNumerico = new Punto(valorX, valorY); return true; } catch { return false; } }
public bool setNombre(string x, string y) { double valorX, valorY; try { valorX = Convert.ToDouble(x.Trim()); valorY = Convert.ToDouble(y.Trim()); nombre = new Punto(valorX, valorY); return true; } catch { return false; } }
public bool setDireccion(string x, string y) { double valorX, valorY; try { valorX = Convert.ToDouble(x.Trim()); valorY = Convert.ToDouble(y.Trim()); direccion = new Punto(valorX, valorY); return true; } catch { return false; } }
public bool setNombre(string x, string y) { double valX, valY; try { valX = Convert.ToDouble(x); valY = Convert.ToDouble(y); nombre= new Punto(valX, valY); return true; } catch { return false; } }
public bool setLeyenda(string x, string y) { double valX, valY; try { valX = Convert.ToDouble(x); valY = Convert.ToDouble(y); leyenda = new Punto(valX, valY); return true; } catch { return false; } }
public bool setCantidadNumero(string x, string y) { double valX, valY; try { valX = Convert.ToDouble(x); valY = Convert.ToDouble(y); cantidadNumero = new Punto(valX, valY); return true; } catch { return false; } }
private void imprimeCheque(System.Drawing.Printing.PrintPageEventArgs e) { Point puntoTexto, puntoConv; Punto puntoMov = new Punto(); string texto; double inicio; Brush brocha = new SolidBrush(Color.Black); Font fuente; e.Graphics.PageUnit = GraphicsUnit.Millimeter; fuente = new Font(formatoCheque.getNombreFuente(), formatoCheque.getTamFuente()); inicio = formatoCheque.getInicio(); //cantidad numero texto = valorMoneda(ch.getCantidad()); puntoConv = convierteAMilimetros(formatoCheque.getCantidadNumero(), inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //cantidad letra texto = m.Convertir(ch.getCantidad().ToString(),false); puntoConv = convierteAMilimetros(formatoCheque.getCantidadLetra(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //fecha texto = regresaFecha(ch.getFecha()); puntoConv = convierteAMilimetros(formatoCheque.getFecha(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //Nombre texto = ch.getNombre(); puntoConv = convierteAMilimetros(formatoCheque.getNombre(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //factura texto = ch.getFactura().ToString(); puntoConv = convierteAMilimetros(formatoCheque.getFactura(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); if (ch.getEsPoliza()) { //Concepto texto = ch.getConcepto(); puntoConv = convierteAMilimetros(formatoCheque.getConcepto(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); } if (ch.getLeyenda()) { texto = "Para abono en cuenta \n del Beneficiario"; puntoConv = convierteAMilimetros(formatoCheque.getLeyenda(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, new Font(fuente.SystemFontName, 9), texto, e); e.Graphics.DrawString(texto, new Font(fuente.SystemFontName, 9), brocha, puntoTexto); } }
private Point convierteAMilimetros(Punto p,double inicio) { int x, y; x =(int) (p.getX() * 10); y = (int)((p.getY()-inicio) * 10); return new Point(x, y); }
private void imprimeNota(System.Drawing.Printing.PrintPageEventArgs e) { Point puntoTexto, puntoConv; Punto puntoMov = new Punto(); string texto; double inicio; Brush brocha = new SolidBrush(Color.Black); Font fuente; e.Graphics.PageUnit = GraphicsUnit.Millimeter; fuente = new Font(formatoNota.getTipoFuente(), formatoNota.getTamFuente()); inicio = formatoNota.getInicio(); // e.Graphics.DrawString("prueba de inicio", fuente, brocha, new Point(0, 0)); //numNota texto = n.getFolio().ToString(); puntoConv = convierteAMilimetros(formatoNota.getFolio(), inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //Fecha texto = regresaFecha(n.getFecha()); puntoConv = convierteAMilimetros(formatoNota.getFecha(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //Nombre texto = n.getCliente().getNombre(); puntoConv = convierteAMilimetros(formatoNota.getNombre(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //direccion texto = n.getCliente().getDireccion().ToString(); puntoConv = convierteAMilimetros(formatoNota.getDireccion(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //Movimientos for (int i = 0; i < n.getLista().Count; i++) { //cantidad texto = n.getLista()[i].getCantidad().ToString() + " "; puntoMov.setDoubleX(formatoNota.getCantidad().getX().ToString()); puntoMov.setDoubleY((formatoNota.getCantidad().getY() + (formatoNota.getInterlineado() * i)).ToString()); puntoConv = convierteAMilimetros(puntoMov, inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //descripcion texto = n.getLista()[i].getConcepto().ToString(); puntoMov.setDoubleX(formatoNota.getConcepto().getX().ToString()); puntoMov.setDoubleY((formatoNota.getConcepto().getY() + (formatoNota.getInterlineado() * i)).ToString()); puntoConv = convierteAMilimetros(puntoMov, inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); //precio if (n.getBandPrecio()) { texto = valorMoneda(n.getLista()[i].getCosto()); puntoMov.setDoubleX(formatoNota.getPrecio().getX().ToString()); puntoMov.setDoubleY((formatoNota.getPrecio().getY() + (formatoNota.getInterlineado() * i)).ToString()); puntoConv = convierteAMilimetros(puntoMov, inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); } //importe texto = valorMoneda(n.getLista()[i].getImporte()); puntoMov.setDoubleX(formatoNota.getImporte().getX().ToString()); puntoMov.setDoubleY((formatoNota.getImporte().getY() + (formatoNota.getInterlineado() * i)).ToString()); puntoConv = convierteAMilimetros(puntoMov, inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); } //Total Letra if (n.getBandLetra()) { texto = m.Convertir(n.getTotal().ToString(), false); puntoConv = convierteAMilimetros(formatoNota.getTotalLetra(), inicio); puntoTexto = regresaPuntoAlinNormal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); } //total cantidad texto = valorMoneda(n.getTotal()); puntoConv = convierteAMilimetros(formatoNota.getTotalNumerico(), inicio); puntoTexto = regresaPuntoAlinFinal(puntoConv.X, puntoConv.Y, fuente, texto, e); e.Graphics.DrawString(texto, fuente, brocha, puntoTexto); }