private void AgregarDetalle()
        {
            try
            {
                if (string.IsNullOrEmpty(Txt_Producto.Text))
                {
                    Txt_Producto.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(Txt_ValorUnidad.Text))
                {
                    Txt_ValorUnidad.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(Txt_Unidades.Text))
                {
                    Txt_Unidades.Focus();
                    return;
                }

                Factura.GuardarItem(Equipo, NDetalle);
                MessageBox.Show("Item agregado con éxito");
                InicializarFormulario();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void Txt_Unidades_Leave(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Txt_Unidades.Text))
     {
         Txt_Unidades.Focus();
         return;
     }
     NDetalle.Cantidad = Convert.ToInt32(Txt_Unidades.Text);
     CalcularTotal();
 }
        private void ActivarPanel(bool EsNuevo)
        {
            if (EsNuevo)
            {
                Pnl_Nuevo.Visible    = true;
                Pnl_Detalles.Visible = false;

                Txt_Producto.Clear();
                Txt_ValorUnidad.Clear();
                Txt_Unidades.Clear();

                NDetalle = new ENT.Detalles_ENT();
                Txt_Producto.Focus();
            }
            else
            {
                NDetalle             = new ENT.Detalles_ENT();
                Pnl_Nuevo.Visible    = false;
                Pnl_Detalles.Visible = true;
            }
        }