Kaynağa Gözat

Hide reset to default button on print settings form.
Prevent viewing of PINs for unprinted vouchers.

Andrew Klopper 7 yıl önce
ebeveyn
işleme
23d421669a

+ 1 - 0
BulkPrinting/BulkPrinting/PrinterSettingsForm.Designer.cs

79
             this.resetButton.TabIndex = 5;
79
             this.resetButton.TabIndex = 5;
80
             this.resetButton.Text = "Reset to Default";
80
             this.resetButton.Text = "Reset to Default";
81
             this.resetButton.UseVisualStyleBackColor = false;
81
             this.resetButton.UseVisualStyleBackColor = false;
82
+            this.resetButton.Visible = false;
82
             this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
83
             this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
83
             // 
84
             // 
84
             // okButton
85
             // okButton

+ 1 - 1
BulkPrinting/BulkPrinting/Properties/AssemblyInfo.cs

33
 // by using the '*' as shown below:
33
 // by using the '*' as shown below:
34
 // [assembly: AssemblyVersion("1.0.*")]
34
 // [assembly: AssemblyVersion("1.0.*")]
35
 [assembly: AssemblyVersion("1.0.*")]
35
 [assembly: AssemblyVersion("1.0.*")]
36
-[assembly: AssemblyFileVersion("1.12")]
36
+[assembly: AssemblyFileVersion("1.13")]

+ 28 - 28
BulkPrinting/BulkPrinting/VoucherForm.Designer.cs

65
             this.dgvVouchers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
65
             this.dgvVouchers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
66
             this.dgvVouchers.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
66
             this.dgvVouchers.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
67
             this.dgvVouchers.Location = new System.Drawing.Point(16, 133);
67
             this.dgvVouchers.Location = new System.Drawing.Point(16, 133);
68
-            this.dgvVouchers.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
68
+            this.dgvVouchers.Margin = new System.Windows.Forms.Padding(4);
69
             this.dgvVouchers.MultiSelect = false;
69
             this.dgvVouchers.MultiSelect = false;
70
             this.dgvVouchers.Name = "dgvVouchers";
70
             this.dgvVouchers.Name = "dgvVouchers";
71
             this.dgvVouchers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
71
             this.dgvVouchers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
72
             this.dgvVouchers.Size = new System.Drawing.Size(939, 534);
72
             this.dgvVouchers.Size = new System.Drawing.Size(939, 534);
73
-            this.dgvVouchers.TabIndex = 5;
73
+            this.dgvVouchers.TabIndex = 10;
74
             this.dgvVouchers.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvVouchers_CellContentClick);
74
             this.dgvVouchers.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvVouchers_CellContentClick);
75
             // 
75
             // 
76
             // lblBatchDetails
76
             // lblBatchDetails
89
             this.rdoPrintDate.AutoSize = true;
89
             this.rdoPrintDate.AutoSize = true;
90
             this.rdoPrintDate.ForeColor = System.Drawing.Color.White;
90
             this.rdoPrintDate.ForeColor = System.Drawing.Color.White;
91
             this.rdoPrintDate.Location = new System.Drawing.Point(16, 49);
91
             this.rdoPrintDate.Location = new System.Drawing.Point(16, 49);
92
-            this.rdoPrintDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
92
+            this.rdoPrintDate.Margin = new System.Windows.Forms.Padding(4);
93
             this.rdoPrintDate.Name = "rdoPrintDate";
93
             this.rdoPrintDate.Name = "rdoPrintDate";
94
             this.rdoPrintDate.Size = new System.Drawing.Size(163, 21);
94
             this.rdoPrintDate.Size = new System.Drawing.Size(163, 21);
95
-            this.rdoPrintDate.TabIndex = 8;
95
+            this.rdoPrintDate.TabIndex = 0;
96
             this.rdoPrintDate.Text = "Date Printed (range):";
96
             this.rdoPrintDate.Text = "Date Printed (range):";
97
             this.rdoPrintDate.UseVisualStyleBackColor = true;
97
             this.rdoPrintDate.UseVisualStyleBackColor = true;
98
             this.rdoPrintDate.CheckedChanged += new System.EventHandler(this.rdoPrintDate_CheckedChanged);
98
             this.rdoPrintDate.CheckedChanged += new System.EventHandler(this.rdoPrintDate_CheckedChanged);
102
             this.rdoVoucherRange.AutoSize = true;
102
             this.rdoVoucherRange.AutoSize = true;
103
             this.rdoVoucherRange.ForeColor = System.Drawing.Color.White;
103
             this.rdoVoucherRange.ForeColor = System.Drawing.Color.White;
