Exemple #1
0
 private void LimpiarCampos()
 {
     Txt_Cantidad.Text = "";
     Txt_CantidadParticionable.Text = "1";
     Txt_CantidadTotal.Text         = "";
     Txt_CodigoProducto.Text        = "";
     Txt_Descripcion.Clear();
     Txt_DescripcionTicket.Clear();
     Txt_PrecioCosto.Text        = "";
     Txt_PrecioVenta.Text        = "";
     Txt_PorcentajeGanancia.Text = "";
     cb_prove.Text = "";
     Txt_Rubro.Clear();
     Txt_StockCritico.Clear();
     Txt_CodigoProducto.Select();
     LLenarComboBox(cb_prove, "Nombre_RazonSocial");
     LLenarComboBox(cb_Proveedor, "Nombre_RazonSocial");
     LLenarComboBox(cb_Rubro, "Cod_Producto");
 }
Exemple #2
0
 private void NotLetter(object sender, KeyPressEventArgs e)
 {
     if (sender == Txt_CodigoProducto && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_Descripcion.Select();
     }
     if (sender == Txt_Descripcion && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_DescripcionTicket.Select();
     }
     if (sender == Txt_DescripcionTicket && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_Cantidad.Select();
     }
     if (sender == Txt_Cantidad && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_PrecioCosto.Select();
     }
     if (sender == Txt_PrecioCosto && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_PrecioVenta.Select();
     }
     if (sender == Txt_PrecioVenta && e.KeyChar == (Char)Keys.Enter)
     {
         e.Handled = true;
         Txt_StockCritico.Select();
     }
     if (sender == Txt_StockCritico)
     {
         if (e.KeyChar == (char)Keys.Enter)
         {
             e.Handled = true;
             Btn_Aceptar.Select();
         }
         if (!(char.IsNumber(e.KeyChar)) && (e.KeyChar != (char)Keys.Back))
         {
             e.Handled = true;
         }
     }
     if (Txt_PorcentajeGanancia == sender && e.KeyChar == (char)Keys.Enter)
     {
         double costo = 0, porcentaje = 0, venta = 0;
         if (Txt_PrecioCosto.Text != "")
         {
             costo = Convert.ToDouble(Txt_PrecioCosto.Text);
         }
         if (Txt_PrecioVenta.Text != "" && Txt_PorcentajeGanancia.Text != "")
         {
             porcentaje = Convert.ToDouble(Txt_PorcentajeGanancia.Text);
         }
         venta = Math.Round((costo + ((porcentaje * costo) / 100)), 2);
         Txt_PrecioVenta.Text = venta.ToString();
         cb_prove.Select();
     }
     if (Txt_PrecioVenta == sender)
     {
         TextBoxComas(sender, e, Txt_PrecioVenta);
         if (e.KeyChar == (char)Keys.Enter)
         {
             double Venta = Convert.ToDouble(Txt_PrecioVenta.Text);
             double Costo = Convert.ToDouble(Txt_PrecioCosto.Text);
             Txt_PorcentajeGanancia.Text = (Math.Round((((Venta - Costo) * 100) / Costo), 2)).ToString();
         }
     }
     if (Txt_PrecioCosto == sender)
     {
         TextBoxComas(sender, e, Txt_PrecioCosto);
     }
 }