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

Staff.cpp

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 #include "Staff.h"
00021 
00022 int Staff::insertSQL = 0;
00023 int Staff::updateSQL = 0;
00024 int Staff::deleteSQL = 0;
00025 
00026 int Staff::errorSQL = 0;
00027 
00028 void Staff::PrepareSQL(sql * dbConn)
00029 {
00030         if (dbConn != 0)
00031         {
00032                 insertSQL = dbConn->prepare("basic.staff_insert",3,*dbConn->useModuleConn());
00033                 updateSQL = dbConn->prepare("basic.staff_update",4,*dbConn->useModuleConn());
00034                 deleteSQL = dbConn->prepare("basic.staff_delete",1,*dbConn->useModuleConn());
00035                 
00036                 errorSQL = dbConn->prepare("basic.staff_error",1,*dbConn->useModuleConn());
00037         }
00038 }
00039 
00040 Staff::Staff()
00041 :DataClass()
00042 {
00043         fName = "";
00044         lName = "";
00045         p_rtti = STAFF_CLASS;
00046 }
00047 
00048 Staff::Staff(int pID, QString pFName, QString pLName, Department * pParent)
00049 :DataClass(pID)
00050 {
00051         fName = pFName;
00052         lName = pLName;
00053         parent = pParent;
00054         p_rtti = STAFF_CLASS;
00055 }
00056 
00057 void Staff::bindValues(int preparedSQL, int start)
00058 {
00059         sql::Instance()->bind(start,fName,preparedSQL);
00060         sql::Instance()->bind(++start,lName);
00061         sql::Instance()->bind(++start,getDeptID());
00062 }

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