104
             this.rdoVoucherRange.Location = new System.Drawing.Point(16, 78);
104
             this.rdoVoucherRange.Location = new System.Drawing.Point(16, 78);
105
-            this.rdoVoucherRange.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
105
+            this.rdoVoucherRange.Margin = new System.Windows.Forms.Padding(4);
106
             this.rdoVoucherRange.Name = "rdoVoucherRange";
106
             this.rdoVoucherRange.Name = "rdoVoucherRange";
107
             this.rdoVoucherRange.Size = new System.Drawing.Size(207, 21);
107
             this.rdoVoucherRange.Size = new System.Drawing.Size(207, 21);
108
-            this.rdoVoucherRange.TabIndex = 8;
108
+            this.rdoVoucherRange.TabIndex = 1;
109
             this.rdoVoucherRange.Text = "Vouchers in Selected Batch:";
109
             this.rdoVoucherRange.Text = "Vouchers in Selected Batch:";
110
             this.rdoVoucherRange.UseVisualStyleBackColor = true;
110
             this.rdoVoucherRange.UseVisualStyleBackColor = true;
111
             this.rdoVoucherRange.CheckedChanged += new System.EventHandler(this.rdoVoucherRange_CheckedChanged);
111
             this.rdoVoucherRange.CheckedChanged += new System.EventHandler(this.rdoVoucherRange_CheckedChanged);
116
             this.rdoSerialNum.Checked = true;
116
             this.rdoSerialNum.Checked = true;
117
             this.rdoSerialNum.ForeColor = System.Drawing.Color.White;
117
             this.rdoSerialNum.ForeColor = System.Drawing.Color.White;
118
             this.rdoSerialNum.Location = new System.Drawing.Point(16, 106);
118
             this.rdoSerialNum.Location = new System.Drawing.Point(16, 106);
119
-            this.rdoSerialNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
119
+            this.rdoSerialNum.Margin = new System.Windows.Forms.Padding(4);
120
             this.rdoSerialNum.Name = "rdoSerialNum";
120
             this.rdoSerialNum.Name = "rdoSerialNum";
121
             this.rdoSerialNum.Size = new System.Drawing.Size(123, 21);
121
             this.rdoSerialNum.Size = new System.Drawing.Size(123, 21);
122
-            this.rdoSerialNum.TabIndex = 8;
122
+            this.rdoSerialNum.TabIndex = 2;
123
             this.rdoSerialNum.TabStop = true;
123
             this.rdoSerialNum.TabStop = true;
124
             this.rdoSerialNum.Text = "Serial Number:";
124
             this.rdoSerialNum.Text = "Serial Number:";
125
             this.rdoSerialNum.UseVisualStyleBackColor = true;
125
             this.rdoSerialNum.UseVisualStyleBackColor = true;
133
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
133
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
134
             this.label1.Name = "label1";
134
             this.label1.Name = "label1";
135
             this.label1.Size = new System.Drawing.Size(159, 17);
135
             this.label1.Size = new System.Drawing.Size(159, 17);
136
-            this.label1.TabIndex = 9;
136
+            this.label1.TabIndex = 11;
137
             this.label1.Text = "Search for vouchers by:";
137
             this.label1.Text = "Search for vouchers by:";
138
             this.label1.Click += new System.EventHandler(this.label1_Click);
138
             this.label1.Click += new System.EventHandler(this.label1_Click);
139
             // 
139
             // 
141
             // 
141
             // 
142
             this.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
142
             this.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
143
             this.dtpStartDate.Location = new System.Drawing.Point(471, 48);
143
             this.dtpStartDate.Location = new System.Drawing.Point(471, 48);
144
-            this.dtpStartDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
144
+            this.dtpStartDate.Margin = new System.Windows.Forms.Padding(4);
145
             this.dtpStartDate.Name = "dtpStartDate";
145
             this.dtpStartDate.Name = "dtpStartDate";
146
             this.dtpStartDate.Size = new System.Drawing.Size(132, 22);
146
             this.dtpStartDate.Size = new System.Drawing.Size(132, 22);
147
-            this.dtpStartDate.TabIndex = 10;
147
+            this.dtpStartDate.TabIndex = 3;
148
             this.dtpStartDate.ValueChanged += new System.EventHandler(this.dtpStartDate_ValueChanged);
148
             this.dtpStartDate.ValueChanged += new System.EventHandler(this.dtpStartDate_ValueChanged);
149
             // 
149
             // 
150
             // dtpEndDate
150
             // dtpEndDate
151
             // 
151
             // 
152
             this.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
152
             this.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
