This repository was archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIService1.cs
248 lines (177 loc) · 7.93 KB
/
IService1.cs
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
using MyDBService.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace MyDBService
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(int value);
[OperationContract]
CompositeType GetDataUsingDataContract(CompositeType composite);
[OperationContract]
int CreateAccount(string username, string email, string contactno, string passwordhash, string passwordsalt, string usertype, string verificationcode, string accountstatus, string resetpasswordcode, DateTime expirycode);
[OperationContract]
int CreatePromotion(string name, string overview, string promotionimage, DateTime expirydate, double minimumspend, string code, string promotionstatus, int discount);
[OperationContract]
int CreatePayment(double cardnumber, int cvv, string date);
[OperationContract]
int CreateCart(int quantity, double totalprice, string username, string time, double price, string name, string desc, string image);
[OperationContract]
List<Account> GetAllAccount();
[OperationContract]
List<Account> GetAllDeletedAccount();
[OperationContract]
List<Account> GetAllStaffAccount();
[OperationContract]
List<Account> GetAllCustomerAccount();
[OperationContract]
List<Account> GetAllAccountBySearch(string word);
[OperationContract]
List<Promotion> GetAllPromotion();
[OperationContract]
List<Promotion> GetAllPromotionsByPromotionStatus(string promotionstatus);
[OperationContract]
List<Promotion> GetAllAvailablePromotions();
[OperationContract]
List<Promotion> GetAllExpiredPromotion();
[OperationContract]
List<Promotion> GetAllPromotionBySearch(string word);
[OperationContract]
List<Activity> GetAllActivity();
[OperationContract]
List<Cart> GetAllCart(string username);
[OperationContract]
Account GetAccountByUsername(string username);
[OperationContract]
Account GetAccountByEmail(string email);
[OperationContract]
Account GetAccountByEmailAndUsername(string username, string email);
[OperationContract]
Account GetAccountDetail(string username);
[OperationContract]
Promotion GetPromotionByName(string name);
// TODO: Add your service operations here
[OperationContract]
Activity SelectById(int id);
[OperationContract]
List<Activity> SelectBySearch(string word);
[OperationContract]
int UpdateAccountDetails(string username, string email, string contactno);
[OperationContract]
int UpdateEmail(string username, string email);
[OperationContract]
int UpdateUserTypeAndAccountStatus(string username, string usertype,string accountstatus);
[OperationContract]
int UpdateContact(string username, string contactno);
[OperationContract]
int UpdateAccountPassword(string username, string passwordhash);
[OperationContract]
int UpdateAccountPasswordByEmail(string email, string passwordhash);
[OperationContract]
int UpdateUserType(string username, string usertype);
[OperationContract]
int UpdateResetPasswordCode(string email, string resetpasswordcode);
[OperationContract]
int UpdateVerificationCode(string username, string verificationcode);
[OperationContract]
int UpdateExpiryCode(string username, DateTime expirycode);
[OperationContract]
int UpdateAccountStatus(string username, string accountstatus);
[OperationContract]
int UpdateCode(string name, string code);
[OperationContract]
int UpdatePromotionStatus(string name, string promotionstatus);
[OperationContract]
int UpdatePromotionStatusAndCode(string name, string code, string promotionstatus);
[OperationContract]
int UpdatePromotionDetails(string name, string overview, string promotionimage, DateTime expirydate, double minimumspend, string code, string promotionstatus, int discount);
//Uwais Alqarni
[OperationContract]
List<Post> GetAllPost();
[OperationContract]
List<Post> GetAllPostStaff();
[OperationContract]
int CreatePost(string title, string image, string type, string location, string description, string username, string userReported, string bookmarkedBy, double latitude, double longtitude);
[OperationContract]
int UpdatePost(int PostID, string title, string image, string type, string location, string description, Boolean bookmark);
[OperationContract]
Post GetAPost(int postID);
[OperationContract]
List<Post> GetPostByUsername(string username);
[OperationContract]
int DeletePost(int postID);
[OperationContract]
int UpdateBookmark(int postID, Boolean bookmark);
[OperationContract]
Boolean GetBookmark(int postID);
[OperationContract]
int UpdateReport(int postID, int report);
[OperationContract]
int GetReport(int postID);
[OperationContract]
int UpdateUserReported(int postID, string userReported);
[OperationContract]
string GetUserReported(int postID);
[OperationContract]
int UpdateBookmarkedBy(int postID, string bookmarkedBy);
[OperationContract]
string GetBookmarkedBy(int postID);
[OperationContract]
List<Post> GetAllBookmark(string username);
//Yongsheng
[OperationContract]
int CreateActivity(string duration, double price, string details, string tag, string activityname, string image);
[OperationContract]
int UpdateActivity(int id, string duration, double price, string details, string tag, string activityname, string image);
[OperationContract]
int DeleteActivity(int id);
[OperationContract]
int DeleteCart(int id);
[OperationContract]
List<Activity> SelectByTag(string word);
//Mengxi
[OperationContract]
int CreatePlan(string timecreated, string username, string planname);
[OperationContract]
List<Plan> GetPlanByUsername(string username);
[OperationContract]
int UpdatePlanname(int planid, string planname);
[OperationContract]
int DeletePlan(int planid);
[OperationContract]
int AddToPlan( string activityname, string date, string booked, string qty, double unitprice, double totalprice, string planid, string image, string duration, string desc, string tag);
[OperationContract]
List<PlanActivity> GetActivitesByPlan(string planid);
[OperationContract]
int UpdatePlanActivity(int id, string date, string qty, double totalprice);
[OperationContract]
int DeletePlanActivity(int id);
}
// Use a data contract as illustrated in the sample below to add composite types to service operations.
// You can add XSD files into the project. After building the project, you can directly use the data types defined there, with the namespace "MyDBService.ContractType".
[DataContract]
public class CompositeType
{
bool boolValue = true;
string stringValue = "Hello ";
[DataMember]
public bool BoolValue
{
get { return boolValue; }
set { boolValue = value; }
}
[DataMember]
public string StringValue
{
get { return stringValue; }
set { stringValue = value; }
}
}
}