Skip to content

Commit f9a55dc

Browse files
committed
a
1 parent 9858c7e commit f9a55dc

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

Form1.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Form1.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818

1919
namespace Lab_6
2020
{
21-
public partial class fBiblioteca : Form
21+
public partial class FBiblioteca : Form
2222
{
23-
public fBiblioteca()
23+
public FBiblioteca()
2424
{
2525
InitializeComponent();
2626
}
2727

2828
private void btMostrarLibro_Click(object sender, EventArgs e)
2929
{
3030
ConexionBaseDeDatos conexionBaseDeDatos = new ConexionBaseDeDatos();
31-
DataSet datos = conexionBaseDeDatos.ObtenerDatos(false);
32-
dgvLibro.DataSource = datos.Tables["Libros"];
31+
DataSet datos = conexionBaseDeDatos.ObtenerDatos(false); // falso significa no muestres al elemento mas reciente de primero en el datagridview
32+
dgvLibro.DataSource = datos.Tables["Libros"]; //refresca el datagridview
3333
}
3434

3535
private void btEliminarLibro_Click(object sender, EventArgs e)
@@ -64,7 +64,7 @@ private void btEliminarLibro_Click(object sender, EventArgs e)
6464
conexionBaseDeDatos.DeleteDatos(query);
6565

6666
DataSet datos = conexionBaseDeDatos.ObtenerDatos(false);
67-
dgvLibro.DataSource = datos.Tables["Libros"];
67+
dgvLibro.DataSource = datos.Tables["Libros"]; //refresca el datagridview
6868

6969

7070
}
@@ -96,7 +96,7 @@ private void btActualizar_Click(object sender, EventArgs e)
9696
conexionBaseDeDatos.UpdateDatos(nuevaCantidad, id);
9797

9898
DataSet datos = conexionBaseDeDatos.ObtenerDatos(false);
99-
dgvLibro.DataSource = datos.Tables["Libros"];
99+
dgvLibro.DataSource = datos.Tables["Libros"];//refresca el datagridview
100100

101101
}
102102
else
@@ -133,12 +133,12 @@ private void btAgregarLibro_Click(object sender, EventArgs e)
133133
ConexionBaseDeDatos conexionBaseDeDatos = new ConexionBaseDeDatos();
134134
conexionBaseDeDatos.InsertDatos(titulo, autor, cantidadDisponible);
135135

136-
DataSet datos = conexionBaseDeDatos.ObtenerDatos(false);
137-
dgvLibro.DataSource = datos.Tables["Libros"];
136+
DataSet datos = conexionBaseDeDatos.ObtenerDatos(true); // true significa muestra el elemento mas reciente de primero en el datagridview
137+
dgvLibro.DataSource = datos.Tables["Libros"];//refresca el datagridview
138138

139139
}
140140

141-
private void fBiblioteca_Load(object sender, EventArgs e)
141+
private void FBiblioteca_Load(object sender, EventArgs e)
142142
{
143143
// Aquí podrías cargar la lista de libros al iniciar la aplicación
144144
}

Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void Main()
1616
{
1717
Application.EnableVisualStyles();
1818
Application.SetCompatibleTextRenderingDefault(false);
19-
Application.Run(new fBiblioteca());
19+
Application.Run(new FBiblioteca());
2020
}
2121
}
2222
}

bin/Debug/Lab#6.exe

0 Bytes
Binary file not shown.

bin/Debug/Lab#6.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)