-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicket.h
70 lines (58 loc) · 1.76 KB
/
Ticket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef TICKET_H
#define TICKET_H
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <direct.h>
using namespace std;
struct Note
{
string note;
string date;
};
class Ticket
{
public:
Ticket(string customerName, string ticketID, string creationDate, string serialNumber, string modelNumber, bool isOpen, Note note);
virtual ~Ticket();
//File savers/readers
void saveToFile();
void readFromFile(string fileName);
void readFromCSV(string fileName);
//setters
void setCustomerName(string customerName);
void setTicketID(string ticketID);
void setCreationDate(string creationDate);
void setSerialNumber(string serialNumber);
void setModelNumber(string modelNumber);
void setIsOpen(bool isOpen);
//setters for notes
void clearNotes();
void addNote(Note note);
//getters
string getCustomerName();
string getTicketID();
string getCreationDate();
string getSerialNumber();
string getModelNumber();
bool getIsOpen();
//getters for notes
Note* getNotes();
Note getNoteAt(int index);
//Full text getter, used for saving to files
string getTicket();
protected:
private:
//variables
string customerName;
string ticketID;
string creationDate;
string serialNumber;
string modelNumber;
bool isOpen;
Note *notes; //Number of notes may change
int maximumNotes = 100; //Maximum notes on a ticket is 100
int noteIndex = 0; //Important for keeping track of notes
};
#endif // TICKET_H