YAPOG  0.0.1
Yet Another Pokemon Online Game
AccountUpdateRequest.cpp
Go to the documentation of this file.
3 
4 namespace yse
5 {
7  : accountTable_ (accountTable)
8  {
9  }
10 
12  {
13  yap::String query_string =
14  "UPDATE account "
15  "SET account_name = :accountName, "
16  "account_password = :accountPassword, "
17  "account_email = :accountEmail, "
18  "account_permissions = :accountPermissions, "
19  "account_creation_date = : accountCreationDate, "
20  "account_last_login_date = :accountLastLoginDate, "
21  "account_creation_ip = :accountCreationIP "
22  "WHERE account_id = :accountID";
23 
24  yap::DatabaseStream query
25  (query_string, databaseManager.GetConnection ());
26 
27  query.Write (accountTable_.GetName ());
28  query.Write (accountTable_.GetPassword ());
29  query.Write (accountTable_.GetEmail ());
30  query.Write (static_cast<int> (accountTable_.GetPermissions ()));
31  query.Write (accountTable_.GetCreationDate ());
32  query.Write (accountTable_.GetLastLoginDate ());
33  query.Write (accountTable_.GetCreationIP ());
34  query.Write (accountTable_.GetID ().GetValue ());
35 
36  return true;
37  }
38 
40  (yap::DatabaseManager& databaseManager)
41  {
42  yap::String query_string =
43  "UPDATE account "
44  "SET account_last_login_date = :accountLastLoginDate "
45  "WHERE account_id = :accountID";
46 
47  yap::DatabaseStream query
48  (query_string, databaseManager.GetConnection ());
49 
50  query.Write (accountTable_.GetLastLoginDate ());
51  query.Write (accountTable_.GetID ().GetValue ());
52 
53  return true;
54  }
55 
56 } // namespace yse