Esempio n. 1
0
 public Factura(string archivo)
 {
     InitializeComponent();
     base.FormClosing += new FormClosingEventHandler(this.cerradoForm);
     base.Load        += new EventHandler(this.Factura_Load);
     this.oFile        = new CuadroDeDialogos.OFile("Archivos Fac|*.fac", ".fac", CuadroDeDialogos.tipoDialogo.openFileD, true);
     this.sFile        = new CuadroDeDialogos.SFile("Archivos Fac|*.fac", ".fac", CuadroDeDialogos.tipoDialogo.saveFileD, true);
     this.cambio       = false;
     this.InitializeComponent();
     this.lectura(archivo);
     this.cambiarEstado(false);
     this.ShowDialog();
 }
Esempio n. 2
0
 public Factura(string importe, string iva, string retencion, string total, [Optional, DefaultParameterValue(false)] bool tipoF, [Optional, DecimalConstant(0, 0, (uint) 0, (uint) 0, (uint) 0)] decimal cantidad, [Optional, DefaultParameterValue(null)] string precioU)
 {
     base.FormClosing += new FormClosingEventHandler(this.cerradoForm);
     base.Load        += new EventHandler(this.Factura_Load);
     this.oFile        = new CuadroDeDialogos.OFile("Archivos Fac|*.fac", ".fac", CuadroDeDialogos.tipoDialogo.openFileD, true);
     this.sFile        = new CuadroDeDialogos.SFile("Archivos Fac|*.fac", ".fac", CuadroDeDialogos.tipoDialogo.saveFileD, true);
     this.cambio       = false;
     this.InitializeComponent();
     this.nupCantidad.Maximum = decimal.MaxValue;
     this.txtImporte.Text     = importe;
     this.txtIVA.Text         = iva;
     this.txtRetencion.Text   = retencion;
     this.txtTotal.Text       = total;
     this.txtPrecioU.Text     = precioU;
     this.nupCantidad.Value   = cantidad;
     this.tipoFactura         = tipoF;
     if (!tipoF)
     {
         this.oFile = new CuadroDeDialogos.OFile("Archivos Fac|*.fac;*.txt", ".fac", CuadroDeDialogos.tipoDialogo.openFileD, false);
     }
     //this.txtPrecioU.Enabled = tipoF;
     //this.nupCantidad.Enabled = tipoF;
     this.textboxs = new TextBox[] { this.txtImporte, this.txtIVA, this.txtRetencion, this.txtTotal, this.txtPrecioU };
     foreach (Control control in textboxs)
     {
         if (control is TextBox)
         {
             if (!String.IsNullOrEmpty(control.Text))
             {
                 if (!control.Text.Substring(0, 1).Equals("$"))
                 {
                     control.Text = "$" + control.Text;
                 }
             }
             else
             {
                 control.Text = "$0.00";
             }
         }
     }
     this.cambiarEstado(false);
     this.ShowDialog();
 }