public void ObtenerDatos(Ventas ven, Articulos ar) { ven.Fecha = FecharTextBox.Text; ven.Monto = Convert.ToSingle(TotalTextBox.Text); ven.VetaId = ConvertirId(); int idAux = 0; foreach (GridViewRow row in DetalleGridView.Rows) { ven.AgregarArticulos(Convert.ToInt32(row.Cells[0].Text), Convert.ToInt32(row.Cells[1].Text), Convert.ToSingle(row.Cells[2].Text)); idAux = Convert.ToInt32(row.Cells[1].Text); ar.ObtenerDatosArticulo(Convert.ToInt32(row.Cells[0].Text)); ar.AgregarExistencia(Convert.ToInt32(row.Cells[0].Text), ar.Existencia, Convert.ToInt32(row.Cells[1].Text)); } }