예제 #1
0
파일: DataBase.cs 프로젝트: imto1/TimeSheet
        public void updatePerson(Personnel person)
        {
            string sql = "UPDATE personnel SET name = '" + person.getName() +
                         "', start = '" + person.getStart() +
                         "', work = " + person.getWork() +
                         ", rest = " + person.getRest() +
                         ", xp_id = " + person.getXpId() +
                         " WHERE id = " + person.getId() + ";";

            connection.Open();
            SQLiteCommand command = new SQLiteCommand(sql, connection);

            command.ExecuteNonQuery();
            connection.Close();
        }
예제 #2
0
파일: DataBase.cs 프로젝트: imto1/TimeSheet
        public void addPerson(Personnel person)
        {
            string sql = "INSERT INTO personnel (name, start, work, rest, xp_id) VALUES " +
                         "('" + person.getName() + "', '" +
                         person.getStart() + "', " +
                         person.getWork() + ", " +
                         person.getRest() + ", " +
                         person.getXpId() + ");";

            connection.Open();
            SQLiteCommand command = new SQLiteCommand(sql, connection);

            command.ExecuteNonQuery();
            connection.Close();
        }