00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __ML_ALLOC_ITEM_H
00021 #define __ML_ALLOC_ITEM_H
00022
00023
00024 #include "RootItem.h"
00025 #include "ModLecAlloc.h"
00026
00027 class MLAllocItem : public RootItem
00028 {
00029 public:
00030 enum Columns {COL_MODULE =0, COL_LECTURER, COL_HOURS, COL_SEMESTER
00031 ,COL_CLASS_SIZE, COL_GROUPS, COL_LAB_HOURS, COL_LAB_GROUPS};
00032 public:
00033 MLAllocItem(ModLecAlloc * MLAllocObj, RootItem *parent = 0, int cc =0);
00034 MLAllocItem(MLAllocItem & mlai);
00035 ~MLAllocItem(){};
00036
00037 inline virtual ModLecAlloc * getItemData()const {return static_cast<ModLecAlloc * >(itemData);}
00038 Module * getModule();
00039 inline QString getDescription() const{return itemData->getDescription();}
00040 inline QString getModuleDesc() const{return getItemData()->getModuleDesc();}
00041 inline QString getLecturerDesc() const{return getItemData()->getLecturerDesc();}
00042 inline QString getHoursDesc() const{return getItemData()->getHoursDesc();}
00043 inline QString getSemesterDesc() const{return getItemData()->getSemesterDesc();}
00044 inline QString getClassSizeDesc() const{return getItemData()->getClassSizeDesc();}
00045 inline QString getGroupsDesc() const{return getItemData()->getGroupsDesc();}
00046 inline QString getLabHoursDesc() const{return getItemData()->getLabHoursDesc();}
00047 inline QString getLabGroupsDesc() const{return getItemData()->getLabGroupsDesc();}
00048 QVariant data(int column) const;
00049
00050 virtual bool setData(int, const QVariant &) {return true;}
00051 inline void updateClassSize(int classSize);
00052 inline void updateGroups(int groups);
00053 inline void updateLabHours(int labHours);
00054 inline void updateLabGroups(int labGroups);
00055
00056 inline void dbSave();
00057 inline void dbDelete();
00058 };
00059
00060 inline void MLAllocItem::dbSave()
00061 { getItemData()->save(ModLecAlloc::insertSQL, ModLecAlloc::updateSQL, ModLecAlloc::errorSQL);}
00062
00063 inline void MLAllocItem::dbDelete()
00064 { getItemData()->remove(ModLecAlloc::deleteSQL, ModLecAlloc::errorSQL);}
00065
00066
00067 inline void MLAllocItem::updateClassSize(int classSize)
00068 { getItemData()->updateClassSizeonDB(classSize);}
00069
00070 inline void MLAllocItem::updateGroups(int groups)
00071 { getItemData()->updateGroupsonDB(groups);}
00072
00073 inline void MLAllocItem::updateLabHours(int labHours)
00074 { getItemData()->updateLabHoursonDB(labHours);}
00075
00076 inline void MLAllocItem::updateLabGroups(int labGroups)
00077 { getItemData()->updateLabGroupsonDB(labGroups);}
00078
00079 #endif