Exemple #1
0
        public bool modifica()
        {
            bool esito = false;

            sql = "UPDATE Prestiti " +
                  "SET " +
                  "CodLettorePrestito = '" + _codLettore + "', " +
                  "CodLibroPrestito = '" + _codLibro + "', " +
                  "DataPrestito = '" + _dataPrestito.ToString("MM/dd/yyyy") + "', " +
                  "DataResPrestito = '" + _dataRest.ToString("MM/dd/yyyy") + "', " +
                  "ValPrestito = '" + _val + "' " +
                  "WHERE CodPrestito = '" + _codice + "' ";
            try
            {
                sqlPrestito.eseguiNonQuery(sql, CommandType.Text);
                esito = true;
                MessageBox.Show("Prestito modificato con successo.");
            }
            catch (Exception e)
            {
                MessageBox.Show("Attenzione [MODIFICA]!!" + e.Message);
            }

            return(esito);
        }
Exemple #2
0
        /***********************************************/
        /* Modifica i dati dell'inquinante selezionato */
        /***********************************************/
        public bool modifica()
        {
            bool esito = false;

            // Imposto SQL per modificare l'inquinante
            sql = "UPDATE Inquinanti " +
                  "SET " +
                  "NominativoUtente = '" + _nominativo + "', " +
                  "TipoUtente = " + _tipo + ", " +
                  "UserIDUtente = '" + _userID + "', " +
                  "PwdUtente = '" + _password + "', " +
                  "ValUtente = '" + _val + "' " +
                  "WHERE CodUtente = '" + _codice + "' ";
            try
            {
                sqlUtente.eseguiNonQuery(sql, CommandType.Text);
                esito = true;
                MessageBox.Show("Utente modificato con successo.");
            }
            catch (Exception e)
            {
                MessageBox.Show("Attenzione !!" + e.Message);
            }

            return(esito);
        }
Exemple #3
0
        /***********************************************/
        /* Modifica i dati dell'inquinante selezionato */
        /***********************************************/
        public bool modifica()
        {
            bool esito = false;

            // Imposto SQL per modificare l'inquinante
            sql = "UPDATE Lettori " +
                  "SET " +
                  "NomeLettore = '" + _nome + "', " +
                  "CognomeLettore = '" + _cognome + "', " +
                  "NTesseraLettore = '" + _nTessera + "', " +
                  "MailLettore = '" + _mail + "', " +
                  "ValLettore = '" + _val + "' " +
                  "WHERE CodLettore = '" + _codice + "' ";
            try
            {
                sqlLettore.eseguiNonQuery(sql, CommandType.Text);
                esito = true;
                MessageBox.Show("Lettore modificato con successo.");
            }
            catch (Exception e)
            {
                MessageBox.Show("Attenzione !!" + e.Message);
            }

            return(esito);
        }
Exemple #4
0
 public void aggiornaPrestito(char prestato)
 {
     sql = "UPDATE Libri " +
           "SET " +
           " InPrestitoLibro = '" + prestato + "' " +
           "WHERE CodLibro = '" + _codice + "' ";
     try
     {
         sqlLibro.eseguiNonQuery(sql, CommandType.Text);
         //MessageBox.Show("Libro modificato con successo.");
     }
     catch (Exception e)
     {
         MessageBox.Show("Attenzione !!" + e.Message);
     }
 }
Exemple #5
0
        /***********************************************/
        /* Modifica i dati dell'inquinante selezionato */
        /***********************************************/
        public bool modifica()
        {
            bool esito = false;

            // Imposto SQL per modificare l'inquinante
            sql = "UPDATE Inquinanti " +
                  "SET " +
                  "NomeGenere = " + _nome + ", " +
                  "ValGenere = '" + _val + "' " +
                  "WHERE CodGenere = '" + _codice + "' ";
            try
            {
                sqlGenere.eseguiNonQuery(sql, CommandType.Text);
                esito = true;
                MessageBox.Show("Genere modificato con successo.");
            }
            catch (Exception e)
            {
                MessageBox.Show("Attenzione !!" + e.Message);
            }

            return(esito);
        }