コード例 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand("valid_email_tele", cn.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@email", SqlDbType.VarChar).Value    = emailbox.Text;
            cmd.Parameters.Add("@tele", SqlDbType.VarChar).Value     = telebox.Text;
            cmd.Parameters.Add("@resultat", SqlDbType.Int).Direction = ParameterDirection.Output;

            cn.conn.Open();
            cmd.ExecuteNonQuery();
            cn.conn.Close();
            int resultat = int.Parse(cmd.Parameters["@resultat"].Value.ToString());

            if (resultat == 1)
            {
                MessageBox.Show("email format invalid");
            }
            else if (resultat == 2)
            {
                MessageBox.Show("numero de telephone format invalid");
            }
            else
            {
                if (cn.execute_query("Update Enseignant set nom_enseignant='" + nombox.Text + "',prenom_enseignant='" + prenombox.Text + "',ens_username='******',ens_password='******',email='" + emailbox.Text + "',portable='" + telebox.Text + "' where id_enseignant='" + idbox.Text + "'"))
                {
                    MessageBox.Show("Bien modifier");

                    refresh();
                }
            }
        }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (cn.execute_query("insert into Filiere values('" + filierebox.Text + "')"))
     {
         MessageBox.Show("Bien ajouter");
         refresh();
     }
 }
コード例 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (cn.execute_query("insert into Salle values('" + nombox.Text + "', '" + capacitebox.Text + "', '" + typebox.Text.ToString() + "')"))
     {
         MessageBox.Show("salle bien ajouter");
         refresh();
     }
 }
コード例 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Sure", "Etes-vous sûr de vouloir supprimer ? ", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                if (cn.execute_query("Delete ChefDpt where id_chef='" + idbox.Text + "'"))
                {
                    MessageBox.Show("Bien supprimer");
                    refresh();
                }
            }
        }