public Boolean modifierOuvrague(String codeOuvrague, Ouvrague ouvrague) { try { cnx.Open(); MySqlCommand modifierOuvrague = cnx.CreateCommand(); modifierOuvrague.CommandText = RequeteOuvrague.modifierOuvrague(); modifierOuvrague.Parameters.Add("@cd", MySqlDbType.VarChar).Value = ouvrague.Code; modifierOuvrague.Parameters.Add("@to", MySqlDbType.VarChar).Value = ouvrague.TypeOuvrague; modifierOuvrague.Parameters.Add("@thm", MySqlDbType.VarChar).Value = ouvrague.Theme; modifierOuvrague.Parameters.Add("@atr", MySqlDbType.VarChar).Value = ouvrague.Auteur; modifierOuvrague.Parameters.Add("@ttr", MySqlDbType.VarChar).Value = ouvrague.Titre; modifierOuvrague.Parameters.Add("@cdP", MySqlDbType.VarChar).Value = codeOuvrague; modifierOuvrague.ExecuteNonQuery(); return(true); } catch (Exception e) { return(false); } finally { cnx.Dispose(); } }
private void bunifuCustomTextbox1_TextChanged(object sender, EventArgs e) { if (cherhcerOuvrage.TextLength > 0) { String cle = cherhcerOuvrage.Text; Ouvrague[] ouvragues = MainUI.sbo.chercherOuvrague(cle); DataTable dt = new DataTable(); for (int i = 1; i < 7; i++) { dt.Columns.Add("" + i + ""); } for (int i = 0; i < ouvragues.Length; i++) { DataRow row = dt.NewRow(); Ouvrague o = ouvragues[i]; row["1"] = o.Code; row["2"] = o.TypeOuvrague; row["3"] = o.Theme; row["4"] = o.Auteur; row["5"] = o.Titre; row["6"] = o.Etat; dt.Rows.Add(row); } BindingSource bd = new BindingSource(); bd.DataSource = dt; GridOuvrage.DataSource = bd; } }
private void add_Click(object sender, EventArgs e) { if (code.TextLength > 0 && type.TextLength > 0 && theme.TextLength > 0 && auteur.TextLength > 0 && titreO.TextLength > 0) { Ouvrague o = new Ouvrague(); o.Code = code.Text; o.Theme = theme.Text; o.Titre = titreO.Text; o.Auteur = auteur.Text; o.TypeOuvrague = type.Text; Boolean result = MainUI.sbo.ajouterOuvrague(o); if (result) { this.Close(); } else { MessageBox.Show("Operation echoé"); } } else { MessageBox.Show("Champs non Remplit"); } }
private void set_Click(object sender, EventArgs e) { Ouvrague o = new Ouvrague(); int rowIndex = GridOuvrage.SelectedCells[0].RowIndex; o.Code = GridOuvrage.Rows[rowIndex].Cells[0].Value.ToString(); o.TypeOuvrague = GridOuvrage.Rows[rowIndex].Cells[1].Value.ToString(); o.Theme = GridOuvrage.Rows[rowIndex].Cells[2].Value.ToString(); o.Auteur = GridOuvrage.Rows[rowIndex].Cells[4].Value.ToString(); o.Titre = GridOuvrage.Rows[rowIndex].Cells[3].Value.ToString(); ModifierOuvrage.o = o; ModifierOuvrage mo = new ModifierOuvrage(); mo.ShowDialog(this); }
public String[] rendreOuvrague(Ouvrague ouvrague, int numEmprente) { List <String> listEmail = new List <String>(); try { cnx.Open(); MySqlTransaction tran = cnx.BeginTransaction(); MySqlCommand dispoOuvrague = cnx.CreateCommand(); dispoOuvrague.Transaction = tran; dispoOuvrague.CommandText = RequeteOuvrague.etatDispoOuvrague(); dispoOuvrague.Parameters.Add("@cd", MySqlDbType.VarChar).Value = ouvrague.Code; dispoOuvrague.ExecuteNonQuery(); MySqlCommand rendreOuvrague = cnx.CreateCommand(); rendreOuvrague.Transaction = tran; rendreOuvrague.CommandText = RequeteOuvrague.terminerEmprente(); rendreOuvrague.Parameters.Add("@nmsq", MySqlDbType.VarChar).Value = numEmprente; rendreOuvrague.ExecuteNonQuery(); tran.Commit(); return(listEmailAttente(ouvrague.Code)); } catch (Exception e) { Console.WriteLine(e.Message + "-----" + e.StackTrace); return(null); } finally { cnx.Dispose(); } }
public bool reserverOuvrague(String nomUtilisateur, Ouvrague o) { return(sro.sco.reserverOuvrague(nomUtilisateur, o.Code)); }
public bool reserverOuvrague(Compte compte, Ouvrague o) { return(sro.sco.reserverOuvrague(compte, o.Code)); }
public bool attendreOuvrague(Compte compte, Ouvrague o) { return(sro.sco.attendreOuvrague(compte, o.Code)); }