153
             this.dtpEndDate.Location = new System.Drawing.Point(680, 48);
153
             this.dtpEndDate.Location = new System.Drawing.Point(680, 48);
154
-            this.dtpEndDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
154
+            this.dtpEndDate.Margin = new System.Windows.Forms.Padding(4);
155
             this.dtpEndDate.Name = "dtpEndDate";
155
             this.dtpEndDate.Name = "dtpEndDate";
156
             this.dtpEndDate.Size = new System.Drawing.Size(132, 22);
156
             this.dtpEndDate.Size = new System.Drawing.Size(132, 22);
157
-            this.dtpEndDate.TabIndex = 10;
157
+            this.dtpEndDate.TabIndex = 4;
158
             this.dtpEndDate.ValueChanged += new System.EventHandler(this.dtpEndDate_ValueChanged);
158
             this.dtpEndDate.ValueChanged += new System.EventHandler(this.dtpEndDate_ValueChanged);
159
             // 
159
             // 
160
             // txtSerial
160
             // txtSerial
161
             // 
161
             // 
162
             this.txtSerial.Location = new System.Drawing.Point(427, 105);
162
             this.txtSerial.Location = new System.Drawing.Point(427, 105);
163
-            this.txtSerial.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
163
+            this.txtSerial.Margin = new System.Windows.Forms.Padding(4);
164
             this.txtSerial.Name = "txtSerial";
164
             this.txtSerial.Name = "txtSerial";
165
             this.txtSerial.Size = new System.Drawing.Size(385, 22);
165
             this.txtSerial.Size = new System.Drawing.Size(385, 22);
166
-            this.txtSerial.TabIndex = 11;
166
+            this.txtSerial.TabIndex = 8;
167
             // 
167
             // 
168
             // lblBatch1
168
             // lblBatch1
169
             // 
169
             // 
173
             this.lblBatch1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
173
             this.lblBatch1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
174
             this.lblBatch1.Name = "lblBatch1";
174
             this.lblBatch1.Name = "lblBatch1";
175
             this.lblBatch1.Size = new System.Drawing.Size(40, 17);
175
             this.lblBatch1.Size = new System.Drawing.Size(40, 17);
176
-            this.lblBatch1.TabIndex = 12;
176
+            this.lblBatch1.TabIndex = 15;
177
             this.lblBatch1.Text = "From";
177
             this.lblBatch1.Text = "From";
178
             this.lblBatch1.Click += new System.EventHandler(this.lblBatch1_Click);
178
             this.lblBatch1.Click += new System.EventHandler(this.lblBatch1_Click);
179
             // 
179
             // 
197
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
197
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
198
             this.label4.Name = "label4";
198
             this.label4.Name = "label4";
199
             this.label4.Size = new System.Drawing.Size(25, 17);
199
             this.label4.Size = new System.Drawing.Size(25, 17);
200
-            this.label4.TabIndex = 12;
200
+            this.label4.TabIndex = 13;
201
             this.label4.Text = "To";
201
             this.label4.Text = "To";
202
             this.label4.Click += new System.EventHandler(this.label4_Click);
202
             this.label4.Click += new System.EventHandler(this.label4_Click);
203
             // 
203
             // 
209
             this.lblBatch2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
209
             this.lblBatch2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
210
             this.lblBatch2.Name = "lblBatch2";
210
             this.lblBatch2.Name = "lblBatch2";
211
             this.lblBatch2.Size = new System.Drawing.Size(25, 17);
211
             this.lblBatch2.Size = new System.Drawing.Size(25, 17);
212
-            this.lblBatch2.TabIndex = 12;
212
+            this.lblBatch2.TabIndex = 16;
213
             this.lblBatch2.Text = "To";
213
             this.lblBatch2.Text = "To";
214
             this.lblBatch2.Click += new System.EventHandler(this.lblBatch2_Click);
214
             this.lblBatch2.Click += new System.EventHandler(this.lblBatch2_Click);
215
             // 
215
             // 
216
             // numStartSeqNo
216
             // numStartSeqNo
217
             // 
217
             // 
218
             this.numStartSeqNo.Location = new System.Drawing.Point(471, 76);
218
             this.numStartSeqNo.Location = new System.Drawing.Point(471, 76);
219
-            this.numStartSeqNo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
219
+            this.numStartSeqNo.Margin = new System.Windows.Forms.Padding(4);
220
             this.numStartSeqNo.Name = "numStartSeqNo";
220
             this.numStartSeqNo.Name = "numStartSeqNo";
221
             this.numStartSeqNo.Size = new System.Drawing.Size(133, 22);
