Exemplo n.º 1
0
        private void btnStock_Agregar_Click(object sender, EventArgs e)
        {
            //agregar stock
            try
            {
                if (txtStock_Cantidad.Text != string.Empty || txtStock_Cod.Text == string.Empty)

                {
                    if (Convert.ToInt32(txtStock_Cantidad.Text) >= 0)

                    {
                        Cstock agregar01 = new Cstock();
                        agregar01.AgregarStock(Convert.ToInt32(txtStock_Cod.Text), Convert.ToInt32(txtStock_Cantidad.Text), Convert.ToInt32(txtStock_Actual.Text));
                        mensajeOK("Operacion Exitosa!");
                        consultarStock();
                        limpiarCamposStock();
                    }
                    else
                    {
                        mensajeError("CANTIDAD NO PUEDE SER (-) NEGATIVO");
                    }
                }
                else
                {
                    mensajeError("TODOS LOS CAMPOS DEBEN ESTAR RELLENADOS");
                }
            }
            catch (Exception ev)
            {
                MessageBox.Show(ev.Message);
            }
        }
Exemplo n.º 2
0
        public void consultarStock()
        {
            //consultar stock

            Cstock consultar01 = new Cstock();

            tblStock.DataSource = consultar01.ConsultarStock();
        }