]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/room.h
room view added - need to test it
[toast/confclerk.git] / src / mvc / room.h
diff --git a/src/mvc/room.h b/src/mvc/room.h
new file mode 100644 (file)
index 0000000..037a3f2
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * room.h
+ *
+ *  Created on: Dec 27, 2009
+ *      Author: Pavol Korinek
+ */
+
+#ifndef ROOM_H_
+#define ROOM_H_
+
+#include <ormrecord.h>
+
+class Room : public OrmRecord<Room>
+{
+public:
+    static const QSqlRecord sColumns;
+    static QString const sTableName;
+    static const int sTableColCount;
+    static const QString NAME;
+public:
+    int id() const { return value("id").toInt(); }
+    void setId(int id) { setValue("id", id); }
+    QString name() const { return value("name").toString(); }
+    void setName(const QString & type) { setValue("name", type); }
+    int insert();
+public:
+    static QList<Room> getAll();
+    static Room retrieve(int id);
+    static QString retrieveRoomName(int id);
+    static Room retrieveByName(QString name);
+};
+
+#endif /* ROOM_H_ */