private void CargarDatos() { List <Nota_Venta> notas = EnlaceCassandra.ObtenerNotasVentasFernando(); VerDatosGrid.DataSource = notas; VerDatosGrid.ClearSelection(); }
private void LimpiarFormulario(string textBotonAgregar = "Agregar Nota") { Nom_client.Text = ""; Nom_emp.Text = ""; Nom_proc.Text = ""; Cantidad.Text = ""; Precio.Text = ""; Nom_empleado.Text = ""; Fecha_proc.Value = DateTime.Now; Agregar.Text = textBotonAgregar; AgregarProducto.Enabled = true; Eliminar.Enabled = false; RetirarProducto.Enabled = false; VerDatosGrid.ClearSelection(); Productos.DataSource = null; productosNotaVenta = null; }
private void VerDatosGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { Eliminar.Enabled = false; uuidAEliminar = ""; VerDatosGrid.ClearSelection(); return; } uuidAEliminar = Convert.ToString(VerDatosGrid.Rows[e.RowIndex].Cells["idVenta"].Value); newGuid = Guid.Parse(uuidAEliminar); LimpiarFormulario("Editar Nota"); Eliminar.Enabled = true; if (productosNotaVenta == null) { productosNotaVenta = new List <Tuple <int, decimal, string> >(); } EnlaceCassandra.ObtenerDatosTextFernando(newGuid, Nom_client, Nom_emp, Nom_empleado, Fecha_proc, Productos, ref productosNotaVenta); Productos.ClearSelection(); }