BmnRoot
Loading...
Searching...
No Matches
ElogContact.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// ElogContact header file
3// Generated 13-04-2026
4// ----------------------------------------------------------------------
5
10#ifndef ELOGCONTACT_H
11#define ELOGCONTACT_H 1
12
13#include "ElogConnection.h"
14#include "TDatime.h"
15#include "TString.h"
16#include "TTimeStamp.h"
17
19{
20 private:
21 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
23 ElogConnection* connectionDB;
24
26 int i_contact_id;
28 TString* str_contact_name;
30 TString str_contact_desc;
32 TString* str_phones;
34 TString* str_email;
35
36 // Constructor
37 ElogContact(ElogConnection* db_connect,
38 int contact_id,
39 TString* contact_name,
40 TString contact_desc,
41 TString* phones,
42 TString* email);
43 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
44
45 public:
46 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
47 virtual ~ElogContact(); // Destructor
48
49 // static class functions
51 static ElogContact* CreateContact(TString* contact_name, TString contact_desc, TString* phones, TString* email);
53 static ElogContact* GetContact(int contact_id);
55 static int CheckContactExists(int contact_id);
57 static int DeleteContact(int contact_id);
59 static int PrintAll();
60
61 // Getters
63 int GetContactId() { return i_contact_id; }
65 TString* GetContactName()
66 {
67 if (str_contact_name == nullptr)
68 return nullptr;
69 else
70 return new TString(*str_contact_name);
71 }
73 TString GetContactDesc() { return str_contact_desc; }
75 TString* GetPhones()
76 {
77 if (str_phones == nullptr)
78 return nullptr;
79 else
80 return new TString(*str_phones);
81 }
83 TString* GetEmail()
84 {
85 if (str_email == nullptr)
86 return nullptr;
87 else
88 return new TString(*str_email);
89 }
90
91 // Setters
93 int SetContactName(TString* contact_name);
95 int SetContactDesc(TString contact_desc);
97 int SetPhones(TString* phones);
99 int SetEmail(TString* email);
100
102 void Print();
103 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
104
106};
107
108#endif
int SetContactName(TString *contact_name)
set contact name of the current contact
static int PrintAll()
print all contacts
TString * GetContactName()
get contact name of the current contact
Definition ElogContact.h:65
TString * GetPhones()
get phones of the current contact
Definition ElogContact.h:75
static ElogContact * CreateContact(TString *contact_name, TString contact_desc, TString *phones, TString *email)
add new contact to the database
ClassDef(ElogContact, 1)
static ElogContact * GetContact(int contact_id)
get contact from the database
int SetPhones(TString *phones)
set phones of the current contact
int SetContactDesc(TString contact_desc)
set contact desc of the current contact
TString GetContactDesc()
get contact desc of the current contact
Definition ElogContact.h:73
int SetEmail(TString *email)
set email of the current contact
static int CheckContactExists(int contact_id)
check contact exists in the database: 1- true, 0 - false, <0 - database operation error
static int DeleteContact(int contact_id)
delete contact from the database
int GetContactId()
get contact id of the current contact
Definition ElogContact.h:63
void Print()
print information about current contact
TString * GetEmail()
get email of the current contact
Definition ElogContact.h:83
virtual ~ElogContact()