Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

Faculty.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Graeme Foster                                   *
00003  *   email    foster.graeme@gmail.com                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef __FACULTY_H
00022 #define __FACULTY_H
00023 
00024 #include "DataClass.h"
00025 #include "Institute.h"
00026 
00027 class Faculty : public DataClass
00028 {
00029 private:
00030         QString name;
00031         QString abbrev;
00032         
00033 protected: // Properties
00034         friend class FacItem;
00035         static int selectSQL;
00036         static int insertSQL;
00037         static int updateSQL;
00038         static int deleteSQL;
00039         static int uniqueNameSQL;
00040         static int uniqueAbbrevSQL;
00041         static int errorSQL;
00042 
00043 public: // Constructor
00044         Faculty();
00045         Faculty(int pID, QString name, QString abbrev, Institute * parent);
00046         static void PrepareSQL(sql * dbConn);
00047         
00048         // Get Methods
00049         inline QString getDescription()const{return getName();}
00050         inline QString getName()const{return name;}
00051         inline QString getAbbrev()const{return abbrev;}
00052         inline Institute * getInstitute()const {return static_cast<Institute *>(parent);}
00053         inline QString getInstName()const;
00054         inline int getInstID(){return getParentID();}
00055         // Set Methods
00056         inline bool setName(QString pName){name = pName; return true;}
00057         inline bool setAbbrev(QString pAbbrev){abbrev = pAbbrev; return true;}
00058         // Methods to determine if a field is unique
00059         static bool uniqueName(QString name, int id);
00060         static bool uniqueAbbrev(QString abbrev, int id);
00061 protected:
00062         void bindValues(int preparedSQL, int start);
00063 };
00064 
00065 inline QString Faculty::getInstName()const
00066 {
00067         if (parent!= 0)
00068                 return getInstitute()->getName();
00069         else
00070                 return QString();
00071 }
00072 
00073 #endif

Generated on Thu Apr 6 16:27:16 2006 for time-table by  doxygen 1.4.4