예제 #1
0
        public void InsertIntoUpdate(string tabelle, string tabelle_id, string objekt_id)
        {
            int unix_zeitpunkt = 0;

            MEQuery.Datum time = new MEQuery.Datum();
            unix_zeitpunkt = time.unix();

            List <string> columnNames = GetColumnNames("cfy_update");

            string query = "INSERT INTO cfy_update (" +
                           columnNames[0] + "," +
                           columnNames[1] + "," +
                           columnNames[2] + "," +
                           columnNames[3] + ") " +
                           "VALUES ('" +
                           tabelle + "','" +
                           tabelle_id + "','" +
                           objekt_id + "','" +
                           unix_zeitpunkt + "');";

            try {
                if (OpenConnection() == true)
                {
                    MySqlCommand cmd = new MySqlCommand(query, connection);
                    //Execute
                    cmd.ExecuteNonQuery();
                    //Close Connection
                    CloseConnection();
                }
            } catch (MySqlException ex) {
                Console.WriteLine("MySQL Fehler: " + ex.Number);
            }
        }
예제 #2
0
        public void InsertUpdateTimeIntoDaten(string objekt_id)
        {
            int unix_zeitpunkt = 0;

            MEQuery.Datum time = new MEQuery.Datum();
            unix_zeitpunkt = time.unix();

            string query = "UPDATE cfy_daten SET unix_update = '" + unix_zeitpunkt + "' where objekt_id like '" + objekt_id + "';";

            try {
                if (OpenConnection() == true)
                {
                    MySqlCommand cmd = new MySqlCommand(query, connection);
                    //Execute
                    cmd.ExecuteNonQuery();
                    //Close Connection
                    CloseConnection();
                }
            } catch (MySqlException ex) {
                Console.WriteLine("MySQL Fehler: " + ex.Number);
            }
        }