Ejemplo n.º 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            string      id = cbxMenu.SelectedValue.ToString();
            BaseDeDatos bd = new BaseDeDatos();

            Boolean res = bd.ModificarProducto(tbxPlatillo.Text, tbxPrecio.Text, rtbxDescripcion.Text, id);

            if (res)
            {
                MessageBox.Show("Su producto fue actualizado con exito!");
            }
            else
            {
                MessageBox.Show("No se logro actualizar el producto");
            }
        }
Ejemplo n.º 2
0
        private void registrarBtn_Click(object sender, EventArgs e)
        {
            BaseDeDatos bd  = new BaseDeDatos();
            Boolean     res = bd.AgregarProducto(tbxNomPlatillo.Text, tbxPrecioPlatillo.Text, rtbxDescripcion.Text);

            if (res)
            {
                MessageBox.Show("Su producto fue agregado con exito!");
            }
            else
            {
                MessageBox.Show("No se logro agregar el producto");
            }

            tbxPrecioPlatillo.Clear();
            tbxPrecioPlatillo.Clear();
            rtbxDescripcion.Clear();
        }