private void Visualiser_Click(object sender, EventArgs e) { visualiser_acheteur va = new visualiser_acheteur(); va.Show(this); this.Hide(); }
private void button2_MouseClick(object sender, MouseEventArgs e) { visualiser_acheteur va = new visualiser_acheteur(); va.Show(this); this.Hide(); }
private void button1_MouseClick(object sender, MouseEventArgs e) { string ChaineBd = "Provider=SQLOLEDB;Data Source=INFO-joyeux;Initial Catalog=IMMOBILLY_JACKYTEAM;Persist Security Info=True; Integrated Security=sspi;"; OleDbConnection dbConnection = new OleDbConnection(ChaineBd); dbConnection.Open(); string sql = "UPDATE ACHETEUR set Nom_Acheteur = '" + textBox_Nom.Text.Replace("'", "''") + "', Prénom_Acheteur = '" + textBox_Prénom.Text.Replace("'", "''") + "', Adresse = '" + textBox_Adresse.Text.Replace("'", "''") + "', Téléphone = '" + textBox_tel.Text + "' where Num_Acheteur = '" + ApplicationState.id_acheteur + "' "; OleDbCommand cmd = new OleDbCommand(sql, dbConnection); cmd.ExecuteNonQuery(); MessageBox.Show("Saved"); visualiser_acheteur va = new visualiser_acheteur(); va.Show(this); this.Hide(); }
private void Validation_Creation_Souhait(object sender, EventArgs e) { string ChaineBd = "Provider=SQLOLEDB;Data Source=INFO-joyeux;Initial Catalog=IMMOBILLY_JACKYTEAM;Persist Security Info=True; Integrated Security=sspi;"; OleDbConnection dbConnection = new OleDbConnection(ChaineBd); dbConnection.Open(); string sql1 = "INSERT Into Souhait(NUM_ACHETEUR, SURFACE_HABITABLE_min, SURFACE_PARCELLE_min, NB_PIECES_min, Prix_max, STATUT, CODE_VILLE)"; string sql2 = " VALUES('" + ApplicationState.id_acheteur + "', '" + textBox_SurfaceHabitable.Text + "','" + textBox_SurfaceParcelle.Text + "','" + nbPieces.Text + "','" + textBox_Prix.Text + "','EN COURS', (SELECT v.code_ville from VILLE v where v.NOM_VILLE like '" + textBox_Ville.Text + "' and v.CODE_POSTAL like '" + textBox_CP.Text + "') )"; string sql = sql1 + sql2; OleDbCommand cmd = new OleDbCommand(sql, dbConnection); cmd.ExecuteNonQuery(); MessageBox.Show("Saved"); visualiser_acheteur va = new visualiser_acheteur(); va.Show(this); this.Hide(); }