Exemplo n.º 1
0
        void CedulaRifButtonEdit_Validating(object sender, CancelEventArgs e)
        {
            DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit)sender;
            if (!Editor.IsModified)
            {
                return;
            }
            string Texto = Editor.Text;

            this.libroVentaBindingSource.EndEdit();
            List <Cliente> T = FactoryClientes.getItems(Texto);

            switch (T.Count)
            {
            case 0:
                proveedor           = new Cliente();
                proveedor.CedulaRif = Basicas.CedulaRif(Texto);
                break;

            case 1:
                proveedor = T[0];
                break;

            default:
                FrmBuscarEntidades F = new FrmBuscarEntidades();
                F.BuscarClientes(Texto);
                if (F.registro != null)
                {
                    proveedor = (Cliente)F.registro;
                    proveedor = FactoryClientes.Item(proveedor.CedulaRif);
                }
                else
                {
                    proveedor = null;
                }
                break;
            }
            LeerProveedor();
        }
Exemplo n.º 2
0
 void FrmPagar_Load(object sender, EventArgs e)
 {
     this.Aceptar.Click               += new EventHandler(Aceptar_Click);
     this.Cancelar.Click              += new EventHandler(Cancelar_Click);
     this.KeyDown                     += new KeyEventHandler(FrmPagar_KeyDown);
     this.EfectivoTextEdit.Enter      += new EventHandler(Editor_Enter);
     this.ChequeTextEdit.Enter        += new EventHandler(Editor_Enter);
     this.TarjetaTextEdit.Enter       += new EventHandler(Editor_Enter);
     this.txtTransferencia.Enter      += new EventHandler(Editor_Enter);
     this.EfectivoTextEdit.Validating += new CancelEventHandler(EfectivoTextEdit_Validating);
     this.ChequeTextEdit.Validating   += new CancelEventHandler(ChequeTextEdit_Validating);
     this.txtTransferencia.Validating += new CancelEventHandler(txtTransferencia_Validating);
     this.txtRetencion.Validating     += new CancelEventHandler(txtRetencion_Validating);
     this.TarjetaTextEdit.Validating  += new CancelEventHandler(TarjetaTextEdit_Validating);
     this.Efectivo.Click              += new EventHandler(Efectivo_Click);
     this.Cheque.Click                += new EventHandler(Cheque_Click);
     this.Tarjeta.Click               += new EventHandler(Tarjeta_Click);
     this.ConsumoInterno.Click        += new EventHandler(ConsumoInterno_Click);
     this.Credito.Click               += new EventHandler(Credito_Click);
     this.Transferencia.Click         += new EventHandler(Transferencia_Click);
     this.Retencion.Click             += new EventHandler(Retencion_Click);
     this.txtCedulaRif.Validating     += new CancelEventHandler(txtCedulaRif_Validating);
     this.txtCedulaRif.ButtonClick    += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(txtCedulaRif_ButtonClick);
     factura.CedulaRif                 = Basicas.CedulaRif("0");
     factura.RazonSocial               = "CONTADO";
     factura.Direccion                 = Basicas.parametros().Ciudad;
     this.KeyPreview                   = true;
     if (FactoryUsuarios.UsuarioActivo.PuedeDarConsumoInterno == true)
     {
         this.txtAutorizadoPor.Visible = false;
         this.txtContraseña.Visible    = false;
     }
     factura.TasaIva = CalcularTasaIva();
     factura.Saldo   = factura.MontoTotal;
     this.facturaBindingSource.DataSource = factura;
     this.facturaBindingSource.ResetBindings(true);
 }
Exemplo n.º 3
0
        void CedulaRifTextEdit_Validating(object sender, CancelEventArgs e)
        {
            DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit)sender;
            if (!Editor.IsModified)
            {
                return;
            }
            string            Texto = Editor.Text;
            List <Proveedore> T     = FactoryProveedores.getItems(Texto);

            switch (T.Count)
            {
            case 0:
                Editor.Text = Basicas.CedulaRif(Texto);
                break;

            case 1:
                registro.CedulaRif         = T[0].CedulaRif;
                registro.NombreRazonSocial = T[0].RazonSocial;
                break;

            default:
                FrmBuscarEntidades F = new FrmBuscarEntidades();
                F.BuscarProveedores(Texto);
                if (F.registro != null)
                {
                    registro.CedulaRif         = ((Proveedore)F.registro).CedulaRif;
                    registro.NombreRazonSocial = ((Proveedore)F.registro).RazonSocial;
                }
                else
                {
                    registro.CedulaRif         = null;
                    registro.NombreRazonSocial = null;
                }
                break;
            }
        }
 void CedulaTextEdit_Validating(object sender, CancelEventArgs e)
 {
     this.CedulaTextEdit.Text = Basicas.CedulaRif(this.CedulaTextEdit.Text);
 }