--- PostgresLayer.h 2006/09/06 18:40:35 43 +++ PostgresLayer.h 2007/10/22 13:00:14 60 @@ -6,37 +6,19 @@ #include "DatabaseLayer.h" #include "Containers.h" +#include "ConfigFile.h" #include using namespace std; class PostgresLayer : public DatabaseLayer { -private: - CDatabase db; - public: - PostgresLayer(void); - ~PostgresLayer(void); - - vector GetPersonAll(void); - Person GetPerson(CString wantInits); + PostgresLayer(ConfigFile &config); + virtual ~PostgresLayer(void); - bool AddPerson(Person NewPerson); - bool UpdatePerson(Person ChangePerson); - bool DeletePerson(Person RemovePerson); - bool ReturnEquipment(CString barcode); - bool CheckoutEquipment(Person CheckPersID, Equipment CheckEquip, int Numdays); - bool EquipmentReservation(CString barcode, Person CheckPerson); - bool UpdateEquipment(Equipment CheckEquip); - bool AddEquipment(Equipment AddEquip); - vector GetEquipmentAll(void); - Equipment GetEquipment(CString wantBarcode); - bool DeleteEquipment(Equipment DelEquip); - vector Search(CString barcode, CString name, CString inits, bool available, bool reserved, bool deposited); - void checkReservations(CString barcode); - bool DeleteReservation(CString barcode, CString resid); -private: - void FillEquipmentVector(vector &buffer, CRecordset &rs); + virtual vector Search(CString barcode, CString name, CString inits, bool available, bool reserved, bool deposited); +protected: + virtual CString GenerateQueryForLatestCheckouts(CString barcode); };