Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. Ingreso I = new Ingreso();
  2. I.ID_Producto = ID_Producto;
  3. I.Producto = cmb_producto.Text;
  4. I.ID_Productor = ID_Productor;
  5. I.Productor = cmb_productor.Text;
  6. I.Fecha_Ingreso = Fecha.Value.Date;
  7. I.Cantidad = Convert.ToInt16(txt_cantidad_ingresada.Text);
  8. I.Precio_Unitario = Convert.ToDecimal(txt_precio_unitario.Text);
  9. I.Descripcion = txt_descripcion.Text;
  10.  
  11. Ingresos.Add(I);
  12. ListadeIngresos = new BindingList<Ingreso>(Ingresos);
  13. BindingSource source = new BindingSource(ListadeIngresos, null);
  14. Grid_Ingreso.DataSource = source;
  15.  
  16. private void Grid_Ingreso_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
  17. {
  18. int index = e.Row.Index;
  19. Ingresos.RemoveAt(index);
  20. ListadeIngresos.RemoveAt(index);
  21. BindingSource source = new BindingSource(ListadeIngresos, null);
  22. Grid_Ingreso.DataSource = source;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement