private void button_annuler_Click(object sender, EventArgs e) { Recherche_Commerciaux rc = new Recherche_Commerciaux(); rc.Show(this); this.Hide(); }
private void button_valider_Click_1(object sender, EventArgs e) { string nomBase = "IMMOBILLY_JACKYTEAM"; 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 Commercial set NOM = '" + textBox1_Nom.Text.Replace("'", "''") + "', PRENOM = '" + textBox1_Prenom.Text.Replace("'", "''") + "', TELEPHONE_FIXE_PRO = '" + textBox1_FixePro.Text + "', TELEPHONE_PORTABLE_PRO = '" + textBox1_MobilePro.Text + "' , TELEPHONE_PRIVE = '" + textBox1_Tel_Prive.Text + "', EMAIL = '" + textBox1_Email.Text + "', STATUT ='" + comboBox1.Text + "' where NUM_COMMERCIAL = '" + textBox1_numCom.Text + "' "; OleDbCommand cmd = new OleDbCommand(sql, dbConnection); cmd.ExecuteNonQuery(); MessageBox.Show("Saved"); Recherche_Commerciaux rc = new Recherche_Commerciaux(); rc.Show(this); this.Hide(); }
private void button1_ajouter_Click(object sender, EventArgs e) { //string nomBase = "IMMOBILLY_JACKYTEAM"; 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 Commercial (Nom, Prenom, Telephone_Fixe_Pro, Telephone_Portable_Pro, Telephone_Prive, Email, Statut) "; string sql2 = "values('" + textBox1_Nom.Text.Replace("'", "''") + "','" + textBox1_Prenom.Text.Replace("'", "''") + "','" + textBox1_FixePro.Text + "','" + textBox1_MobilePro.Text + "','" + textBox1_Tel_Prive.Text + "','" + textBox1_Email.Text + "','ACTIF') "; string sql = sql1 + sql2; OleDbCommand cmd = new OleDbCommand(sql, dbConnection); cmd.ExecuteNonQuery(); MessageBox.Show("Saved"); Recherche_Commerciaux rc = new Recherche_Commerciaux(); rc.Show(this); this.Hide(); }