6 |
|
|
7 |
#include "DatabaseLayer.h" |
#include "DatabaseLayer.h" |
8 |
#include "Containers.h" |
#include "Containers.h" |
9 |
|
#include "ConfigFile.h" |
10 |
#include <vector> |
#include <vector> |
11 |
|
|
12 |
using namespace std; |
using namespace std; |
13 |
|
|
14 |
class MySQLLayer : public DatabaseLayer |
class MySQLLayer : public DatabaseLayer |
15 |
{ |
{ |
|
private: |
|
|
CDatabase db; |
|
|
|
|
16 |
public: |
public: |
17 |
MySQLLayer(void); |
MySQLLayer(ConfigFile &config); |
18 |
~MySQLLayer(void); |
virtual ~MySQLLayer(void); |
19 |
|
|
20 |
vector<Person> GetPersonAll(void); |
|
21 |
Person GetPerson(CString wantInits); |
virtual vector<Equipment> Search(CString barcode, CString name, CString inits, bool available, bool reserved, bool deposited); |
22 |
|
protected: |
23 |
bool AddPerson(Person NewPerson); |
virtual CString GenerateQueryForLatestCheckouts(CString barcode); |
|
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<Equipment> GetEquipmentAll(void); |
|
|
Equipment GetEquipment(CString wantBarcode); |
|
|
bool DeleteEquipment(Equipment DelEquip); |
|
|
vector<Equipment> 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<Equipment> &buffer, CRecordset &rs); |
|
24 |
}; |
}; |