Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ELIMINA LA FILA DE ESE PRODUCTO AL HACER CLICK EN EL BOTON "BORRAR"
- // FUNCION A ARREGLAR (BORRA MAS DE LO NECESARIO)
- private void Pagos_CellClick(object sender, DataGridViewCellEventArgs e)
- {
- if (this.Pagos.Columns[e.ColumnIndex].Name == "colBotones")
- {
- string mesa = this.numMesa;
- int id_producto = Convert.ToInt32(txtID.Text.ToString());
- string nombre = txtNombre.Text.ToString();
- double precio = Convert.ToDouble(txtPrecio.Text.ToString());
- double cantidad = Convert.ToDouble(txtCantidad.Text.ToString());
- double subtotal = Convert.ToDouble(etiquetaSubTotalNum.Text.ToString());
- String consulta = "DELETE FROM Productos where mesa = @mesa and id_producto = @id_producto and nombre = @nombre and precio = @precio and cantidad = @cantidad and subtotal = @subtotal";
- SQLiteCommand cmd = new SQLiteCommand(consulta, conexion);
- cmd.Parameters.Clear();
- cmd.Parameters.Add(new SQLiteParameter("@mesa", mesa));
- cmd.Parameters.Add(new SQLiteParameter("@id_producto", id_producto));
- cmd.Parameters.Add(new SQLiteParameter("@nombre", nombre));
- cmd.Parameters.Add(new SQLiteParameter("@precio", precio));
- cmd.Parameters.Add(new SQLiteParameter("@cantidad", cantidad));
- cmd.Parameters.Add(new SQLiteParameter("@subtotal", subtotal));
- cmd.ExecuteNonQuery();
- Pagos.Rows.RemoveAt(Pagos.CurrentRow.Index);
- }
- }
Add Comment
Please, Sign In to add comment