Example #1
0
        private void textBoxProducto_KeyDown(object sender, KeyEventArgs e)
        {
            double tc = 0;

            try
            {
                tc = Convert.ToDouble(textBoxTC.Text);
            }
            catch
            {
                textBoxTC.Text = "0";
                MessageBox.Show("Escriba el Tipo de Cambio Actual");
                return;
            }

            if (tc < 15)
            {
                MessageBox.Show("Escriba el Tipo de Cambio Actual");
                return;
            }
            else if (tc > 30)
            {
                MessageBox.Show("Escriba el Tipo de Cambio Actual");
                return;
            }

            if (comboBoxMonedaCompra.Text == "")
            {
                MessageBox.Show("Seleccione la moneda correcta");
                return;
            }
            if (e.KeyValue == 13)//si presiona enter agrega el producto
            {
                DataRow dr = ReconocerCodigo.codigoReconocido(textBoxProducto.Text);
                if (dr != null)
                {
                    int idPto  = Convert.ToInt32(dr["Id"]);
                    int unidad = 0;
                    try
                    {
                        unidad = Convert.ToInt32(dr["UNIDAD"]);
                    }
                    catch
                    {
                        unidad = 1;
                    }
                    ProductoSeleccionado = new productos(idPto);
                    AgregarPartida(idPto, unidad);
                    VerDGV();
                    textBoxProducto.Text = "";
                }
                else
                {
                    BuscarP();
                }
            }
        }
        private void buttonBuscar_Click(object sender, EventArgs e)
        {
            DataRow dr = ReconocerCodigo.codigoReconocido(textBoxCatalogo.Text);

            if (dr != null)
            {
                AbrirFormProducto(Convert.ToInt32(dr["Id"]));
            }
            else
            {
                VisualizarDGV();
            }
        }
 private void textBoxCatalogo_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 13)
     {
         DataRow dr = ReconocerCodigo.codigoReconocido(textBoxCatalogo.Text);
         if (dr != null)
         {
             AbrirFormProducto(Convert.ToInt32(dr["Id"]));
         }
         else
         {
             VisualizarDGV();
         }
     }
 }
Example #4
0
        private void buttonBuscar_Click(object sender, EventArgs e)
        {
            if (AccesoInternet() == false)
            {
                MessageBox.Show("No hay internet, intente en un momento"); return;
            }
            DataRow dr = ReconocerCodigo.codigoReconocido(textBoxCatalogo.Text);

            if (dr != null)
            {
                AbrirFormProducto(Convert.ToInt32(dr["Id"]), (bool)dr["STOCKMUERTO"]);
            }
            else
            {
                VisualizarDGV();
            }
        }
        private void textBoxProducto_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (Convert.ToDouble(textBoxTipoCambio.Text) > 10 && Convert.ToDouble(textBoxTipoCambio.Text) < 30)
                {
                }
                else
                {
                    MessageBox.Show("Agrege un TC valido"); return;
                }
            }
            catch
            { MessageBox.Show("Agrege un TC valido"); return; }
            if (e.KeyCode == Keys.Enter)
            {
                DataRow dr = ReconocerCodigo.codigoReconocido(textBoxProducto.Text);
                if (dr != null)
                {
                    //   MessageBox.Show("no Es nulo");
                    int idPto  = Convert.ToInt32(dr["Id"]);
                    int unidad = 0;
                    try
                    {
                        unidad = Convert.ToInt32(dr["UNIDAD"]);
                    }
                    catch
                    {
                        unidad = 1;
                    }
                    ProductoSeleccionado2 = new productos(idPto);
                    AgregarPartida(unidad);
                    VerDGV();

                    textBoxProducto.Text = "";
                }
                else
                {
                    buttonIngresar.PerformClick();
                }
            }
        }