-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReportChristmas.ascx.cs
325 lines (234 loc) · 8.98 KB
/
ReportChristmas.ascx.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Common.Utilities;
using GIBS.FBClients.Components;
using DotNetNuke.Services.Localization;
using DotNetNuke.Services.Exceptions;
using System.Text;
namespace GIBS.Modules.FBClients
{
public partial class ReportChristmas : PortalModuleBase
{
int clientId = Null.NullInteger;
protected void Page_Load(object sender, EventArgs e)
{
lblPrintDate.Text = "Generated: " + DateTime.Now.ToString("MM-dd-yyyy h:mmtt");
if (Request.QueryString["cid"] != null)
{
clientId = Int32.Parse(Request.QueryString["cid"]);
}
if (!IsPostBack)
{
FillAFMGrid();
FillClientRecord(clientId);
LoadSettings();
}
}
public void FillClientRecord(int clientID)
{
try
{
// lblMessage.Text = "";
//load the item
FBClientsController controller = new FBClientsController();
FBClientsInfo item = controller.FBClients_GetByID(this.PortalId, clientID);
if (item != null)
{
// Response.Write(item);
StringBuilder builder = new StringBuilder();
string ClientInfo = "";
string _phoneType = "";
if (item.ClientPhoneType == "0")
{
_phoneType = "";
}
else
{
_phoneType = item.ClientPhoneType + " ";
}
//Set Page Name
SetPageName("Christmas Toys Voucher for " + item.ClientFirstName + " " + item.ClientLastName);
// QUICK VIEW SECTION
ClientInfo = item.ClientFirstName + " " + item.ClientLastName + " - " + item.ClientAddress + ", " + item.ClientTown + ", " + item.ClientState + " " + item.ClientZipCode
+ "<br />" + _phoneType.ToString() + "Phone: " + item.ClientPhone
+ "<br />Entry Date: " + item.CreatedOnDate.ToShortDateString()
+ "<br /><font color='Red'>Client ID: " + item.ClientID + "</font>";
lblMessage.Text = ClientInfo.ToString();
}
else
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
public void SetPageName(string ClientName)
{
try
{
DotNetNuke.Framework.CDefault CustomPageName = (DotNetNuke.Framework.CDefault)this.Page;
CustomPageName.Title = ClientName.ToString();
// CustomPageName.KeyWords = vTitle.ToString() + "," + Settings["Keywords"].ToString();
// CustomPageName.Description = vTitle.ToString() + " " + Settings["PageTitle"].ToString() + ". " + Settings["PageDescription"].ToString();
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
public void LoadSettings()
{
try
{
string _ToyTicketContent = "";
FBClientsSettings settingsData = new FBClientsSettings(this.TabModuleId);
if (settingsData.ToyTicketContent != null)
{
_ToyTicketContent = settingsData.ToyTicketContent;
}
else
{
_ToyTicketContent = "<h1>We need content. Update Module Settings!</h1>";
}
LiteralToyTicketContent.Text = HttpUtility.HtmlDecode(_ToyTicketContent.ToString());
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
public void FillAFMGrid()
{
try
{
gvAFM.DataSource = "";
// gvAFM.DataBind();
List<FBClientsInfo> items;
FBClientsController controller = new FBClientsController();
items = controller.FBxMas_AFM_PrintTicket(clientId);
gvAFM.DataSource = items;
gvAFM.DataBind();
//bool _isValidBOB = true;
//bool _isVerified = true;
//foreach (GridViewRow tt in gvAFM.Rows)
//{
// if (tt.RowType == DataControlRowType.DataRow)
// {
// string age = tt.Cells[7].Text;
// if (age == "-1")
// {
// _isValidBOB = false;
// break;
// }
// }
//}
//foreach (GridViewRow vv in gvAFM.Rows)
//{
// if (vv.RowType == DataControlRowType.DataRow)
// {
// // gvAFM.Columns[7].Visible = true;
// string verify = vv.Cells[8].Text;
// if (verify.ToString().ToLower() == "false")
// {
// _isVerified = false;
// break;
// }
// }
//}
//gvAFM.Columns[8].Visible = false;
//if (_isValidBOB == false)
//{
// lblMessage.Text += "<br />" + Localization.GetString("ErrorNoDateOfBirthAFM", this.LocalResourceFile);
// lblMessage.Visible = true;
//}
//if (_isVerified == false)
//{
// lblMessage.Text += "<br />" + Localization.GetString("ErrorNoAFMVerify", this.LocalResourceFile);
// lblMessage.Visible = true;
//}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
protected void gvAFM_RowEditing(object sender, GridViewEditEventArgs e)
{
// Prevents the GridView from going into EDIT MODE (textboxes)
e.Cancel = true;
}
protected void gvAFM_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
// No requirement to implement code here
e.Cancel = true;
}
protected void gvAFM_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "Delete")
{
//int afmID = Convert.ToInt32(e.CommandArgument);
//FBClientsController controller = new FBClientsController();
//controller.FBClients_AFM_Delete(afmID);
////controller.FBClients_IncomeExpense_Delete(ieID);
////FillIncomeExpenseGrids();
//FillAFMGrid();
}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
protected void gvAFM_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
try
{
//FillAFMGrid();
//gvAFM.PageIndex = e.NewPageIndex;
//gvAFM.DataBind();
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
//gvAFM_OnDataBinding
protected void gvAFM_OnDataBinding(object sender, GridViewPageEventArgs e)
{
try
{
//bool _isValid = true;
//foreach (GridViewRow tt in gvAFM.Rows)
//{
// if (tt.RowType == DataControlRowType.DataRow)
// {
// string age = tt.Cells[6].Text;
// if (age == "-1")
// {
// _isValid = false;
// }
// }
//}
//if (_isValid == false)
//{
// lblMessage.Text += "<br />" + Localization.GetString("ErrorNoDateOfBirthAFM", this.LocalResourceFile);
// lblMessage.Visible = true;
//}
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
}
}