-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLCustomer.cpp
47 lines (34 loc) · 1.17 KB
/
CLCustomer.cpp
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
#include "CLCustomer.h"
namespace NS_Models
{
Customer::Customer() {
//this->birth_date = "default";
this->id = 0;
this->first_name = "";
this->last_name = "";
}
void Customer::setCustomer_Birth_Date(DateTime _birth_date) {
this->birth_date = _birth_date;
}
DateTime Customer::getBirth_date(void) {
return this->birth_date;
}
String^ Customer::INSERT(void) {
return "EXECUTE InsertCustomer @last_name_c = '" + getLast_name() + "', @first_name_c = '" + getFirst_name() + "', @birth_date = '" + getBirth_date() + "'";
}
String^ Customer::SELECT(void) {
if (getLast_name() != "" && getFirst_name() != "") {
return "EXECUTE getPersonWithBillingAddress @last_name_c = '" + getLast_name() + "', @first_name_c = '" + getFirst_name() + "'";
}
else
{
return "EXECUTE SelectCustomers";
}
}
String^ Customer::UPDATE(void) {
return "EXECUTE UpdateCustomer @last_name_c = '" + getLast_name() + "', @first_name_c = '" + getFirst_name() + "', @birth_date = '" + getBirth_date() + "', @person_id = " + getId();
}
String^ Customer::DELETE(void) {
return "EXECUTE DeleteCustomer @customer_id = " + getId();
}
}