221
             this.numStartSeqNo.Size = new System.Drawing.Size(133, 22);
222
-            this.numStartSeqNo.TabIndex = 14;
222
+            this.numStartSeqNo.TabIndex = 6;
223
             this.numStartSeqNo.ValueChanged += new System.EventHandler(this.numStartSeqNo_ValueChanged);
223
             this.numStartSeqNo.ValueChanged += new System.EventHandler(this.numStartSeqNo_ValueChanged);
224
             // 
224
             // 
225
             // numEndSeqNo
225
             // numEndSeqNo
226
             // 
226
             // 
227
             this.numEndSeqNo.Location = new System.Drawing.Point(680, 76);
227
             this.numEndSeqNo.Location = new System.Drawing.Point(680, 76);
228
-            this.numEndSeqNo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
228
+            this.numEndSeqNo.Margin = new System.Windows.Forms.Padding(4);
229
             this.numEndSeqNo.Name = "numEndSeqNo";
229
             this.numEndSeqNo.Name = "numEndSeqNo";
230
             this.numEndSeqNo.Size = new System.Drawing.Size(133, 22);
230
             this.numEndSeqNo.Size = new System.Drawing.Size(133, 22);
231
-            this.numEndSeqNo.TabIndex = 14;
231
+            this.numEndSeqNo.TabIndex = 7;
232
             this.numEndSeqNo.ValueChanged += new System.EventHandler(this.numEndSeqNo_ValueChanged);
232
             this.numEndSeqNo.ValueChanged += new System.EventHandler(this.numEndSeqNo_ValueChanged);
233
             // 
233
             // 
234
             // btnSearch
234
             // btnSearch
238
             this.btnSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
238
             this.btnSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
239
             this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
239
             this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
240
             this.btnSearch.Location = new System.Drawing.Point(821, 2);
240
             this.btnSearch.Location = new System.Drawing.Point(821, 2);
241
-            this.btnSearch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
241
+            this.btnSearch.Margin = new System.Windows.Forms.Padding(4);
242
             this.btnSearch.Name = "btnSearch";
242
             this.btnSearch.Name = "btnSearch";
243
             this.btnSearch.Size = new System.Drawing.Size(133, 123);
243
             this.btnSearch.Size = new System.Drawing.Size(133, 123);
244
-            this.btnSearch.TabIndex = 13;
244
+            this.btnSearch.TabIndex = 9;
245
             this.btnSearch.UseVisualStyleBackColor = false;
245
             this.btnSearch.UseVisualStyleBackColor = false;
246
             this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
246
             this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
247
             // 
247
             // 
248
             // numBatchId
248
             // numBatchId
249
             // 
249
             // 
250
             this.numBatchId.Location = new System.Drawing.Point(323, 76);
250
             this.numBatchId.Location = new System.Drawing.Point(323, 76);
251
-            this.numBatchId.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
251
+            this.numBatchId.Margin = new System.Windows.Forms.Padding(4);
252
             this.numBatchId.Name = "numBatchId";
252
             this.numBatchId.Name = "numBatchId";
253
             this.numBatchId.Size = new System.Drawing.Size(92, 22);
253
             this.numBatchId.Size = new System.Drawing.Size(92, 22);
254
-            this.numBatchId.TabIndex = 15;
254
+            this.numBatchId.TabIndex = 5;
255
             // 
255
             // 
256
             // label2
256
             // label2
257
             // 
257
             // 
261
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
261
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
262
             this.label2.Name = "label2";
262
             this.label2.Name = "label2";
263
             this.label2.Size = new System.Drawing.Size(61, 17);
263
             this.label2.Size = new System.Drawing.Size(61, 17);
264
-            this.label2.TabIndex = 16;
264
+            this.label2.TabIndex = 14;
265
             this.label2.Text = "Batch ID";
265
             this.label2.Text = "Batch ID";
266
             // 
266
             // 
267
             // VoucherForm
267
             // VoucherForm
289
             this.Controls.Add(this.lblBatchDetails);
289
             this.Controls.Add(this.lblBatchDetails);
290
             this.Controls.Add(this.dgvVouchers);
290
             this.Controls.Add(this.dgvVouchers);
291
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
291
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
292
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
292
+            this.Margin = new System.Windows.Forms.Padding(4);
293
             this.MinimumSize = new System.Drawing.Size(822, 643);
293
             this.MinimumSize = new System.Drawing.Size(822, 643);
294
             this.Name = "VoucherForm";
294
             this.Name = "VoucherForm";
295
             this.Text = "View PINs";
295
             this.Text = "View PINs";

+ 12 - 4
BulkPrinting/BulkPrinting/VoucherForm.cs

