예제 #1
0
        public static int AjouterRappelEnvoisms(envoisms rap)
        {
            try
            {
                Connexion con = new Connexion();
                con.OpenConnection();

                string       req = "INSERT INTO envoisms(identreprise, date, heure, numtel, nom, prenom, poste, reponse, tel1, note1, tel2, note2, etat, notegenerale) VALUES (" + rap.IDENTREPRISE + ",'" + rap.DATE + "','" + rap.HEURE + "','" + rap.NUMTEL + "','" + rap.NOM + "','" + rap.PRENOM + "','" + rap.POSTE + "','" + rap.REPONSE + "','" + rap.TEL1 + "','" + rap.NOTE1 + "','" + rap.TEL2 + "','" + rap.NOTE2 + "','" + rap.ETAT + "','" + rap.NOTEGENERALE + "')";
                MySqlCommand cmd = new MySqlCommand(req, con.connexion);
                cmd.ExecuteNonQuery();
                con.CloseConnection();
                return(1);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(0);
            }
        }
예제 #2
0
        public static int ModifierRappelEnvoisms(envoisms rap, int idd)
        {
            try
            {
                Connexion con = new Connexion();
                con.OpenConnection();

                string       req = "UPDATE envoisms SET identreprise =" + rap.IDENTREPRISE + ", date='" + rap.DATE + "', heure='" + rap.HEURE + "',numtel='" + rap.NUMTEL + "',nom='" + rap.NOM + "',prenom='" + rap.PRENOM + "',poste='" + rap.POSTE + "',reponse='" + rap.REPONSE + "',tel1='" + rap.TEL1 + "',note1='" + rap.NOTE1 + "',tel2='" + rap.TEL2 + "',note2='" + rap.NOTE2 + "',etat='" + rap.ETAT + "',notegenerale='" + rap.NOTEGENERALE + "'   WHERE id=" + idd + " ";
                MySqlCommand cmd = new MySqlCommand(req, con.connexion);
                cmd.ExecuteNonQuery();
                con.CloseConnection();
                return(1);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(0);
            }
        }