Skip to content

Commit

Permalink
search mod
Browse files Browse the repository at this point in the history
  • Loading branch information
medamaz committed Jun 9, 2022
1 parent 3633af4 commit 6de2902
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 136 deletions.
16 changes: 4 additions & 12 deletions Gestion d'une médiathéque/Adherent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ namespace Gestion_d_une_médiathéque
{
public class Adherent
{



int num;
string nom;
string prenom;
string adress;
string email;

public Adherent()
{
}
Expand Down Expand Up @@ -69,8 +65,7 @@ public static DataTable afficherAdherent()

public static void ajouterAdherent(params Adherent[] ad)
{
string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";
SqlConnection cn = new SqlConnection();
string cinstr = Program.cinstr; SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();

foreach (Adherent a in ad)
Expand Down Expand Up @@ -102,8 +97,7 @@ public static void ajouterAdherent(params Adherent[] ad)

public static void supprimerAdherent(int id)
{
string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";
SqlConnection cn = new SqlConnection();
string cinstr = Program.cinstr; SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
try
{
Expand All @@ -128,8 +122,7 @@ public static void supprimerAdherent(int id)

public static void modifierAdherent(int id,Adherent a)
{
string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";
SqlConnection cn = new SqlConnection();
string cinstr = Program.cinstr; SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();


Expand Down Expand Up @@ -159,8 +152,7 @@ public static void modifierAdherent(int id,Adherent a)

public static Adherent rechercherAdherent(int id)
{
string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";

string cinstr = Program.cinstr;
try
{
Adherent ad = new Adherent();
Expand Down
2 changes: 1 addition & 1 deletion Gestion d'une médiathéque/GestionPrets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Gestion_d_une_médiathéque
public class GestionPrets
{

string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";
string cinstr = Program.cinstr;
SqlConnection cn = new SqlConnection();
SqlCommand cmd = new SqlCommand();

Expand Down
7 changes: 5 additions & 2 deletions Gestion d'une médiathéque/GsOeuvres.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ private void GsOeuvres_FormClosing(object sender, FormClosingEventArgs e)

private void button1_Click(object sender, EventArgs e)
{
s.ajouterOeuvres(textBox1.Text, textBox2.Text, textBox3.Text, (int)numericUpDown1.Value, comboBox2.SelectedItem.ToString());
dataGridView1.DataSource = Support.afficherOeuvres();
if(textBox1.Text!=""&& textBox3.Text != "" && textBox2.Text != "")
{
s.ajouterOeuvres(textBox1.Text, textBox2.Text, textBox3.Text, (int)numericUpDown1.Value, comboBox2.SelectedItem.ToString());
dataGridView1.DataSource = Support.afficherOeuvres();
}
}

private void button2_Click(object sender, EventArgs e)
Expand Down
4 changes: 3 additions & 1 deletion Gestion d'une médiathéque/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

namespace Gestion_d_une_médiathéque
{
internal static class Program

public static class Program
{
public static string cinstr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\moami\source\repos\DB\GestionMediatheque.mdf;Integrated Security = True";
/// <summary>
/// The main entry point for the application.
/// </summary>
Expand Down
Loading

0 comments on commit 6de2902

Please sign in to comment.