56
             {
56
             {
57
                 if (rdoPrintDate.Checked)
57
                 if (rdoPrintDate.Checked)
58
                 {
58
                 {
59
-                    Command.CommandText = "SELECT v.BatchId, v.Serial, v.SequenceNumber, v.ExpiryDate, v.EncryptedPIN FROM Voucher v LEFT JOIN Logs l on v.Id = l.VoucherId and l.EventType=@eventtype WHERE l.EventDate BETWEEN @startdate AND @enddate";
59
+                    Command.CommandText = "SELECT v.BatchId, v.Serial, v.SequenceNumber, v.ExpiryDate, v.EncryptedPIN, v.PrintCount FROM Voucher v LEFT JOIN Logs l on v.Id = l.VoucherId and l.EventType=@eventtype WHERE l.EventDate BETWEEN @startdate AND @enddate";
60
                     Command.Parameters.AddWithValue("@eventtype", VendorEvent.VendorEventType.PrintVoucher);
60
                     Command.Parameters.AddWithValue("@eventtype", VendorEvent.VendorEventType.PrintVoucher);
61
                     CultureInfo IVC = CultureInfo.InvariantCulture;
61
                     CultureInfo IVC = CultureInfo.InvariantCulture;
62
                     Command.Parameters.AddWithValue("@startdate", dtpStartDate.Value.ToString("yyyy-MM-dd 00:00:00", IVC));
62
                     Command.Parameters.AddWithValue("@startdate", dtpStartDate.Value.ToString("yyyy-MM-dd 00:00:00", IVC));
64
                 }
64
                 }
65
                 else if (rdoVoucherRange.Checked)
65
                 else if (rdoVoucherRange.Checked)
66
                 {
66
                 {
67
-                    Command.CommandText = "SELECT BatchId, Serial, SequenceNumber, ExpiryDate, EncryptedPIN FROM Voucher WHERE BatchId = @batchid AND SequenceNumber BETWEEN @minseqno AND @maxseqno";
67
+                    Command.CommandText = "SELECT BatchId, Serial, SequenceNumber, ExpiryDate, EncryptedPIN, PrintCount FROM Voucher WHERE BatchId = @batchid AND SequenceNumber BETWEEN @minseqno AND @maxseqno";
68
                     Command.Parameters.AddWithValue("@batchid", numBatchId.Value);
68
                     Command.Parameters.AddWithValue("@batchid", numBatchId.Value);
69
                     Command.Parameters.AddWithValue("@minseqno", numStartSeqNo.Value);
69
                     Command.Parameters.AddWithValue("@minseqno", numStartSeqNo.Value);
70
                     Command.Parameters.AddWithValue("@maxseqno", numEndSeqNo.Value);
70
                     Command.Parameters.AddWithValue("@maxseqno", numEndSeqNo.Value);
71
                 }
71
                 }
72
                 else if (rdoSerialNum.Checked)
72
                 else if (rdoSerialNum.Checked)
73
                 {
73
                 {
74
-                    Command.CommandText = "SELECT BatchId, Serial, SequenceNumber, ExpiryDate, EncryptedPIN FROM Voucher WHERE Serial=@serial";
74
+                    Command.CommandText = "SELECT BatchId, Serial, SequenceNumber, ExpiryDate, EncryptedPIN, PrintCount FROM Voucher WHERE Serial=@serial";
75
                     Command.Parameters.AddWithValue("@serial", txtSerial.Text);
75
                     Command.Parameters.AddWithValue("@serial", txtSerial.Text);
76
                 }
76
                 }
77
 
77
 
86
                 {
86
                 {
87
                     while (SQLReader.Read())
87
                     while (SQLReader.Read())
88
                     {
88
                     {
89
-                        string VoucherPIN = Utility.TripleDESDecrypt(SQLReader.GetValue(4).ToString(), Globals.SessionVoucherKey).ToString();
89
+                        string VoucherPIN;
90
+                        if (SQLReader.GetInt32(5) > 0)
91
+                        {
92
+                            VoucherPIN = Utility.TripleDESDecrypt(SQLReader.GetValue(4).ToString(), Globals.SessionVoucherKey).ToString();
93
+                        }
94
+                        else
95
+                        {
96
+                            VoucherPIN = "NOT PRINTED";
97
+                        }
90
                         dgvVouchers.Rows.Add(new object[] {
98
                         dgvVouchers.Rows.Add(new object[] {
91
                             SQLReader.GetValue(0),
99
                             SQLReader.GetValue(0),
92
                             SQLReader.GetValue(1),
100
                             SQLReader.GetValue(1),