· 8 years ago · Mar 20, 2018, 01:16 PM
1// **************************************************
2// Custom code for SalesOrderForm
3// Created: 2015-07-24 4:48:06 PM
4// **************************************************
5
6using System;
7using System.Collections;
8using System.Collections.Generic;
9using System.ComponentModel;
10using System.Data;
11using System.Data.SqlClient;
12using System.Drawing;
13using System.Linq;
14using System.Threading;
15using System.Windows.Forms;
16using Erp.BO;
17using Erp.Proxy.BO;
18using Erp.UI.App.SalesOrderEntry;
19using Ice.Adapters;
20using Ice.BO;
21using Ice.Core;
22using Ice.Lib.Customization;
23using Ice.Lib.Customization.Designers;
24using Ice.Lib.Framework;
25using Ice.Proxy.Lib;
26using Ice.UI.FormFunctions;
27using Infragistics.Win;
28using Infragistics.Win.UltraWinGrid;
29using Infragistics.Win.UltraWinToolbars;
30using ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle;
31using ColumnStyle = Infragistics.Win.UltraWinGrid.ColumnStyle;
32
33public class Script_CPEOrderEntry {
34 CustomScriptManager csm;
35
36 Transaction oTrans;
37
38 SalesOrderForm SalesOrderForm;
39
40 UltraToolbarsManager baseToolbarsManager;
41
42 DataTable OrderRel_Column;
43
44 EpiDataView OrderRelTree_Row;
45
46 DataTable OrderMsc_Column;
47
48 EpiDataView OrderMsc_Row;
49
50 DataTable QuoteDtlAttch_Column;
51
52 EpiDataView AutoAttachQuoteDtl_Row;
53
54 DataTable QuoteHedList_Column;
55
56 EpiDataView QuoteHedList_Row;
57
58 DataTable OrderHed_Column;
59
60 EpiDataView OrderHed_Row;
61
62 DataTable BookDtl_Column;
63
64 EpiDataView BookDtl_Row;
65
66 DataTable SerialNumberSearch_Column;
67
68 EpiDataView SNS_Row;
69
70 DataTable SaveOTSParams_Column;
71
72 EpiDataView SaveOTS_Row;
73
74 DataTable OrderHedList_Column;
75
76 EpiDataView OrderHedList_Row;
77
78 DataTable BpmData_Column;
79
80 EpiDataView CallContextBpmData_Row;
81
82 DataTable ccTable_Column;
83
84 EpiDataView CreditTran2_Row;
85
86 DataTable SalesKitPartInfo_Column;
87
88 EpiDataView KitPartInfo_Row;
89
90 EpiDataView OrderRel_Row;
91
92 DataTable OrderDtlAttch_Column;
93
94 EpiDataView AutoAttachOrderDtl_Row;
95
96 EpiDataView AutoAttachSalesKits_Row;
97
98 DataTable QuoteDtl_Column;
99
100 EpiDataView QuoteDtl_Row;
101
102 DataTable TaxConnectStatus_Column;
103
104 EpiDataView TaxConnectStatus_Row;
105
106 DataTable OrderRelTax_Column;
107
108 EpiDataView OrdRelTax_Row;
109
110 DataTable _Column;
111
112 EpiDataView NoBoundField_Row;
113
114 DataTable OrderDtl_Column;
115
116 EpiDataView SalesKits_Row;
117
118 DataTable OHOrderMsc_Column;
119
120 EpiDataView OHOrderMsc_Row;
121
122 DataTable Client_Column;
123
124 EpiDataView CallContextClientData_Row;
125
126 EpiDataView OrderDtlTree_Row;
127
128 DataTable OrderHedUPS_Column;
129
130 EpiDataView OrderHedUPS_Row;
131
132 EpiDataView OrderDtl_Row;
133
134 DataTable OrderRepComm_Column;
135
136 EpiDataView OrderRepComm_Row;
137
138 DataTable CreditTran_Column;
139
140 EpiDataView CreditTran_Row;
141
142 EpiDataView CopyNew_Row;
143
144 DataTable HedTaxSum_Column;
145
146 EpiDataView HedTaxSum_Row;
147
148 DataTable JobProd_Column;
149
150 EpiDataView JobProd_Row;
151
152 DataTable OrderSched_Column;
153
154 EpiDataView OrderSched_Row;
155
156 DataTable QuoteQty_Column;
157
158 EpiDataView QuoteQty_Row;
159
160 DataTable PartSubs_Column;
161
162 EpiDataView AlternatePart_Row;
163
164 EpiDataView AutoAttachOrderDtlTree_Row;
165
166 DataTable OrderHedAttch_Column;
167
168 EpiDataView AutoAttachOrderHed_Row;
169
170 DataTable QuoteHedAttch_Column;
171
172 EpiDataView AutoAttachQuoteHed_Row;
173
174 DataTable QuoteHed_Column;
175
176 EpiDataView QuoteHed_Row;
177
178 EpiLabel epiLabelC1;
179
180 EpiLabel epiLabelC1_e3a135f9_5a5d_4acc_bdfa_903304760694;
181
182 EpiLabel epiLabelC2;
183
184 EpiLabel epiLabelC2_0ea5aad9_e947_423b_8fdc_9354006db4ff;
185
186 EpiLabel epiLabel1;
187
188 EpiLabel epiLabel1_cff20c3e_2165_403f_9df6_10ecb182ecf3;
189
190 EpiTextBox epiTextBoxC1;
191
192 EpiTextBox epiTextBoxC1_d7452973_f266_4fb1_9f50_86176582bf24;
193
194 EpiTextBox epiTextBoxC2;
195
196 EpiTextBox epiTextBoxC2_176cff2f_225a_4610_94ef_000a2864cda0;
197
198 EpiTextBox epiTextBoxC3;
199
200 EpiTextBox epiTextBoxC3_99151df7_883c_4c1c_b485_d883b5081423;
201
202 EpiGroupBox epiGroupBoxC1;
203
204 EpiGroupBox epiGroupBoxC1_861c7222_896e_4323_89fa_dd2fc20e089d;
205
206 EpiUltraCombo empBasicComboC1;
207
208 EpiUltraCombo empBasicComboC1_ac1ee53e_0b23_47f6_9769_6095c17c2044;
209
210 EpiLabel epiLabelC3;
211
212 EpiLabel epiLabelC3_99a98a01_c3ac_4fb5_8cea_fadec62a48d3;
213
214 EpiButton btnSelectContact;
215
216 EpiButton btnSelectContact_083f1035_9ee3_4f28_a49b_e649a4b1ef07;
217
218 EpiNumericEditor epiNumericEditorC1;
219
220 EpiNumericEditor epiNumericEditorC1_ca7ed2c7_7441_4b16_993a_3e759df6558f;
221
222 EpiUltraCombo cmvPerConName;
223
224 EpiUltraCombo cmvPerConName_75b07942_9780_420a_9470_9f5d3b854bc1;
225
226 EpiLabel epiLabelC4;
227
228 EpiLabel epiLabelC4_0ba376e5_5be4_4241_9e59_ff6a202943c8;
229
230 EpiUltraCombo cmbContactDOB;
231
232 EpiUltraCombo cmbContactDOB_15183d62_19c7_4a21_89fc_041569bddd1d;
233
234 EpiGroupBox epiGroupBoxC2;
235
236 EpiGroupBox epiGroupBoxC2_d46d8466_975c_47d9_afd6_a3d209400a9c;
237
238 EpiLabel epiLabelC5;
239
240 EpiLabel epiLabelC5_865e5065_22b0_400c_b0a4_aac02471dba6;
241
242 EpiTextBox txtFirstName;
243
244 EpiTextBox txtFirstName_2be92edc_ff56_4b31_a15a_46e25fe59ed4;
245
246 EpiLabel epiLabelC6;
247
248 EpiLabel epiLabelC6_c8d16e2d_2cac_4ac8_899c_b51966821ec2;
249
250 EpiLabel epiLabelC7;
251
252 EpiLabel epiLabelC7_04b8564e_4197_41c2_906d_011c9b81350e;
253
254 EpiDateTimeEditor epiDateTimeEditorC1;
255
256 EpiDateTimeEditor epiDateTimeEditorC1_d2a94790_bb2c_42df_a5a1_8e7a967e5e89;
257
258 EpiButton btnCreateNewContact;
259
260 EpiButton btnCreateNewContact_78a10f50_af7a_44ef_9078_bc8a81137437;
261
262 EpiTextBox epiTextBoxC4;
263
264 EpiTextBox epiTextBoxC4_f14878e2_0e8d_403d_bd68_c354cfad6c54;
265
266 EpiLabel epiLabelC8;
267
268 EpiLabel epiLabelC8_b3ffbad4_d2a9_4122_b9a7_a6836107d70b;
269
270 EpiUltraCombo cmbEmployeeNum;
271
272 EpiUltraCombo cmbEmployeeNum_5dda1115_e352_4546_92de_bad715e5ea32;
273
274 EpiLabel epiLabelC1aa;
275
276 EpiLabel epiLabelC1aa_93eb9282_d276_46dc_919c_83178d357010;
277
278 EpiTextBox txtEmpNum;
279
280 EpiTextBox txtEmpNum_2332ab42_e00b_4339_960b_da0a8d8c6bec;
281
282 EpiDockManagerPanel Sheet1;
283
284 EpiDockManagerPanel Sheet1_adbc0ab4_b441_46d9_ae92_b32960a53d07;
285
286 EpiDockManagerPanel Sheet2;
287
288 EpiDockManagerPanel Sheet2_7f5c5a31_d34c_412b_993d_8866b44f278b;
289
290 EpiDockManagerPanel Sheet3;
291
292 EpiDockManagerPanel Sheet3_eaab0101_2d15_4678_921f_525edb65bf89;
293
294 EpiUltraGrid grdDtlList;
295
296 EpiUltraGrid grdDtlList_71fd4fbb_38d8_4207_9712_0d8022341a17;
297
298 EpiGroupBox epiGroupBoxC3;
299
300 EpiGroupBox epiGroupBoxC3_cc88c880_a173_4547_bcc4_dc99c2a5aa86;
301
302 EpiLabel epiLabelC9;
303
304 EpiLabel epiLabelC9_2b32ec55_7087_4c0d_98a5_6dc5e01697f5;
305
306 EpiLabel epiLabelC10;
307
308 EpiLabel epiLabelC10_edfe3fa7_3d56_4630_a12e_5106ae6b95cf;
309
310 EpiUltraCombo cmbSearchType;
311
312 EpiUltraCombo cmbSearchType_d8a0cba0_fd0f_4655_b18e_6bc972dbe676;
313
314 EpiLabel epiLabelC11;
315
316 EpiLabel epiLabelC11_47617eef_27d0_44e7_bd5d_db99aaf795ce;
317
318 EpiTextBox epiTextBoxC5;
319
320 EpiTextBox epiTextBoxC5_7fe56970_1ebf_4709_bb41_4ce0005dd485;
321
322 EpiLabel epiLabelC12;
323
324 EpiLabel epiLabelC12_a4c9459a_23f7_400a_80ac_d1ea51010626;
325
326 EpiTextBox epiTextBoxC6;
327
328 EpiTextBox epiTextBoxC6_96805b1c_337a_4eb5_b5cc_c08569d9ff7a;
329
330 EpiLabel epiLabelC1comp;
331
332 EpiLabel epiLabelC1comp_c32e2c43_2eda_4200_a86a_b7a364ae5070;
333
334 EpiTextBox txtCorpName;
335
336 EpiTextBox txtCorpName_70602aa3_216f_4b49_bc86_f28916a00838;
337
338 EpiLabel epiLabelC13co;
339
340 EpiLabel epiLabelC13co_a4790422_9982_4dc1_b067_ce54e766c1ca;
341
342 EpiTextBox epiTextBoxC7co;
343
344 EpiTextBox epiTextBoxC7co_b83d2486_c5a9_43c8_803b_8888683e7ee8;
345
346 EpiGroupBox epiGroupBoxC4;
347
348 EpiGroupBox epiGroupBoxC4_7f0f2080_5d48_4965_b198_b5abd21808ad;
349
350 EpiTextBox txtCustomerComments;
351
352 EpiTextBox txtCustomerComments_6f8f35a4_951a_4321_b607_409fdf473674;
353
354 BAQCombo baqComboC1;
355
356 BAQCombo baqComboC1_dbb6f21e_c202_4481_aecf_ec708f1c5cfc;
357
358 EpiButton btnRefreshContact;
359
360 EpiButton btnRefreshContact_e04e7880_2ecf_4f63_8982_39f691360c87;
361
362 EpiTextBox txtCustomerPONum;
363
364 EpiTextBox txtCustomerPONum_687a17ed_1050_44f3_9aac_ae9c910aab0c;
365
366 EpiLabel lblCustomerPONum;
367
368 EpiLabel lblCustomerPONum_cfb06a0e_5891_4251_b9e6_6d73c38575bc;
369
370 EpiTextBox txtQuery;
371
372 EpiTextBox txtQuery_ff235923_b42a_41db_8183_05600a8a5e79;
373
374 EpiGroupBox epiGroupBoxC5;
375
376 EpiGroupBox epiGroupBoxC5_9b0aa4db_799b_4a8a_af54_f294666dfd04;
377
378 EpiLabel epiLabelC14;
379
380 EpiLabel epiLabelC14_cd4d20fa_be1f_426e_958d_425ac53e7084;
381
382 EpiUltraCombo cmbHeaderPriceList;
383
384 EpiUltraCombo cmbHeaderPriceList_0efb8c61_d74c_46de_94f7_a33195f3a038;
385
386 EpiTextBox epiTextBoxC7;
387
388 EpiTextBox epiTextBoxC7_8361b0ff_09a4_4566_9a1d_1f895ae3d87e;
389
390 EpiTextBox txtCarrierAcctNo;
391
392 EpiTextBox txtCarrierAcctNo_6247443d_220c_4d04_a078_5769c79aafcf;
393
394 EpiLabel epiLabelSalesRepCode1;
395
396 EpiLabel epiLabelSalesRepCode1_9db1e8fe_4bec_4711_9ddd_a5d404e5ce49;
397
398 EpiTextBox epiTextBoxSalesRepCode1;
399
400 EpiTextBox epiTextBoxSalesRepCode1_921c33db_2c1a_441f_8767_e80bffdfadde;
401
402 EpiLabel lblReceivedDate;
403
404 EpiLabel lblReceivedDate_d2bbe9d8_5c71_4e15_8185_b34234d2ff45;
405
406 EpiDateTimeEditor epiDateTimeEditorC2;
407
408 EpiDateTimeEditor epiDateTimeEditorC2_7e27ea24_2dcf_4418_b394_c35b9a76bd7b;
409
410 EpiLabel lblFitTech;
411
412 EpiLabel lblFitTech_56fbc65b_0811_403b_be99_f2d2b6901306;
413
414 EpiCombo cboFitTech;
415
416 EpiCombo cboFitTech_57525ffd_72f8_4949_90b1_8b0fb4aaa065;
417
418 public void InitializeGlobalVariables(CustomScriptManager csm) {
419 this.csm = csm;
420 oTrans = (Transaction)this.csm.GetGlobalInstance("oTrans");
421 SalesOrderForm = (SalesOrderForm)this.csm.GetGlobalInstance("SalesOrderForm");
422 baseToolbarsManager = (UltraToolbarsManager)this.csm.GetGlobalInstance("baseToolbarsManager");
423 OrderRel_Column = (DataTable)this.csm.GetGlobalInstance("OrderRel_Column");
424 OrderRelTree_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderRelTree_Row");
425 OrderMsc_Column = (DataTable)this.csm.GetGlobalInstance("OrderMsc_Column");
426 OrderMsc_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderMsc_Row");
427 QuoteDtlAttch_Column = (DataTable)this.csm.GetGlobalInstance("QuoteDtlAttch_Column");
428 AutoAttachQuoteDtl_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachQuoteDtl_Row");
429 QuoteHedList_Column = (DataTable)this.csm.GetGlobalInstance("QuoteHedList_Column");
430 QuoteHedList_Row = (EpiDataView)this.csm.GetGlobalInstance("QuoteHedList_Row");
431 OrderHed_Column = (DataTable)this.csm.GetGlobalInstance("OrderHed_Column");
432 OrderHed_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderHed_Row");
433 BookDtl_Column = (DataTable)this.csm.GetGlobalInstance("BookDtl_Column");
434 BookDtl_Row = (EpiDataView)this.csm.GetGlobalInstance("BookDtl_Row");
435 SerialNumberSearch_Column = (DataTable)this.csm.GetGlobalInstance("SerialNumberSearch_Column");
436 SNS_Row = (EpiDataView)this.csm.GetGlobalInstance("SNS_Row");
437 SaveOTSParams_Column = (DataTable)this.csm.GetGlobalInstance("SaveOTSParams_Column");
438 SaveOTS_Row = (EpiDataView)this.csm.GetGlobalInstance("SaveOTS_Row");
439 OrderHedList_Column = (DataTable)this.csm.GetGlobalInstance("OrderHedList_Column");
440 OrderHedList_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderHedList_Row");
441 BpmData_Column = (DataTable)this.csm.GetGlobalInstance("BpmData_Column");
442 CallContextBpmData_Row = (EpiDataView)this.csm.GetGlobalInstance("CallContextBpmData_Row");
443 ccTable_Column = (DataTable)this.csm.GetGlobalInstance("ccTable_Column");
444 CreditTran2_Row = (EpiDataView)this.csm.GetGlobalInstance("CreditTran2_Row");
445 SalesKitPartInfo_Column = (DataTable)this.csm.GetGlobalInstance("SalesKitPartInfo_Column");
446 KitPartInfo_Row = (EpiDataView)this.csm.GetGlobalInstance("KitPartInfo_Row");
447 OrderRel_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderRel_Row");
448 OrderDtlAttch_Column = (DataTable)this.csm.GetGlobalInstance("OrderDtlAttch_Column");
449 AutoAttachOrderDtl_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachOrderDtl_Row");
450 AutoAttachSalesKits_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachSalesKits_Row");
451 QuoteDtl_Column = (DataTable)this.csm.GetGlobalInstance("QuoteDtl_Column");
452 QuoteDtl_Row = (EpiDataView)this.csm.GetGlobalInstance("QuoteDtl_Row");
453 TaxConnectStatus_Column = (DataTable)this.csm.GetGlobalInstance("TaxConnectStatus_Column");
454 TaxConnectStatus_Row = (EpiDataView)this.csm.GetGlobalInstance("TaxConnectStatus_Row");
455 OrderRelTax_Column = (DataTable)this.csm.GetGlobalInstance("OrderRelTax_Column");
456 OrdRelTax_Row = (EpiDataView)this.csm.GetGlobalInstance("OrdRelTax_Row");
457 _Column = (DataTable)this.csm.GetGlobalInstance("_Column");
458 NoBoundField_Row = (EpiDataView)this.csm.GetGlobalInstance("NoBoundField_Row");
459 OrderDtl_Column = (DataTable)this.csm.GetGlobalInstance("OrderDtl_Column");
460 SalesKits_Row = (EpiDataView)this.csm.GetGlobalInstance("SalesKits_Row");
461 OHOrderMsc_Column = (DataTable)this.csm.GetGlobalInstance("OHOrderMsc_Column");
462 OHOrderMsc_Row = (EpiDataView)this.csm.GetGlobalInstance("OHOrderMsc_Row");
463 Client_Column = (DataTable)this.csm.GetGlobalInstance("Client_Column");
464 CallContextClientData_Row = (EpiDataView)this.csm.GetGlobalInstance("CallContextClientData_Row");
465 OrderDtlTree_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderDtlTree_Row");
466 OrderHedUPS_Column = (DataTable)this.csm.GetGlobalInstance("OrderHedUPS_Column");
467 OrderHedUPS_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderHedUPS_Row");
468 OrderDtl_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderDtl_Row");
469 OrderRepComm_Column = (DataTable)this.csm.GetGlobalInstance("OrderRepComm_Column");
470 OrderRepComm_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderRepComm_Row");
471 CreditTran_Column = (DataTable)this.csm.GetGlobalInstance("CreditTran_Column");
472 CreditTran_Row = (EpiDataView)this.csm.GetGlobalInstance("CreditTran_Row");
473 CopyNew_Row = (EpiDataView)this.csm.GetGlobalInstance("CopyNew_Row");
474 HedTaxSum_Column = (DataTable)this.csm.GetGlobalInstance("HedTaxSum_Column");
475 HedTaxSum_Row = (EpiDataView)this.csm.GetGlobalInstance("HedTaxSum_Row");
476 JobProd_Column = (DataTable)this.csm.GetGlobalInstance("JobProd_Column");
477 JobProd_Row = (EpiDataView)this.csm.GetGlobalInstance("JobProd_Row");
478 OrderSched_Column = (DataTable)this.csm.GetGlobalInstance("OrderSched_Column");
479 OrderSched_Row = (EpiDataView)this.csm.GetGlobalInstance("OrderSched_Row");
480 QuoteQty_Column = (DataTable)this.csm.GetGlobalInstance("QuoteQty_Column");
481 QuoteQty_Row = (EpiDataView)this.csm.GetGlobalInstance("QuoteQty_Row");
482 PartSubs_Column = (DataTable)this.csm.GetGlobalInstance("PartSubs_Column");
483 AlternatePart_Row = (EpiDataView)this.csm.GetGlobalInstance("AlternatePart_Row");
484 AutoAttachOrderDtlTree_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachOrderDtlTree_Row");
485 OrderHedAttch_Column = (DataTable)this.csm.GetGlobalInstance("OrderHedAttch_Column");
486 AutoAttachOrderHed_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachOrderHed_Row");
487 QuoteHedAttch_Column = (DataTable)this.csm.GetGlobalInstance("QuoteHedAttch_Column");
488 AutoAttachQuoteHed_Row = (EpiDataView)this.csm.GetGlobalInstance("AutoAttachQuoteHed_Row");
489 QuoteHed_Column = (DataTable)this.csm.GetGlobalInstance("QuoteHed_Column");
490 QuoteHed_Row = (EpiDataView)this.csm.GetGlobalInstance("QuoteHed_Row");
491 var personalizeCustomizeManager = this.csm.PersonalizeCustomizeManager;
492 var topControl = personalizeCustomizeManager.TopControl;
493 topControl.FindForm().SuspendLayout();
494 // Creating custom targets.
495 epiLabelC1 = new EpiLabel();
496 epiLabelC1_e3a135f9_5a5d_4acc_bdfa_903304760694 = epiLabelC1;
497 var customControls = personalizeCustomizeManager.CustControlMan.CustomControlsHT;
498 customControls.Add("e3a135f9-5a5d-4acc-bdfa-903304760694", epiLabelC1);
499 var controlsHT = personalizeCustomizeManager.ControlsHT;
500 controlsHT.Add("e3a135f9-5a5d-4acc-bdfa-903304760694", epiLabelC1);
501 epiLabelC1.Name = "epiLabelC1";
502 epiLabelC1.EpiGuid = "e3a135f9-5a5d-4acc-bdfa-903304760694";
503 epiLabelC2 = new EpiLabel();
504 epiLabelC2_0ea5aad9_e947_423b_8fdc_9354006db4ff = epiLabelC2;
505 customControls.Add("0ea5aad9-e947-423b-8fdc-9354006db4ff", epiLabelC2);
506 controlsHT.Add("0ea5aad9-e947-423b-8fdc-9354006db4ff", epiLabelC2);
507 epiLabelC2.Name = "epiLabelC2";
508 epiLabelC2.EpiGuid = "0ea5aad9-e947-423b-8fdc-9354006db4ff";
509 epiLabel1 = new EpiLabel();
510 epiLabel1_cff20c3e_2165_403f_9df6_10ecb182ecf3 = epiLabel1;
511 customControls.Add("cff20c3e-2165-403f-9df6-10ecb182ecf3", epiLabel1);
512 controlsHT.Add("cff20c3e-2165-403f-9df6-10ecb182ecf3", epiLabel1);
513 epiLabel1.Name = "epiLabel1";
514 epiLabel1.EpiGuid = "cff20c3e-2165-403f-9df6-10ecb182ecf3";
515 epiTextBoxC1 = new EpiTextBox();
516 epiTextBoxC1_d7452973_f266_4fb1_9f50_86176582bf24 = epiTextBoxC1;
517 customControls.Add("d7452973-f266-4fb1-9f50-86176582bf24", epiTextBoxC1);
518 controlsHT.Add("d7452973-f266-4fb1-9f50-86176582bf24", epiTextBoxC1);
519 epiTextBoxC1.Name = "epiTextBoxC1";
520 epiTextBoxC1.EpiGuid = "d7452973-f266-4fb1-9f50-86176582bf24";
521 epiTextBoxC2 = new EpiTextBox();
522 epiTextBoxC2_176cff2f_225a_4610_94ef_000a2864cda0 = epiTextBoxC2;
523 customControls.Add("176cff2f-225a-4610-94ef-000a2864cda0", epiTextBoxC2);
524 controlsHT.Add("176cff2f-225a-4610-94ef-000a2864cda0", epiTextBoxC2);
525 epiTextBoxC2.Name = "epiTextBoxC2";
526 epiTextBoxC2.EpiGuid = "176cff2f-225a-4610-94ef-000a2864cda0";
527 epiTextBoxC3 = new EpiTextBox();
528 epiTextBoxC3_99151df7_883c_4c1c_b485_d883b5081423 = epiTextBoxC3;
529 customControls.Add("99151df7-883c-4c1c-b485-d883b5081423", epiTextBoxC3);
530 controlsHT.Add("99151df7-883c-4c1c-b485-d883b5081423", epiTextBoxC3);
531 epiTextBoxC3.Name = "epiTextBoxC3";
532 epiTextBoxC3.EpiGuid = "99151df7-883c-4c1c-b485-d883b5081423";
533 epiGroupBoxC1 = new EpiGroupBox();
534 epiGroupBoxC1_861c7222_896e_4323_89fa_dd2fc20e089d = epiGroupBoxC1;
535 customControls.Add("861c7222-896e-4323-89fa-dd2fc20e089d", epiGroupBoxC1);
536 controlsHT.Add("861c7222-896e-4323-89fa-dd2fc20e089d", epiGroupBoxC1);
537 epiGroupBoxC1.Name = "epiGroupBoxC1";
538 epiGroupBoxC1.EpiGuid = "861c7222-896e-4323-89fa-dd2fc20e089d";
539 empBasicComboC1 =
540 RetrieverComboDesigner.CreateRetriever("ac1ee53e-0b23-47f6-9769-6095c17c2044", "EmpBasic", "EmpBasicCombo", personalizeCustomizeManager);
541 empBasicComboC1_ac1ee53e_0b23_47f6_9769_6095c17c2044 = empBasicComboC1;
542 customControls.Add("ac1ee53e-0b23-47f6-9769-6095c17c2044", empBasicComboC1);
543 controlsHT.Add("ac1ee53e-0b23-47f6-9769-6095c17c2044", empBasicComboC1);
544 empBasicComboC1.Name = "empBasicComboC1";
545 empBasicComboC1.EpiGuid = "ac1ee53e-0b23-47f6-9769-6095c17c2044";
546 epiLabelC3 = new EpiLabel();
547 epiLabelC3_99a98a01_c3ac_4fb5_8cea_fadec62a48d3 = epiLabelC3;
548 customControls.Add("99a98a01-c3ac-4fb5-8cea-fadec62a48d3", epiLabelC3);
549 controlsHT.Add("99a98a01-c3ac-4fb5-8cea-fadec62a48d3", epiLabelC3);
550 epiLabelC3.Name = "epiLabelC3";
551 epiLabelC3.EpiGuid = "99a98a01-c3ac-4fb5-8cea-fadec62a48d3";
552 btnSelectContact = new EpiButton();
553 btnSelectContact_083f1035_9ee3_4f28_a49b_e649a4b1ef07 = btnSelectContact;
554 customControls.Add("083f1035-9ee3-4f28-a49b-e649a4b1ef07", btnSelectContact);
555 controlsHT.Add("083f1035-9ee3-4f28-a49b-e649a4b1ef07", btnSelectContact);
556 btnSelectContact.Name = "btnSelectContact";
557 btnSelectContact.EpiGuid = "083f1035-9ee3-4f28-a49b-e649a4b1ef07";
558 epiNumericEditorC1 = new EpiNumericEditor();
559 epiNumericEditorC1_ca7ed2c7_7441_4b16_993a_3e759df6558f = epiNumericEditorC1;
560 customControls.Add("ca7ed2c7-7441-4b16-993a-3e759df6558f", epiNumericEditorC1);
561 controlsHT.Add("ca7ed2c7-7441-4b16-993a-3e759df6558f", epiNumericEditorC1);
562 epiNumericEditorC1.Name = "epiNumericEditorC1";
563 epiNumericEditorC1.EpiGuid = "ca7ed2c7-7441-4b16-993a-3e759df6558f";
564 cmvPerConName = new EpiUltraCombo();
565 cmvPerConName_75b07942_9780_420a_9470_9f5d3b854bc1 = cmvPerConName;
566 customControls.Add("75b07942-9780-420a-9470-9f5d3b854bc1", cmvPerConName);
567 controlsHT.Add("75b07942-9780-420a-9470-9f5d3b854bc1", cmvPerConName);
568 cmvPerConName.Name = "cmvPerConName";
569 cmvPerConName.EpiGuid = "75b07942-9780-420a-9470-9f5d3b854bc1";
570 epiLabelC4 = new EpiLabel();
571 epiLabelC4_0ba376e5_5be4_4241_9e59_ff6a202943c8 = epiLabelC4;
572 customControls.Add("0ba376e5-5be4-4241-9e59-ff6a202943c8", epiLabelC4);
573 controlsHT.Add("0ba376e5-5be4-4241-9e59-ff6a202943c8", epiLabelC4);
574 epiLabelC4.Name = "epiLabelC4";
575 epiLabelC4.EpiGuid = "0ba376e5-5be4-4241-9e59-ff6a202943c8";
576 cmbContactDOB = new EpiUltraCombo();
577 cmbContactDOB_15183d62_19c7_4a21_89fc_041569bddd1d = cmbContactDOB;
578 customControls.Add("15183d62-19c7-4a21-89fc-041569bddd1d", cmbContactDOB);
579 controlsHT.Add("15183d62-19c7-4a21-89fc-041569bddd1d", cmbContactDOB);
580 cmbContactDOB.Name = "cmbContactDOB";
581 cmbContactDOB.EpiGuid = "15183d62-19c7-4a21-89fc-041569bddd1d";
582 epiGroupBoxC2 = new EpiGroupBox();
583 epiGroupBoxC2_d46d8466_975c_47d9_afd6_a3d209400a9c = epiGroupBoxC2;
584 customControls.Add("d46d8466-975c-47d9-afd6-a3d209400a9c", epiGroupBoxC2);
585 controlsHT.Add("d46d8466-975c-47d9-afd6-a3d209400a9c", epiGroupBoxC2);
586 epiGroupBoxC2.Name = "epiGroupBoxC2";
587 epiGroupBoxC2.EpiGuid = "d46d8466-975c-47d9-afd6-a3d209400a9c";
588 epiLabelC5 = new EpiLabel();
589 epiLabelC5_865e5065_22b0_400c_b0a4_aac02471dba6 = epiLabelC5;
590 customControls.Add("865e5065-22b0-400c-b0a4-aac02471dba6", epiLabelC5);
591 controlsHT.Add("865e5065-22b0-400c-b0a4-aac02471dba6", epiLabelC5);
592 epiLabelC5.Name = "epiLabelC5";
593 epiLabelC5.EpiGuid = "865e5065-22b0-400c-b0a4-aac02471dba6";
594 txtFirstName = new EpiTextBox();
595 txtFirstName_2be92edc_ff56_4b31_a15a_46e25fe59ed4 = txtFirstName;
596 customControls.Add("2be92edc-ff56-4b31-a15a-46e25fe59ed4", txtFirstName);
597 controlsHT.Add("2be92edc-ff56-4b31-a15a-46e25fe59ed4", txtFirstName);
598 txtFirstName.Name = "txtFirstName";
599 txtFirstName.EpiGuid = "2be92edc-ff56-4b31-a15a-46e25fe59ed4";
600 epiLabelC6 = new EpiLabel();
601 epiLabelC6_c8d16e2d_2cac_4ac8_899c_b51966821ec2 = epiLabelC6;
602 customControls.Add("c8d16e2d-2cac-4ac8-899c-b51966821ec2", epiLabelC6);
603 controlsHT.Add("c8d16e2d-2cac-4ac8-899c-b51966821ec2", epiLabelC6);
604 epiLabelC6.Name = "epiLabelC6";
605 epiLabelC6.EpiGuid = "c8d16e2d-2cac-4ac8-899c-b51966821ec2";
606 epiLabelC7 = new EpiLabel();
607 epiLabelC7_04b8564e_4197_41c2_906d_011c9b81350e = epiLabelC7;
608 customControls.Add("04b8564e-4197-41c2-906d-011c9b81350e", epiLabelC7);
609 controlsHT.Add("04b8564e-4197-41c2-906d-011c9b81350e", epiLabelC7);
610 epiLabelC7.Name = "epiLabelC7";
611 epiLabelC7.EpiGuid = "04b8564e-4197-41c2-906d-011c9b81350e";
612 epiDateTimeEditorC1 = new EpiDateTimeEditor();
613 epiDateTimeEditorC1_d2a94790_bb2c_42df_a5a1_8e7a967e5e89 = epiDateTimeEditorC1;
614 customControls.Add("d2a94790-bb2c-42df-a5a1-8e7a967e5e89", epiDateTimeEditorC1);
615 controlsHT.Add("d2a94790-bb2c-42df-a5a1-8e7a967e5e89", epiDateTimeEditorC1);
616 epiDateTimeEditorC1.Name = "epiDateTimeEditorC1";
617 epiDateTimeEditorC1.EpiGuid = "d2a94790-bb2c-42df-a5a1-8e7a967e5e89";
618 btnCreateNewContact = new EpiButton();
619 btnCreateNewContact_78a10f50_af7a_44ef_9078_bc8a81137437 = btnCreateNewContact;
620 customControls.Add("78a10f50-af7a-44ef-9078-bc8a81137437", btnCreateNewContact);
621 controlsHT.Add("78a10f50-af7a-44ef-9078-bc8a81137437", btnCreateNewContact);
622 btnCreateNewContact.Name = "btnCreateNewContact";
623 btnCreateNewContact.EpiGuid = "78a10f50-af7a-44ef-9078-bc8a81137437";
624 epiTextBoxC4 = new EpiTextBox();
625 epiTextBoxC4_f14878e2_0e8d_403d_bd68_c354cfad6c54 = epiTextBoxC4;
626 customControls.Add("f14878e2-0e8d-403d-bd68-c354cfad6c54", epiTextBoxC4);
627 controlsHT.Add("f14878e2-0e8d-403d-bd68-c354cfad6c54", epiTextBoxC4);
628 epiTextBoxC4.Name = "epiTextBoxC4";
629 epiTextBoxC4.EpiGuid = "f14878e2-0e8d-403d-bd68-c354cfad6c54";
630 epiLabelC8 = new EpiLabel();
631 epiLabelC8_b3ffbad4_d2a9_4122_b9a7_a6836107d70b = epiLabelC8;
632 customControls.Add("b3ffbad4-d2a9-4122-b9a7-a6836107d70b", epiLabelC8);
633 controlsHT.Add("b3ffbad4-d2a9-4122-b9a7-a6836107d70b", epiLabelC8);
634 epiLabelC8.Name = "epiLabelC8";
635 epiLabelC8.EpiGuid = "b3ffbad4-d2a9-4122-b9a7-a6836107d70b";
636 cmbEmployeeNum = new EpiUltraCombo();
637 cmbEmployeeNum_5dda1115_e352_4546_92de_bad715e5ea32 = cmbEmployeeNum;
638 customControls.Add("5dda1115-e352-4546-92de-bad715e5ea32", cmbEmployeeNum);
639 controlsHT.Add("5dda1115-e352-4546-92de-bad715e5ea32", cmbEmployeeNum);
640 cmbEmployeeNum.Name = "cmbEmployeeNum";
641 cmbEmployeeNum.EpiGuid = "5dda1115-e352-4546-92de-bad715e5ea32";
642 epiLabelC1aa = new EpiLabel();
643 epiLabelC1aa_93eb9282_d276_46dc_919c_83178d357010 = epiLabelC1aa;
644 customControls.Add("93eb9282-d276-46dc-919c-83178d357010", epiLabelC1aa);
645 controlsHT.Add("93eb9282-d276-46dc-919c-83178d357010", epiLabelC1aa);
646 epiLabelC1aa.Name = "epiLabelC1aa";
647 epiLabelC1aa.EpiGuid = "93eb9282-d276-46dc-919c-83178d357010";
648 txtEmpNum = new EpiTextBox();
649 txtEmpNum_2332ab42_e00b_4339_960b_da0a8d8c6bec = txtEmpNum;
650 customControls.Add("2332ab42-e00b-4339-960b-da0a8d8c6bec", txtEmpNum);
651 controlsHT.Add("2332ab42-e00b-4339-960b-da0a8d8c6bec", txtEmpNum);
652 txtEmpNum.Name = "txtEmpNum";
653 txtEmpNum.EpiGuid = "2332ab42-e00b-4339-960b-da0a8d8c6bec";
654 Sheet1 = new EpiDockManagerPanel();
655 Sheet1_adbc0ab4_b441_46d9_ae92_b32960a53d07 = Sheet1;
656 customControls.Add("adbc0ab4-b441-46d9-ae92-b32960a53d07", Sheet1);
657 controlsHT.Add("adbc0ab4-b441-46d9-ae92-b32960a53d07", Sheet1);
658 Sheet1.Name = "Sheet1";
659 Sheet1.EpiGuid = "adbc0ab4-b441-46d9-ae92-b32960a53d07";
660 Sheet2 = new EpiDockManagerPanel();
661 Sheet2_7f5c5a31_d34c_412b_993d_8866b44f278b = Sheet2;
662 customControls.Add("7f5c5a31-d34c-412b-993d-8866b44f278b", Sheet2);
663 controlsHT.Add("7f5c5a31-d34c-412b-993d-8866b44f278b", Sheet2);
664 Sheet2.Name = "Sheet2";
665 Sheet2.EpiGuid = "7f5c5a31-d34c-412b-993d-8866b44f278b";
666 Sheet3 = new EpiDockManagerPanel();
667 Sheet3_eaab0101_2d15_4678_921f_525edb65bf89 = Sheet3;
668 customControls.Add("eaab0101-2d15-4678-921f-525edb65bf89", Sheet3);
669 controlsHT.Add("eaab0101-2d15-4678-921f-525edb65bf89", Sheet3);
670 Sheet3.Name = "Sheet3";
671 Sheet3.EpiGuid = "eaab0101-2d15-4678-921f-525edb65bf89";
672 grdDtlList = new EpiUltraGrid();
673 grdDtlList_71fd4fbb_38d8_4207_9712_0d8022341a17 = grdDtlList;
674 customControls.Add("71fd4fbb-38d8-4207-9712-0d8022341a17", grdDtlList);
675 controlsHT.Add("71fd4fbb-38d8-4207-9712-0d8022341a17", grdDtlList);
676 grdDtlList.Name = "grdDtlList";
677 grdDtlList.EpiGuid = "71fd4fbb-38d8-4207-9712-0d8022341a17";
678 epiGroupBoxC3 = new EpiGroupBox();
679 epiGroupBoxC3_cc88c880_a173_4547_bcc4_dc99c2a5aa86 = epiGroupBoxC3;
680 customControls.Add("cc88c880-a173-4547-bcc4-dc99c2a5aa86", epiGroupBoxC3);
681 controlsHT.Add("cc88c880-a173-4547-bcc4-dc99c2a5aa86", epiGroupBoxC3);
682 epiGroupBoxC3.Name = "epiGroupBoxC3";
683 epiGroupBoxC3.EpiGuid = "cc88c880-a173-4547-bcc4-dc99c2a5aa86";
684 epiLabelC9 = new EpiLabel();
685 epiLabelC9_2b32ec55_7087_4c0d_98a5_6dc5e01697f5 = epiLabelC9;
686 customControls.Add("2b32ec55-7087-4c0d-98a5-6dc5e01697f5", epiLabelC9);
687 controlsHT.Add("2b32ec55-7087-4c0d-98a5-6dc5e01697f5", epiLabelC9);
688 epiLabelC9.Name = "epiLabelC9";
689 epiLabelC9.EpiGuid = "2b32ec55-7087-4c0d-98a5-6dc5e01697f5";
690 epiLabelC10 = new EpiLabel();
691 epiLabelC10_edfe3fa7_3d56_4630_a12e_5106ae6b95cf = epiLabelC10;
692 customControls.Add("edfe3fa7-3d56-4630-a12e-5106ae6b95cf", epiLabelC10);
693 controlsHT.Add("edfe3fa7-3d56-4630-a12e-5106ae6b95cf", epiLabelC10);
694 epiLabelC10.Name = "epiLabelC10";
695 epiLabelC10.EpiGuid = "edfe3fa7-3d56-4630-a12e-5106ae6b95cf";
696 cmbSearchType = new EpiUltraCombo();
697 cmbSearchType_d8a0cba0_fd0f_4655_b18e_6bc972dbe676 = cmbSearchType;
698 customControls.Add("d8a0cba0-fd0f-4655-b18e-6bc972dbe676", cmbSearchType);
699 controlsHT.Add("d8a0cba0-fd0f-4655-b18e-6bc972dbe676", cmbSearchType);
700 cmbSearchType.Name = "cmbSearchType";
701 cmbSearchType.EpiGuid = "d8a0cba0-fd0f-4655-b18e-6bc972dbe676";
702 epiLabelC11 = new EpiLabel();
703 epiLabelC11_47617eef_27d0_44e7_bd5d_db99aaf795ce = epiLabelC11;
704 customControls.Add("47617eef-27d0-44e7-bd5d-db99aaf795ce", epiLabelC11);
705 controlsHT.Add("47617eef-27d0-44e7-bd5d-db99aaf795ce", epiLabelC11);
706 epiLabelC11.Name = "epiLabelC11";
707 epiLabelC11.EpiGuid = "47617eef-27d0-44e7-bd5d-db99aaf795ce";
708 epiTextBoxC5 = new EpiTextBox();
709 epiTextBoxC5_7fe56970_1ebf_4709_bb41_4ce0005dd485 = epiTextBoxC5;
710 customControls.Add("7fe56970-1ebf-4709-bb41-4ce0005dd485", epiTextBoxC5);
711 controlsHT.Add("7fe56970-1ebf-4709-bb41-4ce0005dd485", epiTextBoxC5);
712 epiTextBoxC5.Name = "epiTextBoxC5";
713 epiTextBoxC5.EpiGuid = "7fe56970-1ebf-4709-bb41-4ce0005dd485";
714 epiLabelC12 = new EpiLabel();
715 epiLabelC12_a4c9459a_23f7_400a_80ac_d1ea51010626 = epiLabelC12;
716 customControls.Add("a4c9459a-23f7-400a-80ac-d1ea51010626", epiLabelC12);
717 controlsHT.Add("a4c9459a-23f7-400a-80ac-d1ea51010626", epiLabelC12);
718 epiLabelC12.Name = "epiLabelC12";
719 epiLabelC12.EpiGuid = "a4c9459a-23f7-400a-80ac-d1ea51010626";
720 epiTextBoxC6 = new EpiTextBox();
721 epiTextBoxC6_96805b1c_337a_4eb5_b5cc_c08569d9ff7a = epiTextBoxC6;
722 customControls.Add("96805b1c-337a-4eb5-b5cc-c08569d9ff7a", epiTextBoxC6);
723 controlsHT.Add("96805b1c-337a-4eb5-b5cc-c08569d9ff7a", epiTextBoxC6);
724 epiTextBoxC6.Name = "epiTextBoxC6";
725 epiTextBoxC6.EpiGuid = "96805b1c-337a-4eb5-b5cc-c08569d9ff7a";
726 epiLabelC1comp = new EpiLabel();
727 epiLabelC1comp_c32e2c43_2eda_4200_a86a_b7a364ae5070 = epiLabelC1comp;
728 customControls.Add("c32e2c43-2eda-4200-a86a-b7a364ae5070", epiLabelC1comp);
729 controlsHT.Add("c32e2c43-2eda-4200-a86a-b7a364ae5070", epiLabelC1comp);
730 epiLabelC1comp.Name = "epiLabelC1comp";
731 epiLabelC1comp.EpiGuid = "c32e2c43-2eda-4200-a86a-b7a364ae5070";
732 txtCorpName = new EpiTextBox();
733 txtCorpName_70602aa3_216f_4b49_bc86_f28916a00838 = txtCorpName;
734 customControls.Add("70602aa3-216f-4b49-bc86-f28916a00838", txtCorpName);
735 controlsHT.Add("70602aa3-216f-4b49-bc86-f28916a00838", txtCorpName);
736 txtCorpName.Name = "txtCorpName";
737 txtCorpName.EpiGuid = "70602aa3-216f-4b49-bc86-f28916a00838";
738 epiLabelC13co = new EpiLabel();
739 epiLabelC13co_a4790422_9982_4dc1_b067_ce54e766c1ca = epiLabelC13co;
740 customControls.Add("a4790422-9982-4dc1-b067-ce54e766c1ca", epiLabelC13co);
741 controlsHT.Add("a4790422-9982-4dc1-b067-ce54e766c1ca", epiLabelC13co);
742 epiLabelC13co.Name = "epiLabelC13co";
743 epiLabelC13co.EpiGuid = "a4790422-9982-4dc1-b067-ce54e766c1ca";
744 epiTextBoxC7co = new EpiTextBox();
745 epiTextBoxC7co_b83d2486_c5a9_43c8_803b_8888683e7ee8 = epiTextBoxC7co;
746 customControls.Add("b83d2486-c5a9-43c8-803b-8888683e7ee8", epiTextBoxC7co);
747 controlsHT.Add("b83d2486-c5a9-43c8-803b-8888683e7ee8", epiTextBoxC7co);
748 epiTextBoxC7co.Name = "epiTextBoxC7co";
749 epiTextBoxC7co.EpiGuid = "b83d2486-c5a9-43c8-803b-8888683e7ee8";
750 epiGroupBoxC4 = new EpiGroupBox();
751 epiGroupBoxC4_7f0f2080_5d48_4965_b198_b5abd21808ad = epiGroupBoxC4;
752 customControls.Add("7f0f2080-5d48-4965-b198-b5abd21808ad", epiGroupBoxC4);
753 controlsHT.Add("7f0f2080-5d48-4965-b198-b5abd21808ad", epiGroupBoxC4);
754 epiGroupBoxC4.Name = "epiGroupBoxC4";
755 epiGroupBoxC4.EpiGuid = "7f0f2080-5d48-4965-b198-b5abd21808ad";
756 txtCustomerComments = new EpiTextBox();
757 txtCustomerComments_6f8f35a4_951a_4321_b607_409fdf473674 = txtCustomerComments;
758 customControls.Add("6f8f35a4-951a-4321-b607-409fdf473674", txtCustomerComments);
759 controlsHT.Add("6f8f35a4-951a-4321-b607-409fdf473674", txtCustomerComments);
760 txtCustomerComments.Name = "txtCustomerComments";
761 txtCustomerComments.EpiGuid = "6f8f35a4-951a-4321-b607-409fdf473674";
762 baqComboC1 = new BAQCombo();
763 baqComboC1_dbb6f21e_c202_4481_aecf_ec708f1c5cfc = baqComboC1;
764 customControls.Add("dbb6f21e-c202-4481-aecf-ec708f1c5cfc", baqComboC1);
765 controlsHT.Add("dbb6f21e-c202-4481-aecf-ec708f1c5cfc", baqComboC1);
766 baqComboC1.Name = "baqComboC1";
767 baqComboC1.EpiGuid = "dbb6f21e-c202-4481-aecf-ec708f1c5cfc";
768 btnRefreshContact = new EpiButton();
769 btnRefreshContact_e04e7880_2ecf_4f63_8982_39f691360c87 = btnRefreshContact;
770 customControls.Add("e04e7880-2ecf-4f63-8982-39f691360c87", btnRefreshContact);
771 controlsHT.Add("e04e7880-2ecf-4f63-8982-39f691360c87", btnRefreshContact);
772 btnRefreshContact.Name = "btnRefreshContact";
773 btnRefreshContact.EpiGuid = "e04e7880-2ecf-4f63-8982-39f691360c87";
774 txtCustomerPONum = new EpiTextBox();
775 txtCustomerPONum_687a17ed_1050_44f3_9aac_ae9c910aab0c = txtCustomerPONum;
776 customControls.Add("687a17ed-1050-44f3-9aac-ae9c910aab0c", txtCustomerPONum);
777 controlsHT.Add("687a17ed-1050-44f3-9aac-ae9c910aab0c", txtCustomerPONum);
778 txtCustomerPONum.Name = "txtCustomerPONum";
779 txtCustomerPONum.EpiGuid = "687a17ed-1050-44f3-9aac-ae9c910aab0c";
780 lblCustomerPONum = new EpiLabel();
781 lblCustomerPONum_cfb06a0e_5891_4251_b9e6_6d73c38575bc = lblCustomerPONum;
782 customControls.Add("cfb06a0e-5891-4251-b9e6-6d73c38575bc", lblCustomerPONum);
783 controlsHT.Add("cfb06a0e-5891-4251-b9e6-6d73c38575bc", lblCustomerPONum);
784 lblCustomerPONum.Name = "lblCustomerPONum";
785 lblCustomerPONum.EpiGuid = "cfb06a0e-5891-4251-b9e6-6d73c38575bc";
786 txtQuery = new EpiTextBox();
787 txtQuery_ff235923_b42a_41db_8183_05600a8a5e79 = txtQuery;
788 customControls.Add("ff235923-b42a-41db-8183-05600a8a5e79", txtQuery);
789 controlsHT.Add("ff235923-b42a-41db-8183-05600a8a5e79", txtQuery);
790 txtQuery.Name = "txtQuery";
791 txtQuery.EpiGuid = "ff235923-b42a-41db-8183-05600a8a5e79";
792 epiGroupBoxC5 = new EpiGroupBox();
793 epiGroupBoxC5_9b0aa4db_799b_4a8a_af54_f294666dfd04 = epiGroupBoxC5;
794 customControls.Add("9b0aa4db-799b-4a8a-af54-f294666dfd04", epiGroupBoxC5);
795 controlsHT.Add("9b0aa4db-799b-4a8a-af54-f294666dfd04", epiGroupBoxC5);
796 epiGroupBoxC5.Name = "epiGroupBoxC5";
797 epiGroupBoxC5.EpiGuid = "9b0aa4db-799b-4a8a-af54-f294666dfd04";
798 epiLabelC14 = new EpiLabel();
799 epiLabelC14_cd4d20fa_be1f_426e_958d_425ac53e7084 = epiLabelC14;
800 customControls.Add("cd4d20fa-be1f-426e-958d-425ac53e7084", epiLabelC14);
801 controlsHT.Add("cd4d20fa-be1f-426e-958d-425ac53e7084", epiLabelC14);
802 epiLabelC14.Name = "epiLabelC14";
803 epiLabelC14.EpiGuid = "cd4d20fa-be1f-426e-958d-425ac53e7084";
804 cmbHeaderPriceList = new EpiUltraCombo();
805 cmbHeaderPriceList_0efb8c61_d74c_46de_94f7_a33195f3a038 = cmbHeaderPriceList;
806 customControls.Add("0efb8c61-d74c-46de-94f7-a33195f3a038", cmbHeaderPriceList);
807 controlsHT.Add("0efb8c61-d74c-46de-94f7-a33195f3a038", cmbHeaderPriceList);
808 cmbHeaderPriceList.Name = "cmbHeaderPriceList";
809 cmbHeaderPriceList.EpiGuid = "0efb8c61-d74c-46de-94f7-a33195f3a038";
810 epiTextBoxC7 = new EpiTextBox();
811 epiTextBoxC7_8361b0ff_09a4_4566_9a1d_1f895ae3d87e = epiTextBoxC7;
812 customControls.Add("8361b0ff-09a4-4566-9a1d-1f895ae3d87e", epiTextBoxC7);
813 controlsHT.Add("8361b0ff-09a4-4566-9a1d-1f895ae3d87e", epiTextBoxC7);
814 epiTextBoxC7.Name = "epiTextBoxC7";
815 epiTextBoxC7.EpiGuid = "8361b0ff-09a4-4566-9a1d-1f895ae3d87e";
816 txtCarrierAcctNo = new EpiTextBox();
817 txtCarrierAcctNo_6247443d_220c_4d04_a078_5769c79aafcf = txtCarrierAcctNo;
818 customControls.Add("6247443d-220c-4d04-a078-5769c79aafcf", txtCarrierAcctNo);
819 controlsHT.Add("6247443d-220c-4d04-a078-5769c79aafcf", txtCarrierAcctNo);
820 txtCarrierAcctNo.Name = "txtCarrierAcctNo";
821 txtCarrierAcctNo.EpiGuid = "6247443d-220c-4d04-a078-5769c79aafcf";
822 epiLabelSalesRepCode1 = new EpiLabel();
823 epiLabelSalesRepCode1_9db1e8fe_4bec_4711_9ddd_a5d404e5ce49 = epiLabelSalesRepCode1;
824 customControls.Add("9db1e8fe-4bec-4711-9ddd-a5d404e5ce49", epiLabelSalesRepCode1);
825 controlsHT.Add("9db1e8fe-4bec-4711-9ddd-a5d404e5ce49", epiLabelSalesRepCode1);
826 epiLabelSalesRepCode1.Name = "epiLabelSalesRepCode1";
827 epiLabelSalesRepCode1.EpiGuid = "9db1e8fe-4bec-4711-9ddd-a5d404e5ce49";
828 epiTextBoxSalesRepCode1 = new EpiTextBox();
829 epiTextBoxSalesRepCode1_921c33db_2c1a_441f_8767_e80bffdfadde = epiTextBoxSalesRepCode1;
830 customControls.Add("921c33db-2c1a-441f-8767-e80bffdfadde", epiTextBoxSalesRepCode1);
831 controlsHT.Add("921c33db-2c1a-441f-8767-e80bffdfadde", epiTextBoxSalesRepCode1);
832 epiTextBoxSalesRepCode1.Name = "epiTextBoxSalesRepCode1";
833 epiTextBoxSalesRepCode1.EpiGuid = "921c33db-2c1a-441f-8767-e80bffdfadde";
834 lblReceivedDate = new EpiLabel();
835 lblReceivedDate_d2bbe9d8_5c71_4e15_8185_b34234d2ff45 = lblReceivedDate;
836 customControls.Add("d2bbe9d8-5c71-4e15-8185-b34234d2ff45", lblReceivedDate);
837 controlsHT.Add("d2bbe9d8-5c71-4e15-8185-b34234d2ff45", lblReceivedDate);
838 lblReceivedDate.Name = "lblReceivedDate";
839 lblReceivedDate.EpiGuid = "d2bbe9d8-5c71-4e15-8185-b34234d2ff45";
840 epiDateTimeEditorC2 = new EpiDateTimeEditor();
841 epiDateTimeEditorC2_7e27ea24_2dcf_4418_b394_c35b9a76bd7b = epiDateTimeEditorC2;
842 customControls.Add("7e27ea24-2dcf-4418-b394-c35b9a76bd7b", epiDateTimeEditorC2);
843 controlsHT.Add("7e27ea24-2dcf-4418-b394-c35b9a76bd7b", epiDateTimeEditorC2);
844 epiDateTimeEditorC2.Name = "epiDateTimeEditorC2";
845 epiDateTimeEditorC2.EpiGuid = "7e27ea24-2dcf-4418-b394-c35b9a76bd7b";
846 lblFitTech = new EpiLabel();
847 lblFitTech_56fbc65b_0811_403b_be99_f2d2b6901306 = lblFitTech;
848 customControls.Add("56fbc65b-0811-403b-be99-f2d2b6901306", lblFitTech);
849 controlsHT.Add("56fbc65b-0811-403b-be99-f2d2b6901306", lblFitTech);
850 lblFitTech.Name = "lblFitTech";
851 lblFitTech.EpiGuid = "56fbc65b-0811-403b-be99-f2d2b6901306";
852 cboFitTech = new EpiCombo();
853 cboFitTech_57525ffd_72f8_4949_90b1_8b0fb4aaa065 = cboFitTech;
854 customControls.Add("57525ffd-72f8-4949-90b1-8b0fb4aaa065", cboFitTech);
855 controlsHT.Add("57525ffd-72f8-4949-90b1-8b0fb4aaa065", cboFitTech);
856 cboFitTech.Name = "cboFitTech";
857 cboFitTech.EpiGuid = "57525ffd-72f8-4949-90b1-8b0fb4aaa065";
858 // lineDetailPanel1
859 var local1 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["08909a88-e65f-46a1-acf5-84121694376d"];
860 local1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
861 local1.Width = 1439;
862 local1.Height = 677;
863 local1.Controls.Add(epiGroupBoxC1);
864 local1.Controls.Add(epiGroupBoxC2);
865 local1.Controls.SetChildIndex(epiGroupBoxC1, 0);
866 local1.Controls.SetChildIndex(epiGroupBoxC2, 0);
867 var nativeSheets = personalizeCustomizeManager.NativeSheetsDCPsHT;
868 var local2 = EpiCustomSheetDesigner.GetDockableControlPane(local1, "08909a88-e65f-46a1-acf5-84121694376d", nativeSheets);
869 // grpDetail2
870 var local3 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["492bed80-396e-4065-b9b1-8807fdfcb421"];
871 local3.Top = 322;
872 local3.Left = 7;
873 local3.Controls.Add(epiLabelC1);
874 local3.Controls.Add(epiLabelC2);
875 local3.Controls.Add(epiLabel1);
876 local3.Controls.Add(epiTextBoxC1);
877 local3.Controls.Add(epiTextBoxC2);
878 local3.Controls.Add(epiTextBoxC3);
879 local3.Controls.SetChildIndex(epiLabelC1, 0);
880 local3.Controls.SetChildIndex(epiLabelC2, 0);
881 local3.Controls.SetChildIndex(epiLabel1, 0);
882 local3.Controls.SetChildIndex(epiTextBoxC1, 0);
883 local3.Controls.SetChildIndex(epiTextBoxC2, 0);
884 local3.Controls.SetChildIndex(epiTextBoxC3, 0);
885 // epiLabelC1
886 epiLabelC1.Top = 206;
887 epiLabelC1.Left = 391;
888 epiLabelC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
889 epiLabelC1.Width = 60;
890 epiLabelC1.Height = 20;
891 epiLabelC1.Text = "Cast:";
892 // epiLabelC2
893 epiLabelC2.Top = 227;
894 epiLabelC2.Left = 613;
895 epiLabelC2.Anchor = AnchorStyles.Top|AnchorStyles.Left;
896 epiLabelC2.Width = 81;
897 epiLabelC2.Height = 20;
898 epiLabelC2.Text = "Left Mould:";
899 // epiLabel1
900 epiLabel1.Top = 204;
901 epiLabel1.Left = 613;
902 epiLabel1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
903 epiLabel1.Width = 81;
904 epiLabel1.Height = 20;
905 epiLabel1.Text = "Right Mould:";
906 // epiTextBoxC1
907 epiTextBoxC1.Top = 205;
908 epiTextBoxC1.Left = 464;
909 epiTextBoxC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
910 epiTextBoxC1.Width = 116;
911 epiTextBoxC1.Height = 20;
912 epiTextBoxC1.Text = "";
913 epiTextBoxC1.EpiBinding = "OrderDtl.CPE_Cast_c";
914 epiTextBoxC1.EpiLabel = "epiLabelC1";
915 // epiTextBoxC2
916 epiTextBoxC2.Top = 227;
917 epiTextBoxC2.Left = 700;
918 epiTextBoxC2.Anchor = AnchorStyles.Top|AnchorStyles.Left;
919 epiTextBoxC2.Width = 114;
920 epiTextBoxC2.Height = 20;
921 epiTextBoxC2.Text = "";
922 epiTextBoxC2.EpiBinding = "OrderDtl.CPE_DspMouldLeft_c";
923 epiTextBoxC2.EpiLabel = "epiLabelC2";
924 // epiTextBoxC3
925 epiTextBoxC3.Top = 204;
926 epiTextBoxC3.Left = 700;
927 epiTextBoxC3.Anchor = AnchorStyles.Top|AnchorStyles.Left;
928 epiTextBoxC3.Width = 114;
929 epiTextBoxC3.Height = 20;
930 epiTextBoxC3.Text = "";
931 epiTextBoxC3.EpiBinding = "OrderDtl.CPE_DspMouldRight_c";
932 epiTextBoxC3.EpiLabel = "epiLabel1";
933 // epiGroupBoxC1
934 epiGroupBoxC1.Top = 180;
935 epiGroupBoxC1.Left = 7;
936 epiGroupBoxC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
937 epiGroupBoxC1.Width = 822;
938 epiGroupBoxC1.Height = 70;
939 epiGroupBoxC1.Text = "Contacts";
940 epiGroupBoxC1.Controls.Add(empBasicComboC1);
941 epiGroupBoxC1.Controls.Add(epiLabelC3);
942 epiGroupBoxC1.Controls.Add(btnSelectContact);
943 epiGroupBoxC1.Controls.Add(epiNumericEditorC1);
944 epiGroupBoxC1.Controls.Add(cmvPerConName);
945 epiGroupBoxC1.Controls.Add(epiLabelC4);
946 epiGroupBoxC1.Controls.Add(cmbContactDOB);
947 epiGroupBoxC1.Controls.Add(epiLabelC8);
948 epiGroupBoxC1.Controls.Add(cmbEmployeeNum);
949 epiGroupBoxC1.Controls.Add(epiLabelC13co);
950 epiGroupBoxC1.Controls.Add(epiTextBoxC7co);
951 epiGroupBoxC1.Controls.Add(btnRefreshContact);
952 epiGroupBoxC1.Controls.Add(epiTextBoxC7);
953 epiGroupBoxC1.Controls.SetChildIndex(epiTextBoxC7, 0);
954 epiGroupBoxC1.Controls.SetChildIndex(empBasicComboC1, 1);
955 epiGroupBoxC1.Controls.SetChildIndex(epiLabelC3, 1);
956 epiGroupBoxC1.Controls.SetChildIndex(btnSelectContact, 1);
957 epiGroupBoxC1.Controls.SetChildIndex(epiNumericEditorC1, 1);
958 epiGroupBoxC1.Controls.SetChildIndex(cmvPerConName, 1);
959 epiGroupBoxC1.Controls.SetChildIndex(epiLabelC4, 1);
960 epiGroupBoxC1.Controls.SetChildIndex(cmbContactDOB, 1);
961 epiGroupBoxC1.Controls.SetChildIndex(epiLabelC8, 1);
962 epiGroupBoxC1.Controls.SetChildIndex(cmbEmployeeNum, 1);
963 epiGroupBoxC1.Controls.SetChildIndex(epiLabelC13co, 1);
964 epiGroupBoxC1.Controls.SetChildIndex(epiTextBoxC7co, 1);
965 epiGroupBoxC1.Controls.SetChildIndex(btnRefreshContact, 1);
966 // empBasicComboC1
967 empBasicComboC1.Top = -73;
968 empBasicComboC1.Left = 179;
969 empBasicComboC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
970 empBasicComboC1.Width = 244;
971 empBasicComboC1.Text = "";
972 empBasicComboC1.EpiBinding = "OrderDtl.EmployeeNum_c";
973 empBasicComboC1.EpiLabel = "epiLabelC3";
974 // erp.adapters.empbasic.dll
975 // epiLabelC3
976 epiLabelC3.Top = -73;
977 epiLabelC3.Left = 85;
978 epiLabelC3.Anchor = AnchorStyles.Top|AnchorStyles.Left;
979 epiLabelC3.Width = 88;
980 epiLabelC3.Height = 20;
981 epiLabelC3.Text = "Employee:";
982 // btnSelectContact
983 btnSelectContact.Top = 16;
984 btnSelectContact.Left = 7;
985 btnSelectContact.Anchor = AnchorStyles.Top|AnchorStyles.Left;
986 btnSelectContact.Width = 145;
987 btnSelectContact.Height = 22;
988 btnSelectContact.TabStop = false;
989 btnSelectContact.Text = "Person / Contact...";
990 // epiNumericEditorC1
991 epiNumericEditorC1.Top = 18;
992 epiNumericEditorC1.Left = 155;
993 epiNumericEditorC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
994 epiNumericEditorC1.Width = 72;
995 epiNumericEditorC1.EpiBinding = "OrderDtl.PerCon_c";
996 epiNumericEditorC1.EpiContextMenuKey = "PerCon.PerConID";
997 epiNumericEditorC1.Nullable = true;
998 // cmvPerConName
999 cmvPerConName.Top = 18;
1000 cmvPerConName.Left = 230;
1001 cmvPerConName.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1002 cmvPerConName.Width = 272;
1003 cmvPerConName.TabStop = false;
1004 cmvPerConName.Text = "";
1005 cmvPerConName.EpiBinding = "OrderDtl.PerConDropDown_c";
1006 // epiLabelC4
1007 epiLabelC4.Top = 41;
1008 epiLabelC4.Left = 89;
1009 epiLabelC4.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1010 epiLabelC4.Width = 60;
1011 epiLabelC4.Height = 20;
1012 epiLabelC4.Text = "DOB:";
1013 // cmbContactDOB
1014 cmbContactDOB.Top = 41;
1015 cmbContactDOB.Left = 155;
1016 cmbContactDOB.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1017 cmbContactDOB.Width = 84;
1018 cmbContactDOB.TabStop = false;
1019 cmbContactDOB.Text = "";
1020 cmbContactDOB.EpiBinding = "OrderDtl.PerConDropDown_c";
1021 cmbContactDOB.EpiLabel = "epiLabelC4";
1022 // epiGroupBoxC2
1023 epiGroupBoxC2.Top = 250;
1024 epiGroupBoxC2.Left = 7;
1025 epiGroupBoxC2.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1026 epiGroupBoxC2.Width = 822;
1027 epiGroupBoxC2.Height = 70;
1028 epiGroupBoxC2.Text = "New Contact";
1029 epiGroupBoxC2.Controls.Add(epiLabelC5);
1030 epiGroupBoxC2.Controls.Add(txtFirstName);
1031 epiGroupBoxC2.Controls.Add(epiLabelC6);
1032 epiGroupBoxC2.Controls.Add(epiLabelC7);
1033 epiGroupBoxC2.Controls.Add(epiDateTimeEditorC1);
1034 epiGroupBoxC2.Controls.Add(btnCreateNewContact);
1035 epiGroupBoxC2.Controls.Add(epiTextBoxC4);
1036 epiGroupBoxC2.Controls.Add(epiLabelC1aa);
1037 epiGroupBoxC2.Controls.Add(txtEmpNum);
1038 epiGroupBoxC2.Controls.Add(epiLabelC1comp);
1039 epiGroupBoxC2.Controls.Add(txtCorpName);
1040 epiGroupBoxC2.Controls.SetChildIndex(epiLabelC7, 0);
1041 epiGroupBoxC2.Controls.SetChildIndex(epiDateTimeEditorC1, 0);
1042 epiGroupBoxC2.Controls.SetChildIndex(btnCreateNewContact, 0);
1043 epiGroupBoxC2.Controls.SetChildIndex(epiTextBoxC4, 0);
1044 epiGroupBoxC2.Controls.SetChildIndex(epiLabelC1aa, 0);
1045 epiGroupBoxC2.Controls.SetChildIndex(txtEmpNum, 0);
1046 epiGroupBoxC2.Controls.SetChildIndex(epiLabelC1comp, 0);
1047 epiGroupBoxC2.Controls.SetChildIndex(txtCorpName, 0);
1048 epiGroupBoxC2.Controls.SetChildIndex(epiLabelC5, 1);
1049 epiGroupBoxC2.Controls.SetChildIndex(txtFirstName, 1);
1050 epiGroupBoxC2.Controls.SetChildIndex(epiLabelC6, 1);
1051 // epiLabelC5
1052 epiLabelC5.Top = 13;
1053 epiLabelC5.Left = 66;
1054 epiLabelC5.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1055 epiLabelC5.Width = 83;
1056 epiLabelC5.Height = 20;
1057 epiLabelC5.Text = "First Name:";
1058 // txtFirstName
1059 txtFirstName.Top = 13;
1060 txtFirstName.Left = 155;
1061 txtFirstName.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1062 txtFirstName.Width = 198;
1063 txtFirstName.Height = 20;
1064 txtFirstName.Text = "";
1065 // epiLabelC6
1066 epiLabelC6.Top = 11;
1067 epiLabelC6.Left = 358;
1068 epiLabelC6.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1069 epiLabelC6.Width = 68;
1070 epiLabelC6.Height = 20;
1071 epiLabelC6.Text = "Last Name:";
1072 // epiLabelC7
1073 epiLabelC7.Top = 36;
1074 epiLabelC7.Left = 74;
1075 epiLabelC7.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1076 epiLabelC7.Width = 75;
1077 epiLabelC7.Height = 20;
1078 epiLabelC7.Text = "DOB:";
1079 // epiDateTimeEditorC1
1080 epiDateTimeEditorC1.Top = 36;
1081 epiDateTimeEditorC1.Left = 155;
1082 epiDateTimeEditorC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1083 epiDateTimeEditorC1.Width = 92;
1084 epiDateTimeEditorC1.TabIndex = 3;
1085 // btnCreateNewContact
1086 btnCreateNewContact.Top = 38;
1087 btnCreateNewContact.Left = 639;
1088 btnCreateNewContact.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1089 btnCreateNewContact.Width = 154;
1090 btnCreateNewContact.Height = 20;
1091 btnCreateNewContact.TabIndex = 4;
1092 btnCreateNewContact.Text = "Create Contact and Select";
1093 // epiTextBoxC4
1094 epiTextBoxC4.Top = 11;
1095 epiTextBoxC4.Left = 432;
1096 epiTextBoxC4.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1097 epiTextBoxC4.Width = 198;
1098 epiTextBoxC4.Height = 20;
1099 epiTextBoxC4.TabIndex = 2;
1100 epiTextBoxC4.Text = "";
1101 epiTextBoxC4.EpiLabel = "epiLabelC6";
1102 // ice.contracts.lib.boreader.dll
1103 // erp.contracts.bo.percon.dll
1104 // epiLabelC8
1105 epiLabelC8.Top = 40;
1106 epiLabelC8.Left = 263;
1107 epiLabelC8.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1108 epiLabelC8.Width = 121;
1109 epiLabelC8.Height = 20;
1110 epiLabelC8.Text = "Employee Num:";
1111 // cmbEmployeeNum
1112 cmbEmployeeNum.Top = 85;
1113 cmbEmployeeNum.Left = 387;
1114 cmbEmployeeNum.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1115 cmbEmployeeNum.Width = 151;
1116 cmbEmployeeNum.Text = "";
1117 cmbEmployeeNum.EpiLabel = "epiLabelC8";
1118 // epiLabelC1aa
1119 epiLabelC1aa.Top = 36;
1120 epiLabelC1aa.Left = 253;
1121 epiLabelC1aa.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1122 epiLabelC1aa.Width = 65;
1123 epiLabelC1aa.Height = 20;
1124 epiLabelC1aa.Text = "Emp Num:";
1125 // txtEmpNum
1126 txtEmpNum.Top = 36;
1127 txtEmpNum.Left = 324;
1128 txtEmpNum.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1129 txtEmpNum.Width = 111;
1130 txtEmpNum.Height = 20;
1131 txtEmpNum.Text = "";
1132 txtEmpNum.EpiLabel = "epiLabelC1aa";
1133 // Sheet1
1134 Sheet1.Top = 20;
1135 Sheet1.Left = 0;
1136 Sheet1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1137 Sheet1.Width = 950;
1138 Sheet1.Height = 686;
1139 Sheet1.AutoScroll = true;
1140 var customSheets = personalizeCustomizeManager.CustControlMan.CustomSheetsHT;
1141 var local4 = EpiCustomSheetDesigner.InitializeSheet(Sheet1, "adbc0ab4-b441-46d9-ae92-b32960a53d07", customSheets);
1142 if (local4!=null) {
1143 EpiDockManagerPanelDesigner.AddCustomDockManager(personalizeCustomizeManager, Sheet1);
1144 local4.Text = "";
1145 local4.TextTab = "Order Line Entry";
1146 EpiCustomSheetDesigner.AddCustomSheetToDockManager(personalizeCustomizeManager, local4, "baseDockManagered38e9a5-9e46-4ee3-98e9-a4acf1e72715");
1147 }
1148
1149 // Sheet2
1150 Sheet2.Controls.Add(grdDtlList);
1151 Sheet2.Controls.SetChildIndex(grdDtlList, 0);
1152 Sheet2.AutoScroll = true;
1153 var local5 = EpiCustomSheetDesigner.InitializeSheet(Sheet2, "7f5c5a31-d34c-412b-993d-8866b44f278b", customSheets);
1154 if (local5!=null) {
1155 EpiDockManagerPanelDesigner.AddCustomDockManager(personalizeCustomizeManager, Sheet2);
1156 local5.Text = "";
1157 local5.TextTab = "List";
1158 EpiCustomSheetDesigner.AddCustomSheetToDockManager(personalizeCustomizeManager, local5, "baseDockManageradbc0ab4-b441-46d9-ae92-b32960a53d07");
1159 }
1160
1161 // Sheet3
1162 Sheet3.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1163 Sheet3.Width = 1449;
1164 Sheet3.Height = 34;
1165 Sheet3.Controls.Add(epiLabelC10);
1166 Sheet3.Controls.Add(cmbSearchType);
1167 Sheet3.Controls.SetChildIndex(cmbSearchType, 0);
1168 Sheet3.Controls.SetChildIndex(epiLabelC10, 1);
1169 Sheet3.AutoScroll = true;
1170 var local6 = EpiCustomSheetDesigner.InitializeSheet(Sheet3, "eaab0101-2d15-4678-921f-525edb65bf89", customSheets);
1171 if (local6!=null) {
1172 EpiDockManagerPanelDesigner.AddCustomDockManager(personalizeCustomizeManager, Sheet3);
1173 local6.Text = "";
1174 local6.TextTab = "Detail";
1175 EpiCustomSheetDesigner.AddCustomSheetToDockManager(personalizeCustomizeManager, local6, "baseDockManageradbc0ab4-b441-46d9-ae92-b32960a53d07");
1176 }
1177
1178 // grdDtlList
1179 grdDtlList.Top = 0;
1180 grdDtlList.Left = -136;
1181 grdDtlList.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1182 grdDtlList.Width = 2407;
1183 grdDtlList.Height = 1498;
1184 grdDtlList.Text = "";
1185 grdDtlList.EpiBinding = "OrderDtl";
1186 // ice.adapters.dynamicquery.dll
1187 // ice.contracts.bo.dynamicquery.dll
1188 // summaryPanel1
1189 var local7 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["006caf0c-d74d-4ec1-9d92-43eda1f2af96"];
1190 local7.Controls.Add(epiGroupBoxC3);
1191 local7.Controls.Add(epiGroupBoxC4);
1192 var local8 = (EpiButton)personalizeCustomizeManager.ControlsHT["ceda140d-f210-468c-9f89-02f79ba8055e"];
1193 local7.Controls.SetChildIndex(local8, 0);
1194 var local9 = (EpiCheckBox)personalizeCustomizeManager.ControlsHT["1161ef95-83de-4176-9160-0f78a4cf1e5e"];
1195 local7.Controls.SetChildIndex(local9, 1);
1196 var local10 = (EpiLabel)personalizeCustomizeManager.ControlsHT["c2a7cf5b-b3e3-42b4-9327-4f5c1ed3dc27"];
1197 local7.Controls.SetChildIndex(local10, 2);
1198 var local11 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["e0d06017-f282-4188-bc11-70ff28ca7547"];
1199 local7.Controls.SetChildIndex(local11, 6);
1200 local7.Controls.SetChildIndex(epiGroupBoxC4, 7);
1201 local7.Controls.SetChildIndex(epiGroupBoxC3, 8);
1202 var local12 = (EpiButton)personalizeCustomizeManager.ControlsHT["2791c90c-41ed-4b1c-9e75-953a350edf42"];
1203 local7.Controls.SetChildIndex(local12, 26);
1204 var local13 = EpiCustomSheetDesigner.GetDockableControlPane(local7, "006caf0c-d74d-4ec1-9d92-43eda1f2af96", nativeSheets);
1205 // epiGroupBoxC3
1206 epiGroupBoxC3.Top = 360;
1207 epiGroupBoxC3.Left = 430;
1208 epiGroupBoxC3.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1209 epiGroupBoxC3.Width = 148;
1210 epiGroupBoxC3.Height = 43;
1211 epiGroupBoxC3.Text = "Manufacture Site";
1212 epiGroupBoxC3.Controls.Add(epiLabelC9);
1213 epiGroupBoxC3.Controls.Add(baqComboC1);
1214 epiGroupBoxC3.Controls.SetChildIndex(baqComboC1, 0);
1215 epiGroupBoxC3.Controls.SetChildIndex(epiLabelC9, 1);
1216 // epiLabelC9
1217 epiLabelC9.Top = 16;
1218 epiLabelC9.Left = -1;
1219 epiLabelC9.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1220 epiLabelC9.Width = 31;
1221 epiLabelC9.Height = 20;
1222 epiLabelC9.Text = "Site:";
1223 // erp.adapters.plant.dll
1224 // epiLabelC10
1225 epiLabelC10.Top = 6;
1226 epiLabelC10.Left = 12;
1227 epiLabelC10.Width = 132;
1228 epiLabelC10.Height = 20;
1229 epiLabelC10.Text = "Contact Search Type:";
1230 // cmbSearchType
1231 cmbSearchType.Top = 6;
1232 cmbSearchType.Left = 150;
1233 cmbSearchType.Width = 252;
1234 cmbSearchType.Text = "";
1235 cmbSearchType.EpiLabel = "epiLabelC10";
1236 cmbSearchType.DataSource = new string[] {"3 Character Last Name Auto Search", "Button Click Search"};
1237 // grpHeaderData
1238 local11.Width = 415;
1239 local11.Height = 185;
1240 local11.Controls.Add(epiLabelC11);
1241 local11.Controls.Add(epiTextBoxC5);
1242 local11.Controls.Add(txtCustomerPONum);
1243 local11.Controls.Add(lblCustomerPONum);
1244 local11.Controls.Add(txtCarrierAcctNo);
1245 local11.Controls.Add(epiLabelSalesRepCode1);
1246 local11.Controls.Add(epiTextBoxSalesRepCode1);
1247 local11.Controls.Add(lblReceivedDate);
1248 local11.Controls.Add(epiDateTimeEditorC2);
1249 local11.Controls.Add(lblFitTech);
1250 local11.Controls.Add(cboFitTech);
1251 local11.Controls.SetChildIndex(txtCustomerPONum, 0);
1252 local11.Controls.SetChildIndex(lblFitTech, 0);
1253 local11.Controls.SetChildIndex(cboFitTech, 0);
1254 local11.Controls.SetChildIndex(epiLabelC11, 1);
1255 local11.Controls.SetChildIndex(epiTextBoxC5, 1);
1256 local11.Controls.SetChildIndex(lblCustomerPONum, 1);
1257 local11.Controls.SetChildIndex(txtCarrierAcctNo, 1);
1258 local11.Controls.SetChildIndex(epiLabelSalesRepCode1, 1);
1259 local11.Controls.SetChildIndex(epiTextBoxSalesRepCode1, 1);
1260 local11.Controls.SetChildIndex(lblReceivedDate, 1);
1261 local11.Controls.SetChildIndex(epiDateTimeEditorC2, 1);
1262 // epiLabelC11
1263 epiLabelC11.Top = 134;
1264 epiLabelC11.Left = 11;
1265 epiLabelC11.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1266 epiLabelC11.Width = 90;
1267 epiLabelC11.Height = 20;
1268 epiLabelC11.Text = "Opportunity #:";
1269 // epiTextBoxC5
1270 epiTextBoxC5.Top = 134;
1271 epiTextBoxC5.Left = 106;
1272 epiTextBoxC5.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1273 epiTextBoxC5.Width = 87;
1274 epiTextBoxC5.Height = 20;
1275 epiTextBoxC5.Text = "";
1276 epiTextBoxC5.EpiBinding = "OrderHed.OpportunityNum_c";
1277 epiTextBoxC5.EpiLabel = "epiLabelC11";
1278 // headerPanel1
1279 var local14 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["4f74bb83-3b2c-422e-8743-696989560c58"];
1280 local14.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1281 local14.Width = 1447;
1282 local14.Height = 634;
1283 local14.Controls.Add(txtQuery);
1284 local14.Controls.Add(epiGroupBoxC5);
1285 local14.Controls.SetChildIndex(epiGroupBoxC5, 0);
1286 local14.Controls.SetChildIndex(txtQuery, 1);
1287 var local15 = EpiCustomSheetDesigner.GetDockableControlPane(local14, "4f74bb83-3b2c-422e-8743-696989560c58", nativeSheets);
1288 // grpHeaderData
1289 var local16 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["924845d8-1071-4d07-be20-c367f6bff8d9"];
1290 local16.Controls.Add(epiLabelC12);
1291 local16.Controls.Add(epiTextBoxC6);
1292 local16.Controls.SetChildIndex(epiLabelC12, 0);
1293 local16.Controls.SetChildIndex(epiTextBoxC6, 0);
1294 // epiLabelC12
1295 epiLabelC12.Top = 128;
1296 epiLabelC12.Left = 15;
1297 epiLabelC12.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1298 epiLabelC12.Width = 84;
1299 epiLabelC12.Height = 20;
1300 epiLabelC12.Text = "Opportunity #:";
1301 // epiTextBoxC6
1302 epiTextBoxC6.Top = 128;
1303 epiTextBoxC6.Left = 105;
1304 epiTextBoxC6.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1305 epiTextBoxC6.Width = 144;
1306 epiTextBoxC6.Height = 20;
1307 epiTextBoxC6.Text = "";
1308 epiTextBoxC6.EpiBinding = "OrderHed.OpportunityNum_c";
1309 epiTextBoxC6.EpiLabel = "epiLabelC12";
1310 // epiLabelC1comp
1311 epiLabelC1comp.Top = 37;
1312 epiLabelC1comp.Left = 447;
1313 epiLabelC1comp.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1314 epiLabelC1comp.Width = 64;
1315 epiLabelC1comp.Height = 20;
1316 epiLabelC1comp.Text = "Company:";
1317 // txtCorpName
1318 txtCorpName.Top = 37;
1319 txtCorpName.Left = 517;
1320 txtCorpName.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1321 txtCorpName.Width = 111;
1322 txtCorpName.Height = 20;
1323 txtCorpName.Text = "";
1324 txtCorpName.EpiBinding = "";
1325 txtCorpName.EpiLabel = "epiLabelC1comp";
1326 // epiLabelC13co
1327 epiLabelC13co.Top = 41;
1328 epiLabelC13co.Left = 518;
1329 epiLabelC13co.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1330 epiLabelC13co.Width = 80;
1331 epiLabelC13co.Height = 20;
1332 epiLabelC13co.Text = "Company:";
1333 // epiTextBoxC7co
1334 epiTextBoxC7co.Top = 41;
1335 epiTextBoxC7co.Left = 604;
1336 epiTextBoxC7co.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1337 epiTextBoxC7co.Width = 167;
1338 epiTextBoxC7co.Height = 20;
1339 epiTextBoxC7co.Text = "";
1340 epiTextBoxC7co.EpiBinding = "OrderDtl.PerConCorpName_c";
1341 epiTextBoxC7co.EpiLabel = "epiLabelC13co";
1342 // erp.contracts.bo.custcnt.dll
1343 // epiGroupBoxC4
1344 epiGroupBoxC4.Top = 24;
1345 epiGroupBoxC4.Left = 826;
1346 epiGroupBoxC4.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1347 epiGroupBoxC4.Width = 307;
1348 epiGroupBoxC4.Height = 379;
1349 epiGroupBoxC4.Text = "Customer Comments";
1350 epiGroupBoxC4.Controls.Add(txtCustomerComments);
1351 epiGroupBoxC4.Controls.SetChildIndex(txtCustomerComments, 0);
1352 // txtCustomerComments
1353 txtCustomerComments.Top = 0;
1354 txtCustomerComments.Left = 0;
1355 txtCustomerComments.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1356 txtCustomerComments.Width = 0;
1357 txtCustomerComments.Height = 0;
1358 txtCustomerComments.Text = "";
1359 txtCustomerComments.EpiBinding = "OrderHed.CommentsFromCustomer_c";
1360 txtCustomerComments.EpiContextMenuKey = "";
1361 txtCustomerComments.Multiline = true;
1362 // baqComboC1
1363 baqComboC1.Top = 16;
1364 baqComboC1.Left = 36;
1365 baqComboC1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1366 baqComboC1.Width = 101;
1367 baqComboC1.Text = "";
1368 baqComboC1.EpiBinding = "OrderHed.OrderSite_c";
1369 baqComboC1.EpiLabel = "epiLabelC9";
1370 baqComboC1.DisplayMember = "Plant.Name";
1371 baqComboC1.DynamicQueryID = "CPEPlants";
1372 baqComboC1.ValueMember = "Plant.Plant";
1373 // btnRefreshContact
1374 btnRefreshContact.Top = 15;
1375 btnRefreshContact.Left = 604;
1376 btnRefreshContact.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1377 btnRefreshContact.Width = 168;
1378 btnRefreshContact.Height = 20;
1379 btnRefreshContact.Text = "Refresh Contact";
1380 // txtCustomerPONum
1381 txtCustomerPONum.Top = 15;
1382 txtCustomerPONum.Left = 319;
1383 txtCustomerPONum.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1384 txtCustomerPONum.Width = 89;
1385 txtCustomerPONum.Height = 20;
1386 txtCustomerPONum.Visible = false;
1387 txtCustomerPONum.Text = "";
1388 txtCustomerPONum.EpiBinding = "OrderHed.CustomerPONum_c";
1389 txtCustomerPONum.EpiLabel = "epiLabelC13";
1390 // lblCustomerPONum
1391 lblCustomerPONum.Top = 15;
1392 lblCustomerPONum.Left = 197;
1393 lblCustomerPONum.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1394 lblCustomerPONum.Width = 116;
1395 lblCustomerPONum.Height = 20;
1396 lblCustomerPONum.Visible = false;
1397 lblCustomerPONum.Text = "PEUS Cust PO:";
1398 // txtQuery
1399 txtQuery.Top = 53;
1400 txtQuery.Left = 866;
1401 txtQuery.Width = 416;
1402 txtQuery.Height = 413;
1403 txtQuery.Visible = false;
1404 txtQuery.Text = "****";
1405 txtQuery.Multiline = true;
1406 // epiGroupBoxC5
1407 epiGroupBoxC5.Top = 559;
1408 epiGroupBoxC5.Left = 10;
1409 epiGroupBoxC5.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1410 epiGroupBoxC5.Width = 795;
1411 epiGroupBoxC5.Height = 49;
1412 epiGroupBoxC5.Text = "Override PriceList";
1413 epiGroupBoxC5.Controls.Add(epiLabelC14);
1414 epiGroupBoxC5.Controls.Add(cmbHeaderPriceList);
1415 epiGroupBoxC5.Controls.SetChildIndex(epiLabelC14, 0);
1416 epiGroupBoxC5.Controls.SetChildIndex(cmbHeaderPriceList, 0);
1417 // epiLabelC14
1418 epiLabelC14.Top = 16;
1419 epiLabelC14.Left = 86;
1420 epiLabelC14.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1421 epiLabelC14.Width = 159;
1422 epiLabelC14.Height = 20;
1423 epiLabelC14.Text = "Set Price List on All Rows:";
1424 // cmbHeaderPriceList
1425 cmbHeaderPriceList.Top = 16;
1426 cmbHeaderPriceList.Left = 251;
1427 cmbHeaderPriceList.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1428 cmbHeaderPriceList.Width = 259;
1429 cmbHeaderPriceList.Text = "";
1430 cmbHeaderPriceList.EpiBinding = "OrderHed.HeaderPriceList_c";
1431 cmbHeaderPriceList.EpiLabel = "epiLabelC14";
1432 cmbHeaderPriceList.AutoWidth = false;
1433 cmbHeaderPriceList.AutoWidthOption = (AutoWidthOptions)1;
1434 // epiTextBoxC7
1435 epiTextBoxC7.Top = 40;
1436 epiTextBoxC7.Left = 390;
1437 epiTextBoxC7.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1438 epiTextBoxC7.Width = 111;
1439 epiTextBoxC7.Height = 23;
1440 epiTextBoxC7.Text = "epiTextBoxC7";
1441 epiTextBoxC7.EpiBinding = "OrderDtl.EmployeeNum_c";
1442 epiTextBoxC7.EpiLabel = "epiLabelC8";
1443 // txtCarrierAcctNo
1444 txtCarrierAcctNo.Top = 111;
1445 txtCarrierAcctNo.Left = 290;
1446 txtCarrierAcctNo.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1447 txtCarrierAcctNo.Width = 117;
1448 txtCarrierAcctNo.Height = 21;
1449 txtCarrierAcctNo.Text = "";
1450 txtCarrierAcctNo.EpiBinding = "OrderHed.CurrierAccountNum_c";
1451 // epiLabelSalesRepCode1
1452 epiLabelSalesRepCode1.Top = 136;
1453 epiLabelSalesRepCode1.Left = 207;
1454 epiLabelSalesRepCode1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1455 epiLabelSalesRepCode1.Width = 79;
1456 epiLabelSalesRepCode1.Height = 14;
1457 epiLabelSalesRepCode1.Text = "Sales Rep:";
1458 // epiTextBoxSalesRepCode1
1459 epiTextBoxSalesRepCode1.Top = 136;
1460 epiTextBoxSalesRepCode1.Left = 291;
1461 epiTextBoxSalesRepCode1.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1462 epiTextBoxSalesRepCode1.Width = 117;
1463 epiTextBoxSalesRepCode1.Height = 19;
1464 epiTextBoxSalesRepCode1.Text = "";
1465 epiTextBoxSalesRepCode1.EpiBinding = "";
1466 epiTextBoxSalesRepCode1.EpiLabel = "epiLabelSalesRepCode1";
1467 epiTextBoxSalesRepCode1.ReadOnly = true;
1468 // lblReceivedDate
1469 lblReceivedDate.Top = 157;
1470 lblReceivedDate.Left = 3;
1471 lblReceivedDate.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1472 lblReceivedDate.Width = 97;
1473 lblReceivedDate.Height = 15;
1474 lblReceivedDate.Text = "Received Date:";
1475 // epiDateTimeEditorC2
1476 epiDateTimeEditorC2.Top = 157;
1477 epiDateTimeEditorC2.Left = 106;
1478 epiDateTimeEditorC2.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1479 epiDateTimeEditorC2.Width = 87;
1480 epiDateTimeEditorC2.EpiBinding = "OrderHed.ReceivedDate_c";
1481 epiDateTimeEditorC2.EpiLabel = "lblReceivedDate";
1482 // lblFitTech
1483 lblFitTech.Top = 163;
1484 lblFitTech.Left = 208;
1485 lblFitTech.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1486 lblFitTech.Width = 77;
1487 lblFitTech.Height = 9;
1488 lblFitTech.Text = "Fit Tech:";
1489 // cboFitTech
1490 cboFitTech.Top = 159;
1491 cboFitTech.Left = 291;
1492 cboFitTech.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1493 cboFitTech.Width = 117;
1494 cboFitTech.Text = "";
1495 cboFitTech.EpiBinding = "OrderHed.FitTechCode_c";
1496 cboFitTech.EpiLabel = "lblFitTech";
1497 cboFitTech.AutoWidth = false;
1498 cboFitTech.AutoWidthOption = (AutoWidthOptions)1;
1499 cboFitTech.DisplayMember = "Name";
1500 cboFitTech.EpiBOName = "Erp:BO:UserFile";
1501 cboFitTech.EpiColumns = new string[] {"Name"};
1502 cboFitTech.EpiSort = "Name";
1503 cboFitTech.EpiTableName = "UserFileList";
1504 cboFitTech.ValueMember = "DcdUserID";
1505 cboFitTech.EpiAltSearchMethod = "";
1506 // SalesOrderForm
1507 var local17 = (EpiBaseForm)personalizeCustomizeManager.ControlsHT["2dcd1674-5e34-4d98-b493-c75747027376"];
1508 local17.Top = 96;
1509 local17.Left = 224;
1510 local17.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1511 local17.Width = 1536;
1512 local17.Height = 803;
1513 local17.Font = new Font("Microsoft Sans Serif", 8.25F);
1514 local17.Text = "Sales Order Entry";
1515 // lblJobType
1516 var local18 = (EpiLabel)personalizeCustomizeManager.ControlsHT["12a90401-e916-4487-99be-3239e9af9335"];
1517 local18.Top = 181;
1518 local18.Left = 580;
1519 // grpDetail3
1520 var local19 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["4447f9c5-dd5e-4611-ac51-1ef9a95a98da"];
1521 local19.Top = 583;
1522 local19.Left = 7;
1523 // lineListPanel1
1524 var local20 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["7e4a739e-ffeb-40ae-a6a3-db0479295425"];
1525 local20.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1526 local20.Width = 1457;
1527 local20.Height = 695;
1528 var local21 = (EpiUltraGrid)personalizeCustomizeManager.ControlsHT["4dd0227a-9d85-4d3d-a876-6cf4ea34695b"];
1529 local20.Controls.SetChildIndex(local21, 0);
1530 var local22 = EpiCustomSheetDesigner.GetDockableControlPane(local20, "7e4a739e-ffeb-40ae-a6a3-db0479295425", nativeSheets);
1531 // lineCommissionsPanel1
1532 var local23 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["6c823cb2-baf8-4d50-bbb1-052848f578a7"];
1533 local23.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1534 local23.Width = 1449;
1535 local23.Height = 683;
1536 var local24 = EpiCustomSheetDesigner.GetDockableControlPane(local23, "6c823cb2-baf8-4d50-bbb1-052848f578a7", nativeSheets);
1537 // summaryDetailPanel1
1538 var local25 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["2c1407c1-7dd7-44d7-b306-a6020a279073"];
1539 var local26 = (EpiUltraGrid)personalizeCustomizeManager.ControlsHT["bec51417-b286-4d61-a471-3912bc098905"];
1540 local25.Controls.SetChildIndex(local26, 0);
1541 var local27 = EpiCustomSheetDesigner.GetDockableControlPane(local25, "2c1407c1-7dd7-44d7-b306-a6020a279073", nativeSheets);
1542 // grdSummaryOrderLines
1543 local26.Font = new Font("Microsoft Sans Serif", 8.25F);
1544 // grpCounterSale
1545 var local28 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["074dd791-284f-4df2-9165-f11af41dab21"];
1546 local28.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1547 local28.Width = 148;
1548 local28.Height = 93;
1549 // releaseDetailPanel1
1550 var local29 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["c8990e33-8c1f-4ae6-9976-e72e0f05e624"];
1551 local29.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1552 local29.Width = 1449;
1553 local29.Height = 683;
1554 var local30 = EpiCustomSheetDesigner.GetDockableControlPane(local29, "c8990e33-8c1f-4ae6-9976-e72e0f05e624", nativeSheets);
1555 // grpFrom
1556 var local31 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["8a2c0fc1-a491-48f3-b8fb-a9d0a336158a"];
1557 // lblPlant
1558 var local32 = (EpiLabel)personalizeCustomizeManager.ControlsHT["628dba0a-a8e9-4f98-b493-bf27fa19a5db"];
1559 local32.Top = 18;
1560 local32.Left = 6;
1561 local32.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1562 local32.Width = 114;
1563 local32.Height = 20;
1564 // lblRequestDate
1565 var local33 = (EpiLabel)personalizeCustomizeManager.ControlsHT["fed57e91-8de4-4223-8f78-4ca23a37641e"];
1566 local33.Top = 86;
1567 local33.Left = 4;
1568 local33.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1569 local33.Width = 96;
1570 local33.Height = 20;
1571 // lblRequestDate
1572 var local34 = (EpiLabel)personalizeCustomizeManager.ControlsHT["c57493fd-cb1e-48e6-8d79-46a674a25a0f"];
1573 local34.Top = 79;
1574 local34.Left = 0;
1575 local34.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1576 local34.Width = 92;
1577 local34.Height = 24;
1578 // btnPlanContract
1579 var local35 = (EpiButton)personalizeCustomizeManager.ControlsHT["dfa1f52e-76bd-4ce2-b7a7-2fec99d5d283"];
1580 local35.Top = 263;
1581 local35.Left = 513;
1582 // txtContractID
1583 var local36 = (EpiTextBox)personalizeCustomizeManager.ControlsHT["591bd649-bd34-4178-9e05-94b8bef9d350"];
1584 local36.Top = 277;
1585 local36.Left = 591;
1586 // lblLinkToContract
1587 var local37 = (EpiLabel)personalizeCustomizeManager.ControlsHT["007a6ffd-d13f-4e29-8e58-730aef7efed8"];
1588 local37.Top = 282;
1589 local37.Left = 563;
1590 // grpSoldTo
1591 var local38 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["14b3c788-ec83-4bb0-8f68-bc8dde4773b9"];
1592 // txtCustomerCustID
1593 var local39 = (EpiTextBox)personalizeCustomizeManager.ControlsHT["7ece91c9-dc93-4df4-9591-f6cad7562b71"];
1594 local39.EpiBinding = "OrderHed.CustomerCustID";
1595 // lblAutoOrderBasedDisc
1596 var local40 = (EpiLabel)personalizeCustomizeManager.ControlsHT["0b064d61-6bd2-4e60-aad8-f4456aca39ac"];
1597 local40.Top = 66;
1598 local40.Left = 435;
1599 local40.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1600 local40.Width = 113;
1601 local40.Height = 25;
1602 local40.Text = "Apply Order Based Discounts Auto:";
1603 // lblPONum
1604 var local41 = (EpiLabel)personalizeCustomizeManager.ControlsHT["a7a229f8-199f-46f6-9a38-14190da030e5"];
1605 local41.Top = 14;
1606 local41.Left = 25;
1607 local41.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1608 local41.Width = 75;
1609 local41.Height = 20;
1610 // lblERSOrder
1611 var local42 = (EpiLabel)personalizeCustomizeManager.ControlsHT["34e2a286-231b-442e-bae1-0d546288a1ab"];
1612 local42.Top = 42;
1613 local42.Left = 469;
1614 local42.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1615 local42.Width = 80;
1616 local42.Height = 14;
1617 // chkERSORder
1618 var local43 = (EpiCheckBox)personalizeCustomizeManager.ControlsHT["1fff7a5b-06fe-4268-9af8-1319da1dd662"];
1619 local43.Top = 42;
1620 local43.Left = 555;
1621 // grdLineList
1622 local21.Font = new Font("Microsoft Sans Serif", 8.25F);
1623 // lblOverridePriceList
1624 var local44 = (EpiLabel)personalizeCustomizeManager.ControlsHT["bc019cdf-e8a6-4eb9-b16e-52a345748f10"];
1625 local44.Top = 107;
1626 local44.Left = 21;
1627 local44.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1628 local44.Width = 164;
1629 local44.Height = 20;
1630 // lblDiscountPercent
1631 var local45 = (EpiLabel)personalizeCustomizeManager.ControlsHT["742c5375-4ef6-4665-80f0-99bcb66b1dfb"];
1632 local45.Text = "CarrierAcctNo";
1633 // nbrDiscountPercent
1634 var local46 = (EpiNumericEditor)personalizeCustomizeManager.ControlsHT["198ed247-d15b-48dd-b4d3-123938a8edd2"];
1635 local46.ReadOnly = true;
1636 local46.Visible = false;
1637 local46.EpiBinding = "OrderHed.DiscountPercent";
1638 local46.Nullable = true;
1639 // lblInvcOrderCmp
1640 var local47 = (EpiLabel)personalizeCustomizeManager.ControlsHT["2088d7c9-1d97-4f63-9a41-a8818228a253"];
1641 local47.Top = 119;
1642 local47.Left = 450;
1643 local47.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1644 local47.Width = 85;
1645 local47.Height = 33;
1646 local47.Visible = false;
1647 // chkInvcOrderCmp
1648 var local48 = (EpiCheckBox)personalizeCustomizeManager.ControlsHT["e9a8647d-5dfd-4c15-a166-b20927994c05"];
1649 local48.Top = 140;
1650 local48.Left = 549;
1651 local48.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1652 local48.Width = 16;
1653 local48.Height = 17;
1654 // lblAutoPrint
1655 var local49 = (EpiLabel)personalizeCustomizeManager.ControlsHT["cad82bd7-9ce2-407b-a5ed-844edfdefea6"];
1656 local49.Top = 93;
1657 local49.Left = 446;
1658 local49.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1659 local49.Width = 102;
1660 local49.Height = 20;
1661 // ckbAutoOrderBasedDisc
1662 var local50 = (EpiCheckBox)personalizeCustomizeManager.ControlsHT["d0f20109-36b9-4758-8c72-b82532c34806"];
1663 local50.Top = 66;
1664 local50.Left = 554;
1665 // chkAutoPrint
1666 var local51 = (EpiCheckBox)personalizeCustomizeManager.ControlsHT["561bce08-8e63-455a-a453-5b15ae05100e"];
1667 local51.Top = 93;
1668 local51.Left = 554;
1669 // btnCounterSale
1670 local8.Top = 320;
1671 local8.Left = 428;
1672 local8.Width = 148;
1673 local8.Height = 22;
1674 // btnQuickJob
1675 local12.Top = 126;
1676 local12.Left = 913;
1677 local12.Visible = true;
1678 // hedSalesPersonPanel1
1679 var local52 = (EpiBasePanel)personalizeCustomizeManager.ControlsHT["4fef8b01-7269-47eb-bee9-f8b637e8d7ce"];
1680 local52.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1681 local52.Width = 1447;
1682 local52.Height = 634;
1683 var local53 = EpiCustomSheetDesigner.GetDockableControlPane(local52, "4fef8b01-7269-47eb-bee9-f8b637e8d7ce", nativeSheets);
1684 // grpSummary
1685 var local54 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["a003549e-312f-4364-9b9e-660b25e6e358"];
1686 // currTotalCharges
1687 var local55 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["39322272-56fb-4764-8038-29c1c044f213"];
1688 local55.Font = new Font("Microsoft Sans Serif", 8.25F);
1689 local55.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1690 local55.Width = 140;
1691 local55.Height = 21;
1692 // currTotalMiscellaneous
1693 var local56 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["353891e4-5199-4cf3-b956-00c56e99ec19"];
1694 local56.Font = new Font("Microsoft Sans Serif", 8.25F);
1695 local56.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1696 local56.Width = 140;
1697 local56.Height = 21;
1698 // curTotalTax
1699 var local57 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["ac863e2a-9dc1-49e1-b20d-d7600ffc47b8"];
1700 local57.Font = new Font("Microsoft Sans Serif", 8.25F);
1701 local57.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1702 local57.Width = 140;
1703 local57.Height = 21;
1704 // currRounding
1705 var local58 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["95835344-cff5-4e35-ac3b-c13cd769ccb0"];
1706 local58.Font = new Font("Microsoft Sans Serif", 8.25F);
1707 local58.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1708 local58.Width = 140;
1709 local58.Height = 21;
1710 // currTotalOrder
1711 var local59 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["c7457526-103e-4f8a-a194-c08416968354"];
1712 local59.Font = new Font("Microsoft Sans Serif", 8.25F);
1713 local59.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1714 local59.Width = 140;
1715 local59.Height = 21;
1716 // currTotalDiscount
1717 var local60 = (EpiCurrencyConver)personalizeCustomizeManager.ControlsHT["d5fdc384-6237-4e89-8a4a-7a5ce57ba39f"];
1718 local60.Font = new Font("Microsoft Sans Serif", 8.25F);
1719 local60.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1720 local60.Width = 80;
1721 local60.Height = 21;
1722 local60.Visible = false;
1723 // lblTotalDiscount
1724 var local61 = (EpiLabel)personalizeCustomizeManager.ControlsHT["05f95d1e-1461-4cc3-bd7f-c7389beaa698"];
1725 local61.Top = 39;
1726 local61.Left = 1;
1727 local61.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1728 local61.Width = 96;
1729 local61.Height = 20;
1730 local61.Visible = false;
1731 // numTotalDiscount
1732 var local62 = (EpiNumericEditor)personalizeCustomizeManager.ControlsHT["7e987bef-a0a9-48d6-ab46-4854be02a595"];
1733 local62.Top = 39;
1734 local62.Left = 103;
1735 local62.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1736 local62.Width = 39;
1737 local62.Visible = false;
1738 local62.Nullable = true;
1739 // lblPercentage
1740 var local63 = (EpiLabel)personalizeCustomizeManager.ControlsHT["c16f33b9-c010-4694-9253-f115cbc793f9"];
1741 local63.Top = 39;
1742 local63.Left = 135;
1743 local63.Visible = false;
1744 // lblReadyToCalc
1745 local10.Top = 1;
1746 local10.Left = 200;
1747 local10.Width = 145;
1748 local10.Height = 20;
1749 // chkReadyToCalc
1750 // grpShipTo
1751 var local64 = (EpiGroupBox)personalizeCustomizeManager.ControlsHT["623033c5-a5c0-4b24-bdc6-362470a0ac41"];
1752 // lblShipToAddr
1753 var local65 = (EpiLabel)personalizeCustomizeManager.ControlsHT["a724efda-a8b9-4708-be55-d904c914504c"];
1754 local65.Top = 63;
1755 local65.Left = 48;
1756 local65.Anchor = AnchorStyles.Top|AnchorStyles.Left;
1757 local65.Width = 64;
1758 local65.Height = 20;
1759 // Finishing control initialization.
1760 topControl.FindForm().ResumeLayout();
1761 }
1762
1763 public void DestroyGlobalVariables() {
1764 epiLabelC1 = null;
1765 epiLabelC1_e3a135f9_5a5d_4acc_bdfa_903304760694 = null;
1766 epiLabelC2 = null;
1767 epiLabelC2_0ea5aad9_e947_423b_8fdc_9354006db4ff = null;
1768 epiLabel1 = null;
1769 epiLabel1_cff20c3e_2165_403f_9df6_10ecb182ecf3 = null;
1770 epiTextBoxC1 = null;
1771 epiTextBoxC1_d7452973_f266_4fb1_9f50_86176582bf24 = null;
1772 epiTextBoxC2 = null;
1773 epiTextBoxC2_176cff2f_225a_4610_94ef_000a2864cda0 = null;
1774 epiTextBoxC3 = null;
1775 epiTextBoxC3_99151df7_883c_4c1c_b485_d883b5081423 = null;
1776 epiGroupBoxC1 = null;
1777 epiGroupBoxC1_861c7222_896e_4323_89fa_dd2fc20e089d = null;
1778 empBasicComboC1 = null;
1779 empBasicComboC1_ac1ee53e_0b23_47f6_9769_6095c17c2044 = null;
1780 epiLabelC3 = null;
1781 epiLabelC3_99a98a01_c3ac_4fb5_8cea_fadec62a48d3 = null;
1782 btnSelectContact = null;
1783 btnSelectContact_083f1035_9ee3_4f28_a49b_e649a4b1ef07 = null;
1784 epiNumericEditorC1 = null;
1785 epiNumericEditorC1_ca7ed2c7_7441_4b16_993a_3e759df6558f = null;
1786 cmvPerConName = null;
1787 cmvPerConName_75b07942_9780_420a_9470_9f5d3b854bc1 = null;
1788 epiLabelC4 = null;
1789 epiLabelC4_0ba376e5_5be4_4241_9e59_ff6a202943c8 = null;
1790 cmbContactDOB = null;
1791 cmbContactDOB_15183d62_19c7_4a21_89fc_041569bddd1d = null;
1792 epiGroupBoxC2 = null;
1793 epiGroupBoxC2_d46d8466_975c_47d9_afd6_a3d209400a9c = null;
1794 epiLabelC5 = null;
1795 epiLabelC5_865e5065_22b0_400c_b0a4_aac02471dba6 = null;
1796 txtFirstName = null;
1797 txtFirstName_2be92edc_ff56_4b31_a15a_46e25fe59ed4 = null;
1798 epiLabelC6 = null;
1799 epiLabelC6_c8d16e2d_2cac_4ac8_899c_b51966821ec2 = null;
1800 epiLabelC7 = null;
1801 epiLabelC7_04b8564e_4197_41c2_906d_011c9b81350e = null;
1802 epiDateTimeEditorC1 = null;
1803 epiDateTimeEditorC1_d2a94790_bb2c_42df_a5a1_8e7a967e5e89 = null;
1804 btnCreateNewContact = null;
1805 btnCreateNewContact_78a10f50_af7a_44ef_9078_bc8a81137437 = null;
1806 epiTextBoxC4 = null;
1807 epiTextBoxC4_f14878e2_0e8d_403d_bd68_c354cfad6c54 = null;
1808 epiLabelC8 = null;
1809 epiLabelC8_b3ffbad4_d2a9_4122_b9a7_a6836107d70b = null;
1810 cmbEmployeeNum = null;
1811 cmbEmployeeNum_5dda1115_e352_4546_92de_bad715e5ea32 = null;
1812 epiLabelC1aa = null;
1813 epiLabelC1aa_93eb9282_d276_46dc_919c_83178d357010 = null;
1814 txtEmpNum = null;
1815 txtEmpNum_2332ab42_e00b_4339_960b_da0a8d8c6bec = null;
1816 Sheet1 = null;
1817 Sheet1_adbc0ab4_b441_46d9_ae92_b32960a53d07 = null;
1818 Sheet2 = null;
1819 Sheet2_7f5c5a31_d34c_412b_993d_8866b44f278b = null;
1820 Sheet3 = null;
1821 Sheet3_eaab0101_2d15_4678_921f_525edb65bf89 = null;
1822 grdDtlList = null;
1823 grdDtlList_71fd4fbb_38d8_4207_9712_0d8022341a17 = null;
1824 epiGroupBoxC3 = null;
1825 epiGroupBoxC3_cc88c880_a173_4547_bcc4_dc99c2a5aa86 = null;
1826 epiLabelC9 = null;
1827 epiLabelC9_2b32ec55_7087_4c0d_98a5_6dc5e01697f5 = null;
1828 epiLabelC10 = null;
1829 epiLabelC10_edfe3fa7_3d56_4630_a12e_5106ae6b95cf = null;
1830 cmbSearchType = null;
1831 cmbSearchType_d8a0cba0_fd0f_4655_b18e_6bc972dbe676 = null;
1832 epiLabelC11 = null;
1833 epiLabelC11_47617eef_27d0_44e7_bd5d_db99aaf795ce = null;
1834 epiTextBoxC5 = null;
1835 epiTextBoxC5_7fe56970_1ebf_4709_bb41_4ce0005dd485 = null;
1836 epiLabelC12 = null;
1837 epiLabelC12_a4c9459a_23f7_400a_80ac_d1ea51010626 = null;
1838 epiTextBoxC6 = null;
1839 epiTextBoxC6_96805b1c_337a_4eb5_b5cc_c08569d9ff7a = null;
1840 epiLabelC1comp = null;
1841 epiLabelC1comp_c32e2c43_2eda_4200_a86a_b7a364ae5070 = null;
1842 txtCorpName = null;
1843 txtCorpName_70602aa3_216f_4b49_bc86_f28916a00838 = null;
1844 epiLabelC13co = null;
1845 epiLabelC13co_a4790422_9982_4dc1_b067_ce54e766c1ca = null;
1846 epiTextBoxC7co = null;
1847 epiTextBoxC7co_b83d2486_c5a9_43c8_803b_8888683e7ee8 = null;
1848 epiGroupBoxC4 = null;
1849 epiGroupBoxC4_7f0f2080_5d48_4965_b198_b5abd21808ad = null;
1850 txtCustomerComments = null;
1851 txtCustomerComments_6f8f35a4_951a_4321_b607_409fdf473674 = null;
1852 baqComboC1 = null;
1853 baqComboC1_dbb6f21e_c202_4481_aecf_ec708f1c5cfc = null;
1854 btnRefreshContact = null;
1855 btnRefreshContact_e04e7880_2ecf_4f63_8982_39f691360c87 = null;
1856 txtCustomerPONum = null;
1857 txtCustomerPONum_687a17ed_1050_44f3_9aac_ae9c910aab0c = null;
1858 lblCustomerPONum = null;
1859 lblCustomerPONum_cfb06a0e_5891_4251_b9e6_6d73c38575bc = null;
1860 txtQuery = null;
1861 txtQuery_ff235923_b42a_41db_8183_05600a8a5e79 = null;
1862 epiGroupBoxC5 = null;
1863 epiGroupBoxC5_9b0aa4db_799b_4a8a_af54_f294666dfd04 = null;
1864 epiLabelC14 = null;
1865 epiLabelC14_cd4d20fa_be1f_426e_958d_425ac53e7084 = null;
1866 cmbHeaderPriceList = null;
1867 cmbHeaderPriceList_0efb8c61_d74c_46de_94f7_a33195f3a038 = null;
1868 epiTextBoxC7 = null;
1869 epiTextBoxC7_8361b0ff_09a4_4566_9a1d_1f895ae3d87e = null;
1870 txtCarrierAcctNo = null;
1871 txtCarrierAcctNo_6247443d_220c_4d04_a078_5769c79aafcf = null;
1872 epiLabelSalesRepCode1 = null;
1873 epiLabelSalesRepCode1_9db1e8fe_4bec_4711_9ddd_a5d404e5ce49 = null;
1874 epiTextBoxSalesRepCode1 = null;
1875 epiTextBoxSalesRepCode1_921c33db_2c1a_441f_8767_e80bffdfadde = null;
1876 lblReceivedDate = null;
1877 lblReceivedDate_d2bbe9d8_5c71_4e15_8185_b34234d2ff45 = null;
1878 epiDateTimeEditorC2 = null;
1879 epiDateTimeEditorC2_7e27ea24_2dcf_4418_b394_c35b9a76bd7b = null;
1880 lblFitTech = null;
1881 lblFitTech_56fbc65b_0811_403b_be99_f2d2b6901306 = null;
1882 cboFitTech = null;
1883 cboFitTech_57525ffd_72f8_4949_90b1_8b0fb4aaa065 = null;
1884 csm = null;
1885 oTrans = null;
1886 SalesOrderForm = null;
1887 baseToolbarsManager = null;
1888 OrderRel_Column = null;
1889 OrderRelTree_Row = null;
1890 OrderMsc_Column = null;
1891 OrderMsc_Row = null;
1892 QuoteDtlAttch_Column = null;
1893 AutoAttachQuoteDtl_Row = null;
1894 QuoteHedList_Column = null;
1895 QuoteHedList_Row = null;
1896 OrderHed_Column = null;
1897 OrderHed_Row = null;
1898 BookDtl_Column = null;
1899 BookDtl_Row = null;
1900 SerialNumberSearch_Column = null;
1901 SNS_Row = null;
1902 SaveOTSParams_Column = null;
1903 SaveOTS_Row = null;
1904 OrderHedList_Column = null;
1905 OrderHedList_Row = null;
1906 BpmData_Column = null;
1907 CallContextBpmData_Row = null;
1908 ccTable_Column = null;
1909 CreditTran2_Row = null;
1910 SalesKitPartInfo_Column = null;
1911 KitPartInfo_Row = null;
1912 OrderRel_Row = null;
1913 OrderDtlAttch_Column = null;
1914 AutoAttachOrderDtl_Row = null;
1915 AutoAttachSalesKits_Row = null;
1916 QuoteDtl_Column = null;
1917 QuoteDtl_Row = null;
1918 TaxConnectStatus_Column = null;
1919 TaxConnectStatus_Row = null;
1920 OrderRelTax_Column = null;
1921 OrdRelTax_Row = null;
1922 _Column = null;
1923 NoBoundField_Row = null;
1924 OrderDtl_Column = null;
1925 SalesKits_Row = null;
1926 OHOrderMsc_Column = null;
1927 OHOrderMsc_Row = null;
1928 Client_Column = null;
1929 CallContextClientData_Row = null;
1930 OrderDtlTree_Row = null;
1931 OrderHedUPS_Column = null;
1932 OrderHedUPS_Row = null;
1933 OrderDtl_Row = null;
1934 OrderRepComm_Column = null;
1935 OrderRepComm_Row = null;
1936 CreditTran_Column = null;
1937 CreditTran_Row = null;
1938 CopyNew_Row = null;
1939 HedTaxSum_Column = null;
1940 HedTaxSum_Row = null;
1941 JobProd_Column = null;
1942 JobProd_Row = null;
1943 OrderSched_Column = null;
1944 OrderSched_Row = null;
1945 QuoteQty_Column = null;
1946 QuoteQty_Row = null;
1947 PartSubs_Column = null;
1948 AlternatePart_Row = null;
1949 AutoAttachOrderDtlTree_Row = null;
1950 OrderHedAttch_Column = null;
1951 AutoAttachOrderHed_Row = null;
1952 QuoteHedAttch_Column = null;
1953 AutoAttachQuoteHed_Row = null;
1954 QuoteHed_Column = null;
1955 QuoteHed_Row = null;
1956 }
1957
1958 public static string[] GetTranslatableStrings() {
1959 return new string[] {
1960 "Cast:", "Left Mould:", "Right Mould:", "", "Contacts", "Employee:", "Person / Contact...", "DOB:", "New Contact", "First Name:", "Last Name:",
1961 "Create Contact and Select", "Employee Num:", "Emp Num:", "Order Line Entry", "List", "Detail", "Manufacture Site", "Site:", "Contact Search Type:", "Opportunity #:",
1962 "Company:", "Customer Comments", "Refresh Contact", "PEUS Cust PO:", "****", "Override PriceList", "Set Price List on All Rows:", "epiTextBoxC7", "Sales Rep:",
1963 "Received Date:", "Fit Tech:", "Sales Order Entry", "Apply Order Based Discounts Auto:", "CarrierAcctNo"
1964 };
1965 }
1966
1967 public static string GetStringByID(string id) {
1968 return "";
1969 }
1970
1971 // 6.5 Regrouped methods into region and cleaned up code for readability
1972 // 6.4 Add White Diamond and Pink Glitter as colors
1973 // 6.3 Changing 10103R/N colors and filters to match 10008N/R
1974 // 6.2 PO Required work
1975 // 6.1 Shrunk Summary fields on main page
1976 // 6.0 Ensuring all MessageBox.Show give verbose Messages
1977 // 5.9 Moved FitTech box and label Drop
1978 // -If partnum changes, verify that the selected colour and filters are valid. If not, clear the value and notify the user.
1979 // -PEU PO Num changed label to PEUS and make it disappear unless company = 200 and customer = 250
1980 // 5.8 Fixing Person Contact Update not refreshing properly
1981
1982 // ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
1983 // Begin Wizard Added Module Level Variables **
1984 EpiDataView edvOrderDtl;
1985 EpiBaseAdapter oTrans_ordAdapter;
1986 EpiDataView edvOrderRel;
1987 EpiDataView edvOrderHed;
1988 // End Wizard Added Module Level Variables **
1989 Hashtable m_hashCopyColumns;
1990 // Add Custom Module Level Variables Here **
1991 //DataTable m_dtDropDownTable;
1992 bool m_copying;
1993 ContactSearch m_ContactSearch;
1994 ContactSearch m_CastSearch;
1995 string m_custID = "";
1996 int m_custNum;
1997 readonly string m_version = "6.5";
1998 string m_shipToNum = "";
1999 readonly string m_targetCompany = "200";
2000 readonly string m_userName = "CANADAONLY";
2001 readonly string m_passWord = "Epicor";
2002 Session m_targetSession;
2003
2004 // ENV
2005 //string m_sysConfigFile = @"\\cpe-erp\ERP10.1.600.0Deployment\Client\Config\erp1016production.sysconfig";
2006 readonly string m_sysConfigFile = @"\\cpe-erp\ERP10.1.600.0Deployment\Client\Config\erp1016crp.sysconfig";
2007 readonly string SQLServer = "CPE-ERPSQL";
2008 readonly string SQLUser = "EpicorViews";
2009 readonly string SQLPass = "Ep1c0rViews";
2010 readonly string Database = "erp1016CRP";
2011
2012 #region Build Up / Tear Down
2013 public void InitializeCustomCode() {
2014 // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
2015 // Begin Wizard Added Variable Initialization
2016 edvOrderDtl = (EpiDataView)oTrans.EpiDataViews["OrderDtl"];
2017 edvOrderDtl.EpiViewNotification += edvOrderDtl_EpiViewNotification;
2018 OrderDtl_Column.ColumnChanged += OrderDtl_AfterFieldChange;
2019 oTrans_ordAdapter = (EpiBaseAdapter)csm.TransAdaptersHT["oTrans_ordAdapter"];
2020 oTrans_ordAdapter.BeforeAdapterMethod += oTrans_ordAdapter_BeforeAdapterMethod;
2021 OrderHed_Column.ColumnChanged += OrderHed_AfterFieldChange;
2022 edvOrderRel = (EpiDataView)oTrans.EpiDataViews["OrderRel"];
2023 OrderHed_Column.ColumnChanging += OrderHed_BeforeFieldChange;
2024 edvOrderHed = (EpiDataView)oTrans.EpiDataViews["OrderHed"];
2025 edvOrderHed.EpiViewNotification += edvOrderHed_EpiViewNotification;
2026 oTrans_ordAdapter.AfterAdapterMethod += oTrans_ordAdapter_AfterAdapterMethod;
2027 // End Wizard Added Variable Initialization
2028 // Begin Wizard Added Custom Method Calls
2029
2030 btnSelectContact.Click += btnSelectContact_Click;
2031 btnCreateNewContact.Click += btnCreateNewContact_Click;
2032 SetExtendedProperties();
2033 grdDtlList.BeforeRowInsert += grdDtlList_BeforeRowInsert;
2034 grdDtlList.ClickCellButton += grdDtlList_ClickCellButton;
2035 grdDtlList.CellChange += grdDtlList_CellChange;
2036 cmbSearchType.ValueChanged += cmbSearchType_ValueChanged;
2037 btnRefreshContact.Click += btnRefreshContact_Click;
2038 // End Wizard Added Custom Method Calls
2039 m_targetSession = new Session(m_userName, m_passWord, Session.LicenseType.EnterpriseProcessing, m_sysConfigFile);
2040 }
2041
2042 public void DestroyCustomCode() {
2043 // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
2044 // Begin Wizard Added Object Disposal
2045 btnSelectContact.Click -= btnSelectContact_Click;
2046 btnCreateNewContact.Click -= btnCreateNewContact_Click;
2047 edvOrderDtl.EpiViewNotification -= edvOrderDtl_EpiViewNotification;
2048 edvOrderDtl = null;
2049 OrderDtl_Column.ColumnChanged -= OrderDtl_AfterFieldChange;
2050 grdDtlList.BeforeRowInsert -= grdDtlList_BeforeRowInsert;
2051 oTrans_ordAdapter.BeforeAdapterMethod -= oTrans_ordAdapter_BeforeAdapterMethod;
2052 oTrans_ordAdapter = null;
2053 grdDtlList.ClickCellButton -= grdDtlList_ClickCellButton;
2054 grdDtlList.CellChange -= grdDtlList_CellChange;
2055 OrderHed_Column.ColumnChanged -= OrderHed_AfterFieldChange;
2056 edvOrderRel = null;
2057 OrderHed_Column.ColumnChanging -= OrderHed_BeforeFieldChange;
2058 cmbSearchType.ValueChanged -= cmbSearchType_ValueChanged;
2059 edvOrderHed.EpiViewNotification -= edvOrderHed_EpiViewNotification;
2060 edvOrderHed = null;
2061 oTrans_ordAdapter.AfterAdapterMethod -= oTrans_ordAdapter_AfterAdapterMethod;
2062 btnRefreshContact.Click -= btnRefreshContact_Click;
2063 // End Wizard Added Object Disposal
2064 // Begin Custom Code Disposal
2065 new Thread(() => {
2066 Thread.CurrentThread.IsBackground = true;
2067 /* run your code here */
2068 Thread.Sleep(3000);
2069 if (m_targetSession==null)
2070 return;
2071 m_targetSession.Dispose();
2072 m_targetSession = null;
2073 }).Start();
2074 // End Custom Code Disposal
2075 }
2076
2077 void SetVersionNumber() {
2078 SalesOrderForm.Text = SalesOrderForm.Text+" - Version "+m_version;
2079 }
2080
2081 void SetExtendedProperties() {
2082 // Begin Wizard Added EpiDataView Initialization
2083 // End Wizard Added EpiDataView Initialization
2084 // Begin Wizard Added Conditional Block
2085 if (edvOrderDtl.dataView.Table.Columns.Contains("PerConDropDown_c"))
2086 edvOrderDtl.dataView.Table.Columns["PerConDropDown_c"].ExtendedProperties["ReadOnly"] = true;
2087 if (edvOrderDtl.dataView.Table.Columns.Contains("PerConCorpName_c"))
2088 edvOrderDtl.dataView.Table.Columns["PerConCorpName_c"].ExtendedProperties["ReadOnly"] = true;
2089 if (edvOrderHed.dataView.Table.Columns.Contains("CommentsFromCustomer_c"))
2090 edvOrderHed.dataView.Table.Columns["CommentsFromCustomer_c"].ExtendedProperties["ReadOnly"] = true;
2091 // End Wizard Added Conditional Block
2092 }
2093 #endregion
2094
2095 #region UI Event Handlers
2096 void SalesOrderForm_Load(object sender, EventArgs args) {
2097 txtCustomerComments.Dock = DockStyle.Fill;
2098 try {
2099 SetHeaderPriceListDropDown(0, "");
2100 m_hashCopyColumns = new Hashtable();
2101 string[] columns = {
2102 "BoxNumber_c", "OpportunityNum_c", "PartNum", "SellingQuantity", "SalesUM", "PerConFirstName_c", "PerConLastName_c", "PerConDOB_c", "PerConID_c", "EmployeeNum_c",
2103 "DocUnitPrice", "Colour_c", "Filter_c", "CPE_MouldRight_c", "CPE_MouldLeft_c", "CPE_Cast_c", "PerCon_c", "PerConCorpName_c"
2104 };
2105 foreach (var column in columns)
2106 m_hashCopyColumns.Add(column.ToLower(), 0);
2107 m_ContactSearch = new ContactSearch("Person // Contact");
2108
2109 m_ContactSearch.Icon = SalesOrderForm.Icon;
2110
2111 m_CastSearch = new ContactSearch("Cast Number");
2112 m_CastSearch.Icon = SalesOrderForm.Icon;
2113 } catch (Exception ex) {
2114 MessageBox.Show("SalesOrderForm_Load1 error: "+ex.Message);
2115 }
2116
2117 SetVersionNumber();
2118 grdDtlList.Dock = DockStyle.Fill;
2119 SetGridDropDown(grdDtlList, "SalesUM", "CPEUOM");
2120
2121 var dtSearch = new DataTable();
2122 dtSearch.Columns.Add("Value");
2123 dtSearch.Columns.Add("Display");
2124 var newRow = dtSearch.NewRow();
2125 newRow["Value"] = "Auto3";
2126 newRow["Display"] = "3 Character Last Name Auto Search";
2127 dtSearch.Rows.Add(newRow);
2128 newRow = dtSearch.NewRow();
2129 newRow["Value"] = "GridButton";
2130 newRow["Display"] = "Button Click Search";
2131 dtSearch.Rows.Add(newRow);
2132 cmbSearchType.DataSource = dtSearch;
2133 cmbSearchType.ValueMember = "Value";
2134 cmbSearchType.DisplayMember = "Display";
2135 cmbSearchType.Value = "GridButton";
2136 grdDtlList.DisplayLayout.Bands[0].Columns["Search_c"].Hidden = false;
2137
2138 try {
2139 grdDtlList.DisplayLayout.Bands[0].Columns["Copy_c"].Style = ColumnStyle.Button;
2140 grdDtlList.DisplayLayout.Bands[0].Columns["Copy_c"].ButtonDisplayStyle = ButtonDisplayStyle.Always;
2141
2142 grdDtlList.DisplayLayout.Bands[0].Columns["Search_c"].Style = ColumnStyle.Button;
2143 grdDtlList.DisplayLayout.Bands[0].Columns["Search_c"].ButtonDisplayStyle = ButtonDisplayStyle.Always;
2144
2145 grdDtlList.DisplayLayout.Bands[0].Columns["New_c"].Style = ColumnStyle.Button;
2146 grdDtlList.DisplayLayout.Bands[0].Columns["New_c"].ButtonDisplayStyle = ButtonDisplayStyle.Always;
2147
2148 grdDtlList.DisplayLayout.Bands[0].Columns["CPE_Cast_c"].Style = ColumnStyle.Button;
2149 grdDtlList.DisplayLayout.Bands[0].Columns["CPE_Cast_c"].ButtonDisplayStyle = ButtonDisplayStyle.Always;
2150
2151 grdDtlList.DisplayLayout.Bands[0].Override.ButtonStyle = UIElementButtonStyle.Button3D;
2152 } catch (Exception ex) {
2153 MessageBox.Show("SalesOrderForm_Load2 error: "+ex.Message);
2154 }
2155 }
2156
2157 void btnSelectContact_Click(object sender, EventArgs args) {
2158 //MessageBox.Show("btnSelectContact_Click");
2159 var select = " select PerConID as PerConID, FirstName, LastName, DOB_c as DOB, EmployeeNum_c as EmployeeNum, CorpName as Company, Comment,"+
2160 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '1' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '3' "+
2161 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '5' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '7' "+
2162 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2163 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '4' "+
2164 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '6' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '8' "+
2165 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2166 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" plo.lotnum + '1-2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+
2167 " plo.lotnum + '3-4' "+" when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.lotnum + '5-6' "+
2168 " when plo.percon_7_8_c = dbo.percon.PerConID then "+" plo.lotnum + '7-8' "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+
2169 " plo.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo"+" , case when plo.percon_1_2_c = dbo.percon.PerConID then "+
2170 " plo.PerCon_1_2_Notes_c "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" plo.PerCon_3_4_Notes_c "+
2171 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.PerCon_5_6_Notes_c "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+
2172 " plo.PerCon_7_8_Notes_c "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+" plo.PerCon_9_10_Notes_c "+" else "+" '' "+" end "+
2173 " as Notes, "+" plo.ExpirationDate as ExpirationDate, "+" plo.lotnum as ExistingCast "+" from dbo.percon with (nolock) "+
2174 " left outer join dbo.partlot as plo on plo.company = dbo.percon.company and plo.ExpirationDate > GetDate() and ( plo.percon_1_2_c = PerConID or plo.percon_3_4_c = PerConID or plo.percon_5_6_c = PerConID or plo.percon_7_8_c = PerConID or plo.percon_9_10_c = PerConID) "+
2175 " where dbo.percon.company = '"+((Session)oTrans.Session).CompanyID+"' order by dbo.percon.perconid, ExistingCast ";
2176
2177 if (((Session)oTrans.Session).CompanyID!="200")
2178 select = " select pc.PerConID as PerConID, pc.FirstName, pc.LastName, pc.DOB_c as DOB, pc.EmployeeNum_c as EmployeeNum, pc.Comment, pc.CorpName as Company, "+
2179 " case when pl.percon_1_2_c = gpc.PerConID then "+" '1' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '3' "+
2180 " when pl.percon_5_6_c = gpc.PerConID then "+" '5' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '7' "+
2181 " when pl.percon_9_10_c = gpc.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2182 " case when pl.percon_1_2_c = gpc.PerConID then "+" '2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '4' "+
2183 " when pl.percon_5_6_c = gpc.PerConID then "+" '6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '8' "+
2184 " when pl.percon_9_10_c = gpc.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2185 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.lotnum + '1-2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" pl.lotnum + '3-4' "+
2186 " when pl.percon_5_6_c = gpc.PerConID then "+" pl.lotnum + '5-6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" pl.lotnum + '7-8' "+
2187 " when pl.percon_9_10_c = gpc.PerConID then "+" pl.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo, "+
2188 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.PerCon_1_2_Notes_c "+" when pl.percon_3_4_c = gpc.PerConID then "+
2189 " pl.PerCon_3_4_Notes_c "+" when pl.percon_5_6_c = gpc.PerConID then "+" pl.PerCon_5_6_Notes_c "+
2190 " when pl.percon_7_8_c = gpc.PerConID then "+" pl.PerCon_7_8_Notes_c "+" when pl.percon_9_10_c = gpc.PerConID then "+
2191 " pl.PerCon_9_10_Notes_c "+" else "+" '' "+" end as Notes , "+" pl.ExpirationDate as ExpirationDate, "+
2192 " pl.lotnum as ExistingCast "+" from dbo.percon as pc with (nolock) "+
2193 " join erp.glbpercon as gpc on '200' = gpc.company and gpc.GlbCompany = '"+((Session)oTrans.Session).CompanyID+
2194 "' and gpc.glbperconid = pc.perconid "+
2195 " left outer join dbo.PartLot as pl with (nolock)on pl.company = gpc.company and ( pl.percon_1_2_c = gpc.PerConID or "+
2196 " pl.percon_3_4_c = gpc.PerConID or pl.percon_5_6_c = gpc.PerConID or pl.percon_7_8_c = gpc.PerConID or pl.percon_9_10_c = gpc.PerConID) "+
2197 " where pc.company = '"+((Session)oTrans.Session).CompanyID+"' order by pc.perconid, pl.lotnum";
2198 //MessageBox.Show("262");
2199 txtQuery.Text += "262***********************************************262\n\n"+select;
2200 LaunchContactSearch(select);
2201 }
2202
2203 void btnCreateNewContact_Click(object sender, EventArgs args) {
2204 if (CheckContactExists(txtFirstName.Text.Trim(), epiTextBoxC4.Text.Trim(), epiDateTimeEditorC1.Value)==false) {
2205 CreateNewContact(txtFirstName.Text.Trim(), epiTextBoxC4.Text.Trim(), epiDateTimeEditorC1.Value, txtEmpNum.Text,
2206 Convert.ToString(edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustomerName"]),
2207 Convert.ToInt32(edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustNum"]));
2208 } else {
2209 txtFirstName.Text = "";
2210 epiTextBoxC4.Text = "";
2211 epiDateTimeEditorC1.Value = null;
2212 }
2213 }
2214
2215 void btnRefreshContact_Click(object sender, EventArgs args) {
2216 var select =
2217 string.Format(
2218 " select PerConID as PerConID, FirstName, LastName, DOB_c as DOB, EmployeeNum_c as EmployeeNum, CorpName as Company, Comment,"+
2219 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '1' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '3' "+
2220 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '5' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '7' "+
2221 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2222 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '4' "+
2223 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '6' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '8' "+
2224 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2225 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" plo.lotnum + '1-2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+
2226 " plo.lotnum + '3-4' "+" when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.lotnum + '5-6' "+
2227 " when plo.percon_7_8_c = dbo.percon.PerConID then "+" plo.lotnum + '7-8' "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+
2228 " plo.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo"+" , case when plo.percon_1_2_c = dbo.percon.PerConID then "+
2229 " plo.PerCon_1_2_Notes_c "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" plo.PerCon_3_4_Notes_c "+
2230 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.PerCon_5_6_Notes_c "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+
2231 " plo.PerCon_7_8_Notes_c "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+" plo.PerCon_9_10_Notes_c "+" else "+" '' "+
2232 " end "+" as Notes, "+" plo.ExpirationDate as ExpirationDate, "+" plo.lotnum as ExistingCast "+" from dbo.percon with (nolock) "+
2233 " left outer join dbo.partlot as plo on plo.company = dbo.percon.company and plo.ExpirationDate > GetDate() and ( plo.percon_1_2_c = PerConID or plo.percon_3_4_c = PerConID or plo.percon_5_6_c = PerConID or plo.percon_7_8_c = PerConID or plo.percon_9_10_c = PerConID) "+
2234 " where dbo.percon.company = '{0}' and dbo.percon.PerConId = {1} order by dbo.percon.perconid, ExistingCast ", ((Session)oTrans.Session).CompanyID,
2235 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"]);
2236
2237 if (((Session)oTrans.Session).CompanyID!="200")
2238 select =
2239 string.Format(
2240 " select pc.PerConID as PerConID, pc.FirstName, pc.LastName, pc.DOB_c as DOB, pc.EmployeeNum_c as EmployeeNum, pc.CorpName as Company, "+
2241 " case when pl.percon_1_2_c = gpc.PerConID then "+" '1' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '3' "+
2242 " when pl.percon_5_6_c = gpc.PerConID then "+" '5' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '7' "+
2243 " when pl.percon_9_10_c = gpc.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2244 " case when pl.percon_1_2_c = gpc.PerConID then "+" '2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '4' "+
2245 " when pl.percon_5_6_c = gpc.PerConID then "+" '6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '8' "+
2246 " when pl.percon_9_10_c = gpc.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2247 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.lotnum + '1-2' "+" when pl.percon_3_4_c = gpc.PerConID then "+
2248 " pl.lotnum + '3-4' "+" when pl.percon_5_6_c = gpc.PerConID then "+" pl.lotnum + '5-6' "+" when pl.percon_7_8_c = gpc.PerConID then "+
2249 " pl.lotnum + '7-8' "+" when pl.percon_9_10_c = gpc.PerConID then "+" pl.lotnum + '9-10' "+" else "+" '' "+
2250 " end as SerialNo, "+" case when pl.percon_1_2_c = gpc.PerConID then "+" pl.PerCon_1_2_Notes_c "+
2251 " when pl.percon_3_4_c = gpc.PerConID then "+" pl.PerCon_3_4_Notes_c "+" when pl.percon_5_6_c = gpc.PerConID then "+
2252 " pl.PerCon_5_6_Notes_c "+" when pl.percon_7_8_c = gpc.PerConID then "+" pl.PerCon_7_8_Notes_c "+
2253 " when pl.percon_9_10_c = gpc.PerConID then "+" pl.PerCon_9_10_Notes_c "+" else "+" '' "+" end as Notes , "+
2254 " pl.ExpirationDate as ExpirationDate, "+" pl.lotnum as ExistingCast "+" from dbo.percon as pc with (nolock) "+
2255 " join erp.glbpercon as gpc on '200' = gpc.company and gpc.GlbCompany = '{0}' and gpc.glbperconid = pc.perconid "+
2256 " left outer join dbo.PartLot as pl with (nolock)on pl.company = gpc.company and pl.expirationdate > Getdate() and ( (pl.percon_1_2_c = gpc.PerConID and gpc.perconid > 0 ) or "+
2257 " (pl.percon_3_4_c = gpc.PerConID and gpc.perconid > 0 ) or (pl.percon_5_6_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_7_8_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_9_10_c = gpc.PerConID and gpc.perconid > 0 ) ) "+
2258 " where pc.company = '{0}' and pc.PerConId = {1} order by pc.perconid, pl.lotnum", ((Session)oTrans.Session).CompanyID,
2259 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"]);
2260
2261 LaunchContactSearch(select);
2262 }
2263
2264 void cmbSearchType_ValueChanged(object sender, EventArgs args) {
2265 try {
2266 grdDtlList.DisplayLayout.Bands[0].Columns["Search_c"].Hidden = cmbSearchType.Value.ToString()=="Auto3";
2267 } catch (Exception ex) {
2268 DebugMsg(ex);
2269 }
2270 }
2271
2272 void grdDtlList_BeforeRowInsert(object sender, BeforeRowInsertEventArgs args) {
2273 // Event handling code generated by wizard.
2274 args.Cancel = true;
2275 oTrans.SetCurrentEvent(TransactionEvent.AddNewOnNewFromGrid);
2276 try {
2277 oTrans.GetNewOrderDtl();
2278 } catch (Exception ex) {
2279 DebugMsg(ex);
2280 }
2281 }
2282
2283 void grdDtlList_CellChange(object sender, CellEventArgs args) {
2284 try {
2285 var searchType = "Auto3";
2286 try {
2287 searchType = cmbSearchType.Value.ToString();
2288 } catch (Exception ex) {
2289 DebugMsg(ex);
2290 }
2291
2292 if (searchType!="Auto3")
2293 return;
2294 if (args.Cell.Column.Key!="PerConLastName_c")
2295 return;
2296 if (args.Cell.Text.Length!=3)
2297 return;
2298 args.Cell.Row.Cells["PerConFirstName_c"].Value = "";
2299 args.Cell.Row.Cells["PerConDOB_c"].Value = DBNull.Value;
2300 args.Cell.Row.Cells["EmployeeNum_c"].Value = "";
2301
2302 var select = " select PerConID as PerConID, FirstName, LastName, DOB_c as DOB, EmployeeNum_c as EmployeeNum, Comment, CorpName as Company, "+
2303 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '1' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '3' "+
2304 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '5' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '7' "+
2305 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2306 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '4' "+
2307 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '6' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '8' "+
2308 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2309 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" plo.lotnum + '1-2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+
2310 " plo.lotnum + '3-4' "+" when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.lotnum + '5-6' "+
2311 " when plo.percon_7_8_c = dbo.percon.PerConID then "+" plo.lotnum + '7-8' "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+
2312 " plo.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo, "+" case when plo.percon_1_2_c = dbo.percon.PerConID then "+
2313 " plo.PerCon_1_2_Notes_c "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" plo.PerCon_3_4_Notes_c "+
2314 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.PerCon_5_6_Notes_c "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+
2315 " plo.PerCon_7_8_Notes_c "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+" plo.PerCon_9_10_Notes_c "+" else "+" '' "+
2316 " end "+" as Notes, "+" plo.ExpirationDate as ExpirationDate, "+" plo.lotnum as ExistingCast "+" from dbo.percon with (nolock) "+
2317 " left outer join dbo.partlot as plo on plo.company = dbo.percon.company and plo.ExpirationDate > GetDate() and ( plo.percon_1_2_c = PerConID or plo.percon_3_4_c = PerConID or plo.percon_5_6_c = PerConID or plo.percon_7_8_c = PerConID or plo.percon_9_10_c = PerConID) "+
2318 " where dbo.percon.company = '"+((Session)oTrans.Session).CompanyID+"' and dbo.percon.LastName like '"+args.Cell.Text+
2319 "%' order by dbo.percon.perconid, ExistingCast ";
2320
2321 if (((Session)oTrans.Session).CompanyID!="200")
2322 select = " select pc.PerConID as PerConID, pc.FirstName, pc.LastName, pc.DOB_c as DOB, pc.EmployeeNum_c as EmployeeNum, pc.Comment, pc.CorpName as Company, "+
2323 " case when pl.percon_1_2_c = gpc.PerConID then "+" '1' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '3' "+
2324 " when pl.percon_5_6_c = gpc.PerConID then "+" '5' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '7' "+
2325 " when pl.percon_9_10_c = gpc.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2326 " case when pl.percon_1_2_c = gpc.PerConID then "+" '2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '4' "+
2327 " when pl.percon_5_6_c = gpc.PerConID then "+" '6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '8' "+
2328 " when pl.percon_9_10_c = gpc.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2329 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.lotnum + '1-2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" pl.lotnum + '3-4' "+
2330 " when pl.percon_5_6_c = gpc.PerConID then "+" pl.lotnum + '5-6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" pl.lotnum + '7-8' "+
2331 " when pl.percon_9_10_c = gpc.PerConID then "+" pl.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo, "+
2332 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.PerCon_1_2_Notes_c "+" when pl.percon_3_4_c = gpc.PerConID then "+
2333 " pl.PerCon_3_4_Notes_c "+" when pl.percon_5_6_c = gpc.PerConID then "+" pl.PerCon_5_6_Notes_c "+
2334 " when pl.percon_7_8_c = gpc.PerConID then "+" pl.PerCon_7_8_Notes_c "+" when pl.percon_9_10_c = gpc.PerConID then "+
2335 " pl.PerCon_9_10_Notes_c "+" else "+" '' "+" end as Notes , "+" pl.ExpirationDate as ExpirationDate, "+
2336 " pl.lotnum as ExistingCast "+" from dbo.percon as pc with (nolock) "+
2337 " join erp.glbpercon as gpc on '200' = gpc.company and gpc.GlbCompany = '"+((Session)oTrans.Session).CompanyID+
2338 "' and gpc.glbperconid = pc.perconid "+
2339 " left outer join dbo.PartLot as pl with (nolock)on pl.company = gpc.company and pl.expirationdate > Getdate() and ( ( pl.percon_1_2_c = gpc.PerConID and gpc.perconid > 0 ) or "+
2340 " ( pl.percon_3_4_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_5_6_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_7_8_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_9_10_c = gpc.PerConID and gpc.perconid > 0 ) ) "+
2341 " where pc.company = '"+((Session)oTrans.Session).CompanyID+"' and pc.LastName like '"+args.Cell.Text+"%' order by pc.perconid, pl.lotnum";
2342 LaunchContactSearch(select);
2343 } catch (Exception ex) {
2344 MessageBox.Show("Cell change error: "+ex.Message);
2345 }
2346 }
2347
2348 void grdDtlList_ClickCellButton(object sender, CellEventArgs args) {
2349 switch (args.Cell.Column.Key) {
2350 case "Copy_c":
2351 CopyFromPrevious(true);
2352 break;
2353 case "New_c":
2354 CopyFromPrevious(false);
2355 break;
2356 case "CPE_Cast_c": {
2357 if (!edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PartNum"].ToString().EndsWith("R"))
2358 return;
2359 var select =
2360 string.Format(
2361 "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', "+
2362 " case when PerCon_1_2_c = {0} then '1' when PerCon_3_4_c = {0} then '3' when PerCon_5_6_c = {0} then '5' when PerCon_7_8_c = {0} then '7' when PerCon_9_10_c = {0} then '9' else '' end as RightMould, "+
2363 " case when PerCon_1_2_c = {0} then '2' when PerCon_3_4_c = {0} then '4' when PerCon_5_6_c = {0} then '6' when PerCon_7_8_c = {0} then '8' when PerCon_9_10_c = {0} then '10' else '' end as LeftMould, "+
2364 " case when PerCon_1_2_c = {0} then lotnum + '1-2' when PerCon_3_4_c = {0} then lotnum + '3-4' when PerCon_5_6_c = {0} then lotnum + '5-6' when PerCon_7_8_c = {0} then lotnum + '7-8' when PerCon_9_10_c = {0} then lotnum + '9-10' else '' end as SerialNo, case when PerCon_1_2_c = {0} then PerCon_1_2_Notes_c when PerCon_3_4_c = {0} then PerCon_3_4_Notes_c when PerCon_5_6_c = {0} then PerCon_5_6_Notes_c when PerCon_7_8_c = {0} then PerCon_7_8_Notes_c when PerCon_9_10_c = {0} then PerCon_9_10_Notes_c else '' end as Notes from dbo.partlot where company = '{1}' and expirationdate > GETDATE() and ( PerCon_1_2_c = {0} or PerCon_3_4_c = {0} or PerCon_5_6_c = {0} or PerCon_7_8_c = {0} or PerCon_9_10_c = {0})",
2365 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"], ((Session)oTrans.Session).CompanyID);
2366 if (((Session)oTrans.Session).CompanyID=="250")
2367 select = "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', "+
2368 " case when PerCon_1_2_c = glb.perconid then '1' when PerCon_3_4_c = glb.perconid then '3' when PerCon_5_6_c = glb.perconid then '5' when PerCon_7_8_c = glb.perconid then '7' when PerCon_9_10_c = glb.perconid then '9' else '' end as RightMould, "+
2369 " case when PerCon_1_2_c = glb.perconid then '2' when PerCon_3_4_c = glb.perconid then '4' when PerCon_5_6_c = glb.perconid then '6' when PerCon_7_8_c = glb.perconid then '8' when PerCon_9_10_c = glb.perconid then '10' else '' end as LeftMould, "+
2370 " case when PerCon_1_2_c = glb.perconid then lotnum + '1-2' when PerCon_3_4_c = glb.perconid then lotnum + '3-4' when PerCon_5_6_c = glb.perconid then lotnum + '5-6' when PerCon_7_8_c = glb.perconid then lotnum + '7-8' when PerCon_9_10_c = glb.perconid then lotnum + '9-10' else '' end as SerialNo, "+
2371 " case when PerCon_1_2_c = glb.perconid then PerCon_1_2_Notes_c when PerCon_3_4_c = glb.perconid then PerCon_3_4_Notes_c when PerCon_5_6_c = glb.perconid then PerCon_5_6_Notes_c when PerCon_7_8_c = glb.perconid then PerCon_7_8_Notes_c when PerCon_9_10_c = glb.perconid then PerCon_9_10_Notes_c else '' end as Notes from dbo.partlot as pl with (nolock) join erp.glbpercon as glb with (nolock) on pl.company = glb.company and glb.glbperconid = "+
2372 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"]+
2373 " and ( pl.PerCon_1_2_c = glb.perconid or pl.PerCon_3_4_c = glb.perconid or pl.PerCon_5_6_c = glb.perconid or pl.PerCon_7_8_c = glb.perconid or pl.PerCon_9_10_c = glb.perconid ) where pl.company = '200' and expirationdate > GETDATE() ";
2374 LaunchCastSearch(select, true);
2375 break;
2376 }
2377 case "Search_c": {
2378 if (!edvOrderDtl.HasRow)
2379 return;
2380
2381 // If we can't save the record, we don't have names in the current record.
2382 // The search below requires accurate names or it tries to retrieve EVERYTHING and times out.
2383 //if (!oTrans.Update())
2384 // return;
2385
2386 // The search functions are backwards.
2387 // A 'true' response indicates nothing was found.
2388
2389 DebugMsg("Tight Search");
2390 // Search exactly - i.e. Name=<name>
2391 if (!LaunchContactSearch(GetEqualsPerConSearchCommand()))
2392 return;
2393
2394 DebugMsg("Loose Search");
2395 // Didn't find anything? Search loosely - i.e., Name LIKE <Name>
2396 if (LaunchContactSearch(GetLikePerConSearchCommand()))
2397 MessageBox.Show(string.Format("No contacts found with\nLastName starts or equal to:{0}\nand FirstName starts or equal to:{1}",
2398 edvOrderDtl.CurrentDataRow["PerConLastName_c"], edvOrderDtl.CurrentDataRow["PerConFirstName_c"]));
2399
2400 DebugMsg("Done");
2401 // Found something!
2402 break;
2403 }
2404 }
2405 }
2406
2407 string GetEqualsPerConSearchCommand() {
2408 var select = "SELECT TOP 100 PerConID as PerConID, FirstName, LastName, DOB_c as DOB, EmployeeNum_c as EmployeeNum, CorpName as Company, Comment,"+
2409 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '1' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '3' "+
2410 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '5' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '7' "+
2411 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2412 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" '2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" '4' "+
2413 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" '6' "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+" '8' "+
2414 " when plo.percon_9_10_c = dbo.percon.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2415 " case when plo.percon_1_2_c = dbo.percon.PerConID then "+" plo.lotnum + '1-2' "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+
2416 " plo.lotnum + '3-4' "+" when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.lotnum + '5-6' "+
2417 " when plo.percon_7_8_c = dbo.percon.PerConID then "+" plo.lotnum + '7-8' "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+
2418 " plo.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo"+" , case when plo.percon_1_2_c = dbo.percon.PerConID then "+
2419 " plo.PerCon_1_2_Notes_c "+" when plo.percon_3_4_c = dbo.percon.PerConID then "+" plo.PerCon_3_4_Notes_c "+
2420 " when plo.percon_5_6_c = dbo.percon.PerConID then "+" plo.PerCon_5_6_Notes_c "+" when plo.percon_7_8_c = dbo.percon.PerConID then "+
2421 " plo.PerCon_7_8_Notes_c "+" when plo.percon_9_10_c = dbo.percon.PerConID then "+" plo.PerCon_9_10_Notes_c "+" else "+" '' "+" end "+
2422 " as Notes, "+" plo.ExpirationDate as ExpirationDate, "+" plo.lotnum as ExistingCast "+" ,ml.MfgLoc"+" from dbo.percon with (nolock) "+
2423 " left outer join dbo.partlot as plo on plo.company = dbo.percon.company and plo.ExpirationDate > GetDate() and ( plo.percon_1_2_c = PerConID or plo.percon_3_4_c = PerConID or plo.percon_5_6_c = PerConID or plo.percon_7_8_c = PerConID or plo.percon_9_10_c = PerConID) "+
2424 " LEFT JOIN dbo.CPE_SLXLotNumMfgLoc ml ON ml.LotNum COLLATE SQL_Latin1_General_CP1250_CI_AS = plo.LotNum"+" where dbo.percon.company = '"+
2425 ((Session)oTrans.Session).CompanyID+"' and dbo.percon.LastName = '"+edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConLastName_c"]+
2426 "' and dbo.percon.FirstName = '"+edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConFirstName_c"]+"' order by dbo.percon.perconid, ExistingCast ";
2427
2428 if (((Session)oTrans.Session).CompanyID!="200")
2429 select = "select TOP 100 pc.PerConID as PerConID, pc.FirstName, pc.LastName, pc.DOB_c as DOB, pc.EmployeeNum_c as EmployeeNum, pc.Comment, pc.CorpName as Company, "+
2430 " case when pl.percon_1_2_c = gpc.PerConID then "+" '1' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '3' "+
2431 " when pl.percon_5_6_c = gpc.PerConID then "+" '5' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '7' "+
2432 " when pl.percon_9_10_c = gpc.PerConID then "+" '9' "+" else "+" '' "+" end as RightMould, "+
2433 " case when pl.percon_1_2_c = gpc.PerConID then "+" '2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '4' "+
2434 " when pl.percon_5_6_c = gpc.PerConID then "+" '6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '8' "+
2435 " when pl.percon_9_10_c = gpc.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+
2436 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.lotnum + '1-2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" pl.lotnum + '3-4' "+
2437 " when pl.percon_5_6_c = gpc.PerConID then "+" pl.lotnum + '5-6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" pl.lotnum + '7-8' "+
2438 " when pl.percon_9_10_c = gpc.PerConID then "+" pl.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo, "+
2439 " case when pl.percon_1_2_c = gpc.PerConID then "+" pl.PerCon_1_2_Notes_c "+" when pl.percon_3_4_c = gpc.PerConID then "+
2440 " pl.PerCon_3_4_Notes_c "+" when pl.percon_5_6_c = gpc.PerConID then "+" pl.PerCon_5_6_Notes_c "+
2441 " when pl.percon_7_8_c = gpc.PerConID then "+" pl.PerCon_7_8_Notes_c "+" when pl.percon_9_10_c = gpc.PerConID then "+
2442 " pl.PerCon_9_10_Notes_c "+" else "+" '' "+" end as Notes , "+" pl.ExpirationDate as ExpirationDate, "+
2443 " pl.lotnum as ExistingCast "+" ,ml.MfgLoc"+" from dbo.percon as pc with (nolock) "+
2444 " join erp.glbpercon as gpc on '200' = gpc.company and gpc.GlbCompany = '"+((Session)oTrans.Session).CompanyID+
2445 "' and gpc.glbperconid = pc.perconid "+
2446 " left outer join dbo.PartLot as pl with (nolock)on pl.company = gpc.company and pl.expirationdate > Getdate() and ( (pl.percon_1_2_c = gpc.PerConID and gpc.perconid > 0 ) or "+
2447 " ( pl.percon_3_4_c = gpc.PerConID and gpc.perconid > 0 ) or (pl.percon_5_6_c = gpc.PerConID and gpc.perconid > 0 ) or (pl.percon_7_8_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_9_10_c = gpc.PerConID and gpc.perconid > 0 )) "+
2448 " LEFT JOIN dbo.CPE_SLXLotNumMfgLoc ml ON ml.LotNum COLLATE SQL_Latin1_General_CP1250_CI_AS = pl.LotNum"+" where pc.company = '"+
2449 ((Session)oTrans.Session).CompanyID+"' and pc.LastName = '"+edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConLastName_c"]+"' and pc.FirstName = '"+
2450 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConFirstName_c"]+"' order by pc.perconid, pl.lotnum";
2451 return select;
2452 }
2453
2454 string GetLikePerConSearchCommand() {
2455 var firstName = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConFirstName_c"];
2456 var lastName = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConLastName_c"];
2457 var companyId = ((Session)oTrans.Session).CompanyID;
2458 DebugMsg("Searching for First: '{0}' Last: '{1}' in company: '{2}'", firstName, lastName, companyId);
2459
2460 var select =
2461 string.Format(
2462 "select TOP 100 PerConID as PerConID, FirstName, LastName, DOB_c as DOB, EmployeeNum_c as EmployeeNum, CorpName as Company, Comment, "+
2463 "case when plo.percon_1_2_c=dbo.percon.PerConID then '1' when plo.percon_3_4_c=dbo.percon.PerConID then '3' "+
2464 " when plo.percon_5_6_c=dbo.percon.PerConID then '5' when plo.percon_7_8_c=dbo.percon.PerConID then '7' "+
2465 " when plo.percon_9_10_c=dbo.percon.PerConID then '9' else '' end as RightMould, "+
2466 "case when plo.percon_1_2_c=dbo.percon.PerConID then '2' when plo.percon_3_4_c=dbo.percon.PerConID then '4' "+
2467 " when plo.percon_5_6_c=dbo.percon.PerConID then '6' when plo.percon_7_8_c=dbo.percon.PerConID then '8' "+
2468 " when plo.percon_9_10_c=dbo.percon.PerConID then '10' else '' end as LeftMould, "+
2469 "case when plo.percon_1_2_c=dbo.percon.PerConID then plo.lotnum + '1-2' "+" when plo.percon_3_4_c=dbo.percon.PerConID then plo.lotnum + '3-4' "+
2470 " when plo.percon_5_6_c=dbo.percon.PerConID then plo.lotnum + '5-6' "+" when plo.percon_7_8_c=dbo.percon.PerConID then plo.lotnum + '7-8' "+
2471 " when plo.percon_9_10_c=dbo.percon.PerConID then plo.lotnum + '9-10' else '' end as SerialNo , "+
2472 "case when plo.percon_1_2_c=dbo.percon.PerConID then plo.PerCon_1_2_Notes_c "+" when plo.percon_3_4_c=dbo.percon.PerConID then plo.PerCon_3_4_Notes_c "+
2473 " when plo.percon_5_6_c=dbo.percon.PerConID then plo.PerCon_5_6_Notes_c "+" when plo.percon_7_8_c=dbo.percon.PerConID then plo.PerCon_7_8_Notes_c "+
2474 " when plo.percon_9_10_c=dbo.percon.PerConID then plo.PerCon_9_10_Notes_c "+" else '' end as Notes, "+"plo.ExpirationDate as ExpirationDate, "+
2475 "plo.lotnum as ExistingCast ,ml.MfgLoc "+"from dbo.percon with (nolock) "+
2476 "left outer join dbo.partlot as plo on plo.company=dbo.percon.company and plo.ExpirationDate > GetDate() and ( plo.percon_1_2_c=PerConID or plo.percon_3_4_c=PerConID or plo.percon_5_6_c=PerConID or plo.percon_7_8_c=PerConID or plo.percon_9_10_c=PerConID) "+
2477 "LEFT JOIN dbo.CPE_SLXLotNumMfgLoc ml ON ml.LotNum COLLATE SQL_Latin1_General_CP1250_CI_AS=plo.LotNum where dbo.percon.company='{0}' and dbo.percon.LastName like '{1}%' and dbo.percon.FirstName like '{2}%' "+
2478 "order by dbo.percon.perconid, ExistingCast", companyId, lastName, firstName);
2479
2480 if (companyId!="200")
2481 select =
2482 string.Format(
2483 "select TOP 100 pc.PerConID as PerConID, pc.FirstName, pc.LastName, pc.DOB_c as DOB, pc.EmployeeNum_c as EmployeeNum, pc.Comment, pc.CorpName as Company, "+
2484 "case when pl.percon_1_2_c = gpc.PerConID then "+" '1' "+" when pl.percon_3_4_c = gpc.PerConID then "+" '3' "+
2485 "when pl.percon_5_6_c = gpc.PerConID then "+" '5' "+" when pl.percon_7_8_c = gpc.PerConID then "+" '7' "+"when pl.percon_9_10_c = gpc.PerConID then "+
2486 " '9' "+" else "+" '' "+" end as RightMould, "+" case when pl.percon_1_2_c = gpc.PerConID then "+"'2' "+" when pl.percon_3_4_c = gpc.PerConID then "+
2487 " '4' "+" when pl.percon_5_6_c = gpc.PerConID then "+" '6' "+"when pl.percon_7_8_c = gpc.PerConID then "+" '8' "+
2488 " when pl.percon_9_10_c = gpc.PerConID then "+" '10' "+" else "+" '' "+" end as LeftMould, "+"case when pl.percon_1_2_c = gpc.PerConID then "+
2489 " pl.lotnum + '1-2' "+" when pl.percon_3_4_c = gpc.PerConID then "+" pl.lotnum + '3-4' "+"when pl.percon_5_6_c = gpc.PerConID then "+
2490 " pl.lotnum + '5-6' "+" when pl.percon_7_8_c = gpc.PerConID then "+" pl.lotnum + '7-8' "+"when pl.percon_9_10_c = gpc.PerConID then "+
2491 " pl.lotnum + '9-10' "+" else "+" '' "+" end as SerialNo, "+"case when pl.percon_1_2_c = gpc.PerConID then "+" pl.PerCon_1_2_Notes_c "+
2492 " when pl.percon_3_4_c = gpc.PerConID then "+" pl.PerCon_3_4_Notes_c "+"when pl.percon_5_6_c = gpc.PerConID then "+" pl.PerCon_5_6_Notes_c "+
2493 " when pl.percon_7_8_c = gpc.PerConID then "+" pl.PerCon_7_8_Notes_c "+"when pl.percon_9_10_c = gpc.PerConID then "+" pl.PerCon_9_10_Notes_c "+
2494 " else "+" '' "+" end as Notes , "+" pl.ExpirationDate as ExpirationDate, "+"pl.lotnum as ExistingCast "+" ,ml.MfgLoc"+
2495 " from dbo.percon as pc with (nolock) "+
2496 "join erp.glbpercon as gpc on '200' = gpc.company and gpc.GlbCompany = '{0}' and gpc.glbperconid = pc.perconid "+
2497 "left outer join dbo.PartLot as pl with (nolock)on pl.company = gpc.company and pl.expirationdate > Getdate() and ( ( pl.percon_1_2_c = gpc.PerConID and gpc.perconid > 0 ) or "+
2498 "( pl.percon_3_4_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_5_6_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_7_8_c = gpc.PerConID and gpc.perconid > 0 ) or ( pl.percon_9_10_c = gpc.PerConID and gpc.perconid > 0 ) ) "+
2499 "LEFT JOIN dbo.CPE_SLXLotNumMfgLoc ml ON ml.LotNum COLLATE SQL_Latin1_General_CP1250_CI_AS = pl.LotNum"+
2500 "where pc.company = '{0}' and pc.LastName like '{1}%' and pc.FirstName like '{2}%' order by pc.perconid, pl.lotnum", companyId, lastName, firstName);
2501 return select;
2502 }
2503 #endregion
2504
2505 #region Adapter Event Handlers
2506 void oTrans_ordAdapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args) {
2507 switch (args.MethodName) {
2508 case "Update":
2509 case "MasterUpdate":
2510 if (edvOrderDtl.Row>-1 && edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["RowMod"].ToString()=="A") {
2511 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["Copy_c"] = "";
2512 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["New_c"] = "";
2513 }
2514
2515 var parameters = new Hashtable();
2516 parameters.Add("pcustid", m_custID);
2517 var dt = GetQueryData("CPECustomerPORequired", parameters);
2518 if (dt.Rows.Count>0)
2519 if (Convert.ToBoolean(dt.Rows[0]["Customer_PORequired_c"]) && edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["PONum"].ToString().Length==0) {
2520 MessageBox.Show("Customer requires a PO number");
2521 args.Cancel = true;
2522 }
2523
2524 break;
2525 }
2526 }
2527
2528 void oTrans_ordAdapter_AfterAdapterMethod(object sender, AfterAdapterMethodArgs args) {
2529 switch (args.MethodName) {
2530 case "ChangeSoldToID":
2531 edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CommentsFromCustomer_c"] = "Start";
2532 var parameters = new Hashtable();
2533 parameters.Add("pcustnum", edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustNum"].ToString());
2534 var dt = GetQueryData("CPECustomerComments", parameters);
2535 if (dt.Rows.Count>0)
2536 edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CommentsFromCustomer_c"] = dt.Rows[0]["Calculated_Comments"];
2537 break;
2538 }
2539 }
2540 #endregion
2541
2542 #region DataView Event Handlers
2543 void edvOrderHed_EpiViewNotification(EpiDataView view, EpiNotifyArgs args) {
2544 try {
2545 if (args.Row<=-1) {
2546 m_custID = "";
2547 m_custNum = 0;
2548 m_shipToNum = "";
2549 return;
2550 }
2551
2552 var company = view.dataView[args.Row]["Company"].ToString();
2553 var custID = view.dataView[args.Row]["CustomerCustID"].ToString();
2554 if (company=="200" && custID=="250") {
2555 txtCustomerPONum.ReadOnly = false;
2556 txtCustomerPONum.Visible = true;
2557 lblCustomerPONum.Visible = true;
2558 epiTextBoxSalesRepCode1.Value = view.dataView[args.Row]["PEU_SalesRepCode1_c"].ToString();
2559 } else {
2560 txtCustomerPONum.ReadOnly = false;
2561 txtCustomerPONum.Visible = false;
2562 lblCustomerPONum.Visible = false;
2563 epiTextBoxSalesRepCode1.Value = view.dataView[args.Row]["SalesRepCode1"].ToString();
2564 }
2565
2566 if (m_custID!=Convert.ToString(view.dataView[args.Row]["CustomerCustID"])) {
2567 m_custID = Convert.ToString(view.dataView[args.Row]["CustomerCustID"]);
2568
2569 if (Convert.ToBoolean(view.dataView[args.Row]["OpenOrder"])) {
2570 edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CommentsFromCustomer_c"] = "Start";
2571 var parameters = new Hashtable();
2572 parameters.Add("pcustid", m_custID);
2573 var dt = GetQueryData("CPECustomerComments", parameters);
2574 if (dt.Rows.Count>0)
2575 edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CommentsFromCustomer_c"] = dt.Rows[0]["Calculated_Comments"];
2576 }
2577 }
2578
2579 if (m_custNum!=Convert.ToInt32(view.dataView[args.Row]["CustNum"]) || m_shipToNum!=Convert.ToString(view.dataView[args.Row]["ShipToNum"])) {
2580 m_custNum = Convert.ToInt32(view.dataView[args.Row]["CustNum"]);
2581 m_shipToNum = Convert.ToString(view.dataView[args.Row]["ShipToNum"]);
2582 SetHeaderPriceListDropDown(m_custNum, m_shipToNum);
2583 }
2584 } catch (Exception ex) {
2585 MessageBox.Show("edvOrderHed_EpiViewNotification error: "+ex.Message);
2586 }
2587 }
2588
2589 void edvOrderDtl_EpiViewNotification(EpiDataView view, EpiNotifyArgs args) {
2590 try {
2591 if (edvOrderDtl.Row>-1) {
2592 btnCreateNewContact.ReadOnly = false;
2593 btnSelectContact.ReadOnly = false;
2594 } else {
2595 btnCreateNewContact.ReadOnly = true;
2596 btnSelectContact.ReadOnly = true;
2597 }
2598
2599 if (args.NotifyType==EpiTransaction.NotifyType.AddRow && view.dataView[args.Row]["SalesUM"].ToString()!="PR")
2600 view.dataView[args.Row]["SalesUM"] = "PR";
2601 } catch (Exception ex) {
2602 DebugMsg(ex);
2603 }
2604 }
2605
2606 void OrderHed_AfterFieldChange(object sender, DataColumnChangeEventArgs args) {
2607 switch (args.Column.ColumnName) {
2608 case "HeaderPriceList_c":
2609 // set price list from header
2610 HeaderPriceListChanged(args);
2611 break;
2612 }
2613 }
2614
2615 void OrderHed_BeforeFieldChange(object sender, DataColumnChangeEventArgs args) {
2616 switch (args.Column.ColumnName) {
2617 case "OrderSite_c":
2618 if (edvOrderRel.dataView.Table.Rows.Count>0)
2619 MessageBox.Show("Changing the Order Site will not update existing order line release site values.");
2620 break;
2621 }
2622 }
2623
2624 void OrderDtl_AfterFieldChange(object sender, DataColumnChangeEventArgs args) {
2625 try {
2626 switch (args.Column.ColumnName) {
2627 case "PerConLastName_c":
2628 case "PerConFirstName_c":
2629 case "PerConDOB_c":
2630 PerConChanged(args);
2631 break;
2632 case "SalesUM":
2633 //Reorders are automatically populated as pairs, this should catch if it is then changed to Left or Right
2634 SalesUMChanged(args);
2635
2636 break;
2637 case "PerCon_c":
2638 case "PartNum":
2639 PartNumChanged(args);
2640 break;
2641 }
2642 } catch (Exception ex) {
2643 MessageBox.Show("After field change: "+ex.Message);
2644 }
2645 }
2646
2647 void HeaderPriceListChanged(DataColumnChangeEventArgs args) {
2648 if (!string.IsNullOrEmpty(args.Row["HeaderPriceList_c"].ToString())) {
2649 oTrans.Update();
2650 foreach (DataRow row in edvOrderDtl.dataView.Table.Rows) {
2651 row["OverridePriceList"] = true;
2652 row["BreakListCode"] = args.Row["HeaderPriceList_c"];
2653 }
2654
2655 oTrans.Update();
2656 oTrans.Refresh();
2657 }
2658 }
2659
2660 void SalesUMChanged(DataColumnChangeEventArgs args) {
2661 if (args.Row["PartNum"].ToString().ToUpper().EndsWith("R")) {
2662 var salesUM = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["SalesUM"].ToString().Trim().ToLower();
2663
2664 if (salesUM=="pr" || salesUM=="right" || salesUM=="ea")
2665 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_DspMouldRight_c"] = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_MouldRight_c"];
2666 else
2667 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_DspMouldRight_c"] = "";
2668 if (salesUM=="pr" || salesUM=="left" || salesUM=="ea")
2669 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_DspMouldLeft_c"] = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_MouldLeft_c"];
2670 else
2671 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["CPE_DspMouldLeft_c"] = "";
2672 }
2673 }
2674
2675 void PerConChanged(DataColumnChangeEventArgs args) {
2676 DebugMsg("PerCon Change.");
2677 if (args.Row["PerConDOB_c"]==DBNull.Value)
2678 return;
2679 if (m_copying || args.Row["PerConLastName_c"].ToString().Length<=0 || args.Row["PerConFirstName_c"].ToString().Length<=0)
2680 return;
2681
2682 if (CheckContactExists(args.Row["PerConFirstName_c"].ToString(), args.Row["PerConLastName_c"].ToString(), Convert.ToDateTime(args.Row["PerConDOB_c"]))==false)
2683 CreateNewContact(args.Row["PerConFirstName_c"].ToString(), args.Row["PerConLastName_c"].ToString(), args.Row["PerConDOB_c"], args.Row["EmployeeNum_c"].ToString(),
2684 Convert.ToString(edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustomerName"]),
2685 Convert.ToInt32(edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustNum"]));
2686 else
2687 UpdateContact(Convert.ToInt32(args.Row["PerCon_c"]), Convert.ToInt32(edvOrderHed.dataView.Table.Rows[edvOrderHed.Row]["CustNum"]));
2688 }
2689 #endregion
2690
2691 #region Part Change Logic
2692 void PartNumChanged(DataColumnChangeEventArgs args) {
2693 var partNum = args.Row["PartNum"].ToString();
2694 var filter = args.Row["Filter_c"].ToString();
2695 var orderNum = args.Row["OrderNum"];
2696 var orderLine = args.Row["OrderLine"];
2697 var perCon = Convert.ToInt32(args.Row["PerCon_c"]);
2698
2699 args.Row["PerConDropDown_c"] = perCon;
2700
2701 SetDefaultRevision(args, partNum);
2702
2703 SetPriceListFromHeader(args);
2704
2705 //Populate the Colour dropdown
2706 var colorList = SetupFilters(args, partNum, filter);
2707 SetGridDropDown(grdDtlList, "Colour_c", colorList);
2708
2709 // No percon specified?
2710 // Can't set cast info.
2711 if (perCon<=0) {
2712 args.Row["CPE_Cast_c"] = "";
2713 return;
2714 }
2715
2716 if (partNum.EndsWith("N", StringComparison.InvariantCultureIgnoreCase)) {
2717 DebugMsg("Checking for duplicate 'N' parts.");
2718 CheckForDuplicateNParts(args, perCon, orderNum, orderLine);
2719 return;
2720 }
2721
2722 if (partNum.EndsWith("R", StringComparison.InvariantCultureIgnoreCase)) {
2723 DebugMsg("Checking casts by PerCon.");
2724 SetCastsByPerCon(args, perCon);
2725 return;
2726 }
2727
2728 DebugMsg("Setting blank cast info");
2729 args.Row["CPE_Cast_c"] = "";
2730 }
2731
2732 void SetDefaultRevision(DataColumnChangeEventArgs args, string partNum) {
2733 // Set revision to latest approved for the Site selected
2734 string latestRev;
2735 if (GetLatestRev(partNum, edvOrderHed.CurrentDataRow["OrderSite_c"].ToString(), out latestRev))
2736 args.Row["RevisionNum"] = latestRev;
2737 }
2738
2739 bool GetLatestRev(string partNum, string site, out string rev) {
2740 var hasRev = false;
2741 rev = "";
2742 try {
2743 var parameters = new Hashtable();
2744 parameters.Add("ppartnum", partNum);
2745 parameters.Add("psite", site);
2746
2747 var dt = GetQueryData("CPELatestRevBySite", parameters);
2748 if (dt.Rows.Count>0) {
2749 rev = dt.Rows[0]["PartRev_RevisionNum"].ToString();
2750 hasRev = true;
2751 }
2752 } catch (Exception ex) {
2753 MessageBox.Show("GetLastest rev error: "+ex.Message);
2754 }
2755
2756 return hasRev;
2757 }
2758
2759 void SetPriceListFromHeader(DataColumnChangeEventArgs args) {
2760 if (string.IsNullOrEmpty(edvOrderHed.CurrentDataRow["HeaderPriceList_c"].ToString()))
2761 return;
2762 args.Row["OverridePriceList"] = true;
2763 args.Row["BreakListCode"] = edvOrderHed.CurrentDataRow["HeaderPriceList_c"];
2764 }
2765
2766 List<string> SetupFilters(DataColumnChangeEventArgs args, string partNum, string filter) {
2767 // load the available colours and filters for this part //greg
2768 var filter_GrYeWh = "10001N 10001R 10002N 10002R 10003N 10003R 10004N 10004R 10005N 10005R 10006N 10006R 10007N 10007R 10008N 10008R 10009N 10009R 10010N 10010R "+
2769 "10011N 10011R 10012N 10012R 10013N 10013R 10014N 10014R 10015N 10015R 10016N 10016R 10017N 10017R 10018N 10018R 10037N 10037R 10038N 10038R 10039N 10039R 10048N "+
2770 "10048R 10049N 10049R 10050N 10050R 10051N 10051R 10052N 10052R 10053N 10053R 10054N 10054R 10055N 10055R 10056N 10056R 10057N 10057R 10068N 10068R 10069N 10069R "+
2771 "10070N 10070R 10071N 10071R 10073N 10073R 10074N 10074R 10075N 10075R 10076N 10076R 10077N 10077R 10078N 10078R 10079N 10079R 10080N 10080R 10100N 10100R 10101N "+
2772 "10101R 10102N 10102R 10103N 10103R 12001N 12001R 12009R 12010N 12010R 12012N 12012R 12013N 12013R 12022N 12022R 13005N 13005R 14002N 14002R 14005N 14005R 11005N 11005R 11016N 11016R 10040N "+
2773 "10040R 10041N 10041R 10042N 10042R 10072N 10072R 10094N 10094R 10095N 10095R 10096N 10096R 10097N 10097R 10098N 10098R 10099N 10099R";
2774
2775 var filter_musician = "11001N 11001R 11002N 11002R 11003N 11003R 11004N 11004R 11018N 11018R 11019N 11019R 11020N 11020R 11021N 11021R";
2776
2777 string[] filters;
2778
2779 if (filter_GrYeWh.IndexOf(partNum)>-1) {
2780 //Set the available filter colours
2781 filters = new string[] {"Green", "Yellow", "White"};
2782
2783 //Test that the current filter colour is one of the available colours. If not, notify the user and clear it.
2784 if (filter!="") {
2785 var filterfound = filters.Any(f => f==filter);
2786
2787 if (!filterfound) {
2788 MessageBox.Show("The previous filter colour is not allowed for new Part number. Please select a new one.");
2789 args.Row["Filter_c"] = "";
2790 }
2791 }
2792 } else if (filter_musician.IndexOf(partNum)>-1) {
2793 //Set the available filter colours
2794 filters = new string[] {"ER9", "ER15"};
2795 //Test that the current filter colour is one of the available colours. If not, notify the user and clear it.
2796 if (filter!="") {
2797 var filterfound = filters.Any(fil => fil==filter);
2798
2799 if (!filterfound) {
2800 MessageBox.Show("The previous filter colour is not allowed for new Part number. Please select a new one.");
2801 args.Row["Filter_c"] = "";
2802 }
2803 }
2804 } else {
2805 filters = new string[] { };
2806 args.Row["Filter_c"] = "";
2807 }
2808
2809 //Populate the Filter dropdown
2810 SetGridDropDown(grdDtlList, "Filter_c", filters);
2811
2812 //standard colors are blk, blu, cle, grn, org, pur, red, safT tan, Teal, wht, yel, pink
2813 var colour_standard = "10001N 10001R 10002N 10002R 10003N 10003R 10004N 10004R 10005N 10005R 10006N 10006R 10007N 10007R 10008N 10008R 10009N 10009R 10010N "+
2814 "10010R 10011N 10011R 10012N 10012R 10013N 10013R 10014N 10014R 10015N 10015R 10016N 10016R 10017N 10017R 10018N 10018R 10037N 10037R 10038N 10038R 10039N "+
2815 "10039R 10048N 10048R 10049N 10049R 10050N 10050R 10051N 10051R 10052N 10052R 10053N 10053R 10054N 10054R 10055N 10055R 10056N 10056R 10057N 10057R 10068N "+
2816 "10068R 10069N 10069R 10070N 10070R 10071N 10071R 10073N 10073R 10074N 10074R 10075N 10075R 10076N 10076R 10077N 10077R 10078N 10078R 10079N 10079R 10080N "+
2817 "10080R 10100N 10100R 10101N 10101R 10102N 10102R 12009R 12010N 12010R 12012N 12012R 12013N 12013R 12022N 12022R 13005N 13005R 14002N 14002R 14005N 14005R "+
2818 "11001N 11001R 11002N 11002R 11003N 11003R 11004N 11004R 11018N 11018R 11019N 11019R 11020N 11020R 11021N 11021R 10019N 10019R 10020N 10020R 10021N 10021R "+
2819 "10022N 10022R 10023N 10023R 10024N 10024R 10025N 10025R 10026N 10026R 10027N 10027R 10028N 10028R 10029N 10029R 10030N 10030R 10031N 10031R 10032N 10032R "+
2820 "10033N 10033R 10034N 10034R 10035N 10035R 10036N 10036R 10058N 10058R 10059N 10059R 10060N 10060R 10061N 10061R 10062N 10062R 10063N 10063R 10064N 10064R "+
2821 "10065N 10065R 10066N 10066R 10067N 10067R 10081N 10081R 10082N 10082R 10083N 10083R 10084N 10084R 10086N 10086R 10087N 10087R 10088N 10088R 10089N 10089R "+
2822 "10090N 10090R 10091N 10091R 10092N 10092R 10093N 10093R 10103N 10103R 11007N 11007R 11010N 11010R 11011N 11011R 11012N 11012R 11013N 11013R 11014N 11014R 11015N 11015R "+
2823 "12001N 12001R 2006N 12006R 12007N 12007R 12008N 12008R 12009N 12011N 12011R 12014 12014K 12015 12015K 12016 12016K 12017 12017K 12018 12018K 12019 12019K "+
2824 "12020 12021 12031N 12031R 12032N 12032R 12041N 12041R 13001N 13001R 13002N 13002R 13003N 13003R 13004N 13004R 13006N 13006R 13007N 13007R 13008N 13008R "+
2825 "13009N 13009R 13010N 13010R 13011N 13011R 13012N 13012R 13013N 13013R 13014N 13014R 13015N 13015R 13016N 13016R 13017N 13017R 13018N 13018R 13019N 13019R "+
2826 "14001N 14001R 14003N 14003R 14004N 14004R";
2827
2828 var colour_standard_plus_GID = "11005N 11005R 11016N 11016R 11006N 11006R 11017N 11017R";
2829
2830 var colour_standard_plus_grey = "10040N 10040R 10041N 10041R 10042N 10042R 10072N 10072R 10094N 10094R 10095N 10095R 10096N 10096R 10097N 10097R 10098N 10098R "+
2831 "10099N 10099R 10045N 10045R 10046N 10046R 10085N 10085R 12005N 12005R";
2832
2833 var colour_PartNum_NOT_Pink_Diamond_and_White_Diamond =
2834 "11016N 11016R 11017N 11017R 11005N 11005R 11006N 11006R 10100N 10100R 10101N 10101R 10102N 10102R 10103N 10103R 11001N 11001R 11004N 11004R";
2835
2836 var colorList = new List<string> {"Black", "Blue", "Clear", "Green", "Orange", "Purple", "Red", "SafT", "Tan", "Teal", "White", "Yellow", "Pink"};
2837 var currentColor = "";
2838
2839 //if there's a current color selected, capture it for comparison later
2840 if (colour_standard.IndexOf(partNum)<=-1)
2841 if (colour_standard_plus_GID.IndexOf(partNum)>-1)
2842 colorList.Add("GID");
2843 else if (colour_standard_plus_grey.IndexOf(partNum)>-1)
2844 colorList.Add("Grey");
2845
2846 //Check to see if the part num is one that does NOT have Pink Glitter or White Diamond as an option and add them accordingly
2847 if (colour_PartNum_NOT_Pink_Diamond_and_White_Diamond.IndexOf(partNum)==-1) {
2848 colorList.Add("White Diamond");
2849 colorList.Add("Pink Glitter");
2850 }
2851
2852 //Test that the current colour is one of the available colours. If not, notify the user and clear it.
2853 if (currentColor!="") {
2854 var colourfound = false;
2855 foreach (var col in colorList)
2856 if (col==args.Row["Colour_c"].ToString()) {
2857 colourfound = true;
2858 break;
2859 }
2860
2861 if (!colourfound) {
2862 MessageBox.Show("The previous colour is not allowed for new Part number. Please select a new one.");
2863 args.Row["Colour_c"] = "";
2864 }
2865 }
2866
2867 return colorList;
2868 }
2869
2870 void CheckForDuplicateNParts(DataColumnChangeEventArgs args, int perCon, object orderNum, object orderLine) {
2871 // Identify duplicate new parts.
2872 // After the first new part 'xxxxxN' part, additional instances should be 'xxxxxR'.
2873 var rowsInThisOrder = edvOrderDtl.dataView.Table.Select(string.Format("PerCon_c={0} and OrderNum={1} and OrderLine<>{2}", perCon, orderNum, orderLine));
2874 // see if there is only one N part num
2875 var bHasNewPartRow = false;
2876 var nLine = " ";
2877 foreach (var nRow in rowsInThisOrder.Where(r => r["PartNum"].ToString().EndsWith("N", StringComparison.InvariantCultureIgnoreCase))) {
2878 bHasNewPartRow = true;
2879 nLine += string.Format("{0} ", nRow["OrderLine"]);
2880 }
2881
2882 if (bHasNewPartRow)
2883 MessageBox.Show(string.Format("{0} {1} has a new part in line {2}", args.Row["PerConFirstName_c"], args.Row["PerConLastName_c"], nLine));
2884 }
2885
2886 void SetCastsByPerCon(DataColumnChangeEventArgs args, int perCon) {
2887 var newValue = ChangeContact(Convert.ToInt32(perCon));
2888 if (newValue!=Convert.ToInt32(perCon))
2889 args.Row["PerCon_c"] = newValue;
2890
2891 var select =
2892 string.Format(
2893 "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', case when PerCon_1_2_c = {0} then PerCon_1_2_Notes_c when PerCon_3_4_c = {0} then PerCon_3_4_Notes_c when PerCon_5_6_c = {0} then PerCon_5_6_Notes_c when PerCon_7_8_c = {0} then PerCon_7_8_Notes_c when PerCon_9_10_c = {0} then PerCon_9_10_Notes_c else '' end as Notes , "+
2894 " case when PerCon_1_2_c = {0} then '1' "+" when PerCon_3_4_c = {0} then '3' "+" when PerCon_5_6_c = {0} then '5' "+" when PerCon_7_8_c = {0} then '7' "+
2895 " when PerCon_9_10_c = {0} then '9' else '' end as RightMould, "+
2896 " case when PerCon_1_2_c = {0} then '2' when PerCon_3_4_c = {0} then '4' when PerCon_5_6_c = {0} then '6' when PerCon_7_8_c = {0} then '8' when PerCon_9_10_c = {0} then '10' else '' end as LeftMould, "+
2897 " case when PerCon_1_2_c = {0} then lotnum + '1-2' "+" when PerCon_3_4_c = {0} then lotnum + '3-4' "+" when PerCon_5_6_c = {0} then lotnum + '5-6' "+
2898 " when PerCon_7_8_c = {0} then lotnum + '7-8' "+"when PerCon_9_10_c = {0} then lotnum + '9-10' else '' end as SerialNo "+
2899 " from dbo.partlot where company = '{1}' and expirationdate > GETDATE() and ( PerCon_1_2_c = {0} or PerCon_3_4_c = {0} or PerCon_5_6_c = {0} or PerCon_7_8_c = {0} or PerCon_9_10_c = {0})",
2900 perCon, ((Session)oTrans.Session).CompanyID);
2901
2902 if (((Session)oTrans.Session).CompanyID=="250")
2903 select =
2904 string.Format(
2905 "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', "+
2906 " case when PerCon_1_2_c = glb.perconid then '1' when PerCon_3_4_c = glb.perconid then '3' when PerCon_5_6_c = glb.perconid then '5' when PerCon_7_8_c = glb.perconid then '7' when PerCon_9_10_c = glb.perconid then '9' else '' end as RightMould, "+
2907 " case when PerCon_1_2_c = glb.perconid then '2' when PerCon_3_4_c = glb.perconid then '4' when PerCon_5_6_c = glb.perconid then '6' when PerCon_7_8_c = glb.perconid then '8' when PerCon_9_10_c = glb.perconid then '10' else '' end as LeftMould, "+
2908 " case when PerCon_1_2_c = glb.perconid then lotnum + '1-2' when PerCon_3_4_c = glb.perconid then lotnum + '3-4' when PerCon_5_6_c = glb.perconid then lotnum + '5-6' when PerCon_7_8_c = glb.perconid then lotnum + '7-8' when PerCon_9_10_c = glb.perconid then lotnum + '9-10' else '' end as SerialNo, case when PerCon_1_2_c = glb.perconid then PerCon_1_2_Notes_c when PerCon_3_4_c = glb.perconid then PerCon_3_4_Notes_c when PerCon_5_6_c = glb.perconid then PerCon_5_6_Notes_c when PerCon_7_8_c = glb.perconid then PerCon_7_8_Notes_c when PerCon_9_10_c = glb.perconid then PerCon_9_10_Notes_c else '' end as Notes from dbo.partlot as pl with (nolock) join erp.glbpercon as glb with (nolock) on pl.company = glb.company and glb.glbperconid = {0} and ( pl.PerCon_1_2_c = glb.perconid or pl.PerCon_3_4_c = glb.perconid or pl.PerCon_5_6_c = glb.perconid or pl.PerCon_7_8_c = glb.perconid or pl.PerCon_9_10_c = glb.perconid ) where pl.company = '200' and expirationdate > GETDATE() ",
2909 perCon);
2910 LaunchCastSearch(select, false);
2911 }
2912 #endregion
2913
2914 bool CheckContactExists(string FirstName, string LastName, object dboValue) {
2915 var useExistingContact = false;
2916 try {
2917 var dob = new DateTime(1900, 01, 01);
2918 try {
2919 dob = Convert.ToDateTime(dboValue);
2920 } catch (Exception ex) {
2921 DebugMsg(ex);
2922 }
2923
2924 var filter = "firstname = '"+FirstName+"' and lastname = '"+LastName+"' and DOB_c = '"+dob.ToString("yyyy-MM-dd")+"'";
2925 bool recSelected;
2926 var ds = SearchFunctions.listLookup(oTrans, "PerConAdapter", out recSelected, false, filter, true);
2927 if (recSelected) {
2928 var dsBO = BOReaderData("PerCon", "PerConID = "+ds.Tables[0].Rows[0]["PerConID"], "EmployeeNum_c");
2929 var empNum = "";
2930 if (dsBO.Tables[0].Rows.Count>0)
2931 empNum = dsBO.Tables[0].Rows[0]["EmployeeNum_c"].ToString();
2932 //MessageBox.Show("168: Contact Exists where FirstName, LastName and DOB match.\nOn the next dialog box click search and select an existing contact or cancel out of it to create a new contact entry.");
2933 if (ds.Tables[0].Rows.Count==1) {
2934 useExistingContact = true;
2935 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"].ToString()!=ds.Tables[0].Rows[0]["PerConID"].ToString())
2936 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"] = ds.Tables[0].Rows[0]["PerConID"];
2937 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"].ToString()!=empNum)
2938 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"] = empNum; //ds.Tables[0].Rows[0]["EmployeeNum_c"];
2939 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"].ToString()!=ds.Tables[0].Rows[0]["CorpName"].ToString())
2940 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"] = ds.Tables[0].Rows[0]["CorpName"];
2941 } else {
2942 //ds = SearchFunctions.listLookup(oTrans,"PerConAdapter", out recSelected, true, filter);
2943 ds = SearchFunctions.listLookup(oTrans, "PerConAdapter", out recSelected, false, filter);
2944 if (recSelected) {
2945 useExistingContact = true;
2946 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"].ToString()!=ds.Tables[0].Rows[0]["PerConID"].ToString())
2947 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"] = ds.Tables[0].Rows[0]["PerConID"];
2948 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"].ToString()!=empNum)
2949 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"] = empNum; //ds.Tables[0].Rows[0]["EmployeeNum_c"];
2950 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"].ToString()!=ds.Tables[0].Rows[0]["CorpName"].ToString())
2951 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"] = ds.Tables[0].Rows[0]["CorpName"];
2952 }
2953 }
2954 }
2955 } catch (Exception ex) {
2956 MessageBox.Show("Check Contact Exists: "+ex.Message);
2957 }
2958
2959 return useExistingContact;
2960 }
2961
2962 void CreateNewContact(string firstName, string lastName, object dboValue, string empNum, string company, int custNum) {
2963 try {
2964 var boPerCon = WCFServiceSupport.CreateImpl<PerConImpl>((Session)oTrans.Session, "erp/bo/percon.svc");
2965 var dsPerCon = new PerConDataSet();
2966 boPerCon.GetNewPerCon(dsPerCon);
2967 dsPerCon.Tables["PerCon"].Rows[0]["FirstName"] = firstName;
2968 dsPerCon.Tables["PerCon"].Rows[0]["LastName"] = lastName;
2969 dsPerCon.Tables["PerCon"].Rows[0]["Name"] = firstName+" "+lastName;
2970 dsPerCon.Tables["PerCon"].Rows[0]["EmployeeNum_c"] = empNum;
2971 dsPerCon.Tables["PerCon"].Rows[0]["CorpName"] = company;
2972 dsPerCon.Tables["PerCon"].Rows[0]["Company_c"] = company;
2973 if (edvOrderDtl.Row>-1)
2974 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"] = company;
2975 if (dboValue==DBNull.Value)
2976 dsPerCon.Tables["PerCon"].Rows[0]["DOB_c"] = new DateTime(1900, 01, 01);
2977 else
2978 dsPerCon.Tables["PerCon"].Rows[0]["DOB_c"] = dboValue;
2979 boPerCon.Update(dsPerCon);
2980
2981 // if US company make the Person global
2982 var session = (Session)oTrans.Session;
2983 if (session.CompanyID=="250") {
2984 dsPerCon.Tables["PerCon"].Rows[0]["RowMod"] = "U";
2985 dsPerCon.Tables["PerCon"].Rows[0]["GlobalPerCon"] = true;
2986 boPerCon.Update(dsPerCon);
2987 CreateLinkContact(session.CompanyID, Convert.ToInt32(dsPerCon.Tables["PerCon"].Rows[0]["PerConID"]), m_targetCompany, ref dsPerCon);
2988 }
2989
2990 //add to customer
2991 var boCustCnt = WCFServiceSupport.CreateImpl<CustCntImpl>((Session)oTrans.Session, "erp/bo/custcnt.svc");
2992 var dsCustCnt = new CustCntDataSet();
2993 boCustCnt.GetNewCustCnt(dsCustCnt, custNum, "");
2994 boCustCnt.GetPerConData(Convert.ToInt32(dsPerCon.Tables["PerCon"].Rows[0]["PerConID"]), dsCustCnt);
2995 boCustCnt.Update(dsCustCnt);
2996
2997 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"] = dsPerCon.Tables["PerCon"].Rows[0]["PerConID"];
2998
2999 boPerCon.Dispose();
3000 dsPerCon.Clear();
3001
3002 boCustCnt.Dispose();
3003 dsCustCnt.Clear();
3004
3005 txtFirstName.Text = "";
3006 epiTextBoxC4.Text = "";
3007 epiDateTimeEditorC1.Value = null;
3008 } catch (Exception ex) {
3009 MessageBox.Show("CreateNewContact Error: "+ex.Message);
3010 }
3011 }
3012
3013 void CreateLinkContact(string sourceCompany, int sourcePerConID, string targetCompany, ref PerConDataSet sourcePerCon) {
3014 Hashtable parameters = null;
3015 DataTable dtGlbPerConExists = null;
3016 PerConImpl boPerConImpl = null;
3017 GlbPerConDataSet dsGlbPerCon = null;
3018
3019 try {
3020 // verify that glbpercon does not exist
3021 parameters = new Hashtable();
3022 parameters.Add("psourcecompany", sourceCompany);
3023 parameters.Add("ptargetcompany", targetCompany);
3024 parameters.Add("psourceperconid", sourcePerConID);
3025
3026 dtGlbPerConExists = GetQueryData("CPEGlobalContactLink", parameters);
3027 var bLinked = false;
3028
3029 if (dtGlbPerConExists.Rows.Count>0)
3030 bLinked = Convert.ToInt32(dtGlbPerConExists.Rows[0]["GlbPerCon_PerConID"])!=0;
3031
3032 // create row in GlbPerCon table using SQL
3033 if (bLinked)
3034 return;
3035
3036 boPerConImpl = WCFServiceSupport.CreateImpl<PerConImpl>(m_targetSession, "erp/bo/PerCon.svc");
3037 var dsPerCon = new PerConDataSet();
3038 boPerConImpl.GetNewPerCon(dsPerCon);
3039 dsPerCon.Tables["PerCon"].Rows[0]["Name"] = sourcePerCon.Tables["PerCon"].Rows[0]["Name"];
3040 boPerConImpl.DefaultName("Detail", 0, dsPerCon);
3041 boPerConImpl.Update(dsPerCon);
3042
3043 var targetPerConID = Convert.ToInt32(dsPerCon.Tables["PerCon"].Rows[0]["PerConID"]);
3044 // MessageBox.Show(targetPerConID.ToString() + " id created" + ">>>" + sourceCompany + "`" + sourcePerConID);
3045 // link the contacts
3046 var bFound = false;
3047 var counter = 0;
3048 while (bFound==false && counter<65) {
3049 counter++;
3050 dsGlbPerCon = boPerConImpl.GetGlbPerConList(sourceCompany+"`"+sourcePerConID);
3051 if (dsGlbPerCon.Tables["GlbPerCon"].Rows.Count>0) {
3052 bFound = true;
3053 dsGlbPerCon.Tables["GlbPerCon"].Rows[0]["LinkPerConID"] = targetPerConID;
3054 dsGlbPerCon.Tables["GlbPerCon"].Rows[0]["LinkName"] = sourcePerCon.Tables["PerCon"].Rows[0]["Name"];
3055 dsGlbPerCon.Tables["GlbPerCon"].Rows[0]["RowMod"] = "U";
3056 } else {
3057 Thread.Sleep(1000);
3058 }
3059 }
3060 // MessageBox.Show(dsGlbPerCon.Tables["GlbPerCon"].Rows.Count.ToString() + "Found it " + counter.ToString());
3061 //string message;
3062 //boPerConImpl.PreLinkGlbPerCon(sourceCompany, sourcePerConID, false, dsGlbPerCon, out message);
3063
3064 // MessageBox.Show("391");
3065 string[] copyColumns = {
3066 "DOB_c", "EmployeeNum_c", "name", "firstname", "middlename", "lastname", "prname", "func", "FaxNum", "PhoneNum", "EMailAddress", "CellPhoneNum", "PagerNum",
3067 "HomeNum", "AltNum", "Prefix", "Suffix", "Initials", "WebSite", "IM", "Twitter", "LinkedIn", "FaceBook", "WebLink1", "WebLink2", "WebLink3", "WebLink4", "WebLink5",
3068 "Address1", "Address2", "Address3", "City", "State", "Zip", "Country", "CountryNum", "CorpName", "RoleCode", "Comment", "ContactTitle", "ReportsTo", "PRLastName",
3069 "PRFirstName", "PRMiddleName"
3070 };
3071 foreach (var colName in copyColumns)
3072 dsPerCon.Tables["PerCon"].Rows[0][colName] = sourcePerCon.Tables["PerCon"].Rows[0][colName];
3073 // MessageBox.Show("397");
3074 dsPerCon.Tables["PerCon"].Rows[0]["RowMod"] = "U";
3075 boPerConImpl.LinkGlbPerCon(sourceCompany, sourcePerConID, dsGlbPerCon, dsPerCon);
3076 dsPerCon.Tables["PerCon"].Rows[0]["GlbFlag"] = true;
3077 dsPerCon.Tables["PerCon"].Rows[0]["GlbLink"] = sourceCompany+"~"+sourcePerConID;
3078 dsPerCon.Tables["PerCon"].Rows[0]["RowMod"] = "U";
3079 boPerConImpl.Update(dsPerCon);
3080 // MessageBox.Show("linked");
3081
3082 dsPerCon.Clear();
3083 dsGlbPerCon.Clear();
3084
3085 // clean everything up
3086 } catch (Exception ex) {
3087 MessageBox.Show("Create Global Contact Link Error: "+ex.Message);
3088 } finally {
3089 if (boPerConImpl!=null)
3090 boPerConImpl.Dispose();
3091
3092 if (parameters!=null)
3093 parameters.Clear();
3094
3095 if (dtGlbPerConExists!=null)
3096 dtGlbPerConExists.Clear();
3097 }
3098 }
3099
3100 void UpdateContact(int perCon, int custNum) {
3101 try {
3102 var boPerCon = WCFServiceSupport.CreateImpl<PerConImpl>((Session)oTrans.Session, "erp/bo/percon.svc");
3103 var dsPerCon = boPerCon.GetByID(perCon);
3104 var boCustCnt = WCFServiceSupport.CreateImpl<CustCntImpl>((Session)oTrans.Session, "erp/bo/custcnt.svc");
3105 var dsCustCnt = new CustCntDataSet();
3106 try {
3107 //add to customer
3108 boCustCnt.GetNewCustCnt(dsCustCnt, custNum, "");
3109 boCustCnt.GetPerConData(perCon, dsCustCnt);
3110 boCustCnt.Update(dsCustCnt);
3111 } catch (Exception ex) {
3112 DebugMsg(ex);
3113 } finally {
3114 boCustCnt.Dispose();
3115 dsCustCnt.Clear();
3116 }
3117
3118 boPerCon.Dispose();
3119 dsPerCon.Clear();
3120 } catch (Exception ex) {
3121 MessageBox.Show("Update Contact Error: "+ex.Message);
3122 }
3123 }
3124
3125 DataSet BOReaderData(string businessObject, string filter, string fieldList) {
3126 using (var boReader = WCFServiceSupport.CreateImpl<BOReaderImpl>(oTrans.CoreSession, "ice/lib/BOReader.svc"))
3127 try {
3128 return boReader.GetRows("Erp:BO:"+businessObject, filter, fieldList);
3129 } catch (Exception ex) {
3130 MessageBox.Show("Populate from BO error: "+ex.Message);
3131 return null;
3132 }
3133 }
3134
3135 void SetHeaderPriceListDropDown(int custNum, string shipToNum) {
3136 try {
3137 var parameters = new Hashtable();
3138 parameters.Add("pcustnum", custNum.ToString());
3139 parameters.Add("pshiptonum", shipToNum);
3140 //DataTable dt = GetQueryData("CPEPriceLists", parameters);
3141 var dtCustPriceLst = GetQueryData("CPE_CustomerPriceLists", parameters);
3142 var dtGrpPriceLst = GetQueryData("CPE_CustGrpPriceLists", parameters);
3143 foreach (DataRow grpRow in dtGrpPriceLst.Rows) {
3144 var exists = dtCustPriceLst.Select("Calculated_Value = '"+grpRow["Calculated_Value"]+"'");
3145 if (exists.Length<=0)
3146 dtCustPriceLst.ImportRow(grpRow);
3147 }
3148
3149 cmbHeaderPriceList.DataSource = dtCustPriceLst;
3150 cmbHeaderPriceList.DisplayMember = "Calculated_Display";
3151 cmbHeaderPriceList.ValueMember = "Calculated_Value";
3152 } catch (Exception ex) {
3153 MessageBox.Show("SetHeaderPriceList dropdown: "+ex.Message);
3154 }
3155 }
3156
3157 int ChangeContact(int proposedPerConID) {
3158 // Make sure we have somewhere to put this percon info.
3159 if (!edvOrderDtl.HasRow)
3160 return 0;
3161 var orderDtl = edvOrderDtl.CurrentDataRow;
3162
3163 // Lookup the percon by id.
3164 bool recSelected;
3165 var where = string.Format("PerConID = {0}", proposedPerConID);
3166 var ds = SearchFunctions.listLookup(oTrans, "PerConAdapter", out recSelected, false, where);
3167
3168 // Found something? Set the fields and return the ID.
3169 if (recSelected) {
3170 var perConID = Convert.ToInt32(ds.Tables[0].Rows[0]["PerConID"]);
3171 orderDtl["PerCon_c"] = perConID;
3172 orderDtl["PerConDropDown_c"] = perConID;
3173 return perConID;
3174 }
3175
3176 // Nothing found? Blank out the fields.
3177 MessageBox.Show(string.Format("Error: PerConID: {0} does not exist.", proposedPerConID));
3178 orderDtl["PerCon_c"] = 0;
3179 orderDtl["PerConDropDown_c"] = 0;
3180 return 0;
3181 }
3182
3183 DataTable GetQueryData(string baqName, Hashtable parameters) {
3184 // ** Place Event Handling Code Here **
3185 var orgbaqName = baqName;
3186 var session = (Session)oTrans.Session;
3187 var adDynamicQuery = new DynamicQueryAdapter(oTrans);
3188 adDynamicQuery.BOConnect();
3189 try {
3190 adDynamicQuery.ClearDynamicQueryData();
3191 DynamicQueryDataSet baqQuery;
3192 try {
3193 baqQuery = adDynamicQuery.GetQueryDesignData(baqName) as DynamicQueryDataSet;
3194 } catch {
3195 baqName = session.CompanyID+"-"+baqName;
3196 baqQuery = adDynamicQuery.GetQueryDesignData(baqName) as DynamicQueryDataSet;
3197 }
3198
3199 var executionDS = adDynamicQuery.GetQueryExecutionParametersByID(baqName);
3200 if (baqQuery!=null && executionDS!=null) {
3201 for (var i = 0; i<executionDS.ExecutionParameter.Rows.Count; i++) {
3202 var executeParams = executionDS.ExecutionParameter[i]["ParameterID"].ToString().Trim().ToLower();
3203 if (parameters.Contains(executeParams))
3204 executionDS.ExecutionParameter[i]["ParameterValue"] = parameters[executeParams].ToString();
3205 }
3206
3207 executionDS.AcceptChanges();
3208
3209 adDynamicQuery.Execute(baqQuery, executionDS);
3210 } else {
3211 MessageBox.Show("GetQueryData error1: "+baqName+" not found.");
3212 }
3213 } catch (Exception ex) {
3214 MessageBox.Show("GetQueryData2:Error running BAQ "+orgbaqName+" or "+baqName+":"+ex.Message);
3215 }
3216
3217 var dataTable = adDynamicQuery.QueryResults.Tables[0]; //.Copy();
3218 adDynamicQuery.Dispose();
3219 return dataTable;
3220 }
3221
3222 void SetGridDropDown(UltraGrid grid, string columnName, string BAQ) {
3223 try {
3224 grid.DisplayLayout.Bands[0].Columns[columnName].Style = ColumnStyle.DropDownValidate;
3225 var theList = new ValueList();
3226 var parameters = new Hashtable();
3227
3228 var dt = GetQueryData(BAQ, parameters);
3229
3230 foreach (DataRow row in dt.Rows)
3231 theList.ValueListItems.Add(row["Calculated_Display"].ToString(), row["Calculated_Value"].ToString());
3232
3233 grid.DisplayLayout.Bands[0].Columns[columnName].ValueList = theList;
3234 } catch (Exception ex) {
3235 MessageBox.Show("Modify Grid error: "+ex.Message);
3236 }
3237 }
3238
3239 void SetGridDropDown(UltraGrid grid, string columnName, string[] color_array) {
3240 try {
3241 grid.DisplayLayout.Bands[0].Columns[columnName].Style = ColumnStyle.DropDownValidate;
3242 var theList = new ValueList();
3243 foreach (var color in color_array)
3244 theList.ValueListItems.Add(color);
3245 grid.DisplayLayout.Bands[0].Columns[columnName].ValueList = theList;
3246 } catch (Exception ex) {
3247 MessageBox.Show("Modify Grid error: "+ex.Message);
3248 }
3249 }
3250
3251 void SetGridDropDown(UltraGrid grid, string columnName, List<string> color_array) {
3252 try {
3253 grid.DisplayLayout.Bands[0].Columns[columnName].Style = ColumnStyle.DropDownValidate;
3254 var theList = new ValueList();
3255 foreach (var color in color_array)
3256 theList.ValueListItems.Add(color);
3257 grid.DisplayLayout.Bands[0].Columns[columnName].ValueList = theList;
3258 } catch (Exception ex) {
3259 MessageBox.Show("Modify Grid error: "+ex.Message);
3260 }
3261 }
3262
3263 void CopyFromPrevious(bool bCopyContact) {
3264 try {
3265 if (edvOrderDtl.Row<=0)
3266 return;
3267 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["RowMod"].ToString()!="A")
3268 return;
3269 m_copying = true;
3270 foreach (DataColumn column in edvOrderDtl.dataView.Table.Columns)
3271 if (m_hashCopyColumns.Contains(column.ColumnName.ToLower()))
3272 if (bCopyContact==false && (column.ColumnName.ToLower().StartsWith("percon") || column.ColumnName.ToLower().StartsWith("employeenum_c"))) { } else if (
3273 bCopyContact==false && (column.ColumnName.ToLower()=="cpe_mouldright_c" || column.ColumnName.ToLower()=="cpe_mouldleft_c" ||
3274 column.ColumnName.ToLower()=="cpe_cast_c")) { } else {
3275 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row][column.ColumnName] = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row-1][column.ColumnName];
3276 }
3277
3278 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["DocUnitPrice"] = edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row-1]["DocUnitPrice"];
3279 m_copying = false;
3280 } catch (Exception ex) {
3281 MessageBox.Show("Copy from previous error: "+ex.Message);
3282 }
3283 }
3284
3285 #region Fancy Searches
3286 bool LaunchContactSearch(string select) {
3287 DebugMsg("Launching contact search.", select);
3288 txtQuery.Text = select;
3289 var nothingFound = false;
3290 try {
3291 string oneRow;
3292 if (m_ContactSearch.InitSearch(SQLServer, Database, SQLPass, SQLUser, select, false, out nothingFound, false, out oneRow)) {
3293 DebugMsg("OneRow: {0}", oneRow);
3294
3295 if (string.IsNullOrEmpty(oneRow)) {
3296 DebugMsg("Raising search dialog.");
3297 m_ContactSearch.ShowDialog();
3298 } else {
3299 m_ContactSearch.m_bSelected = true;
3300 }
3301
3302 if (!m_ContactSearch.m_bSelected)
3303 return nothingFound;
3304
3305 grdDtlList.ActiveCell = grdDtlList.ActiveRow.Cells["PartNum"];
3306 grdDtlList.PerformAction(UltraGridAction.EnterEditMode, false, false);
3307 var perConID = Convert.ToInt32(m_ContactSearch.m_dtSelected.Rows[0]["PerConID"]);
3308
3309 //greg - percon has been selected. Query to see if there's any comments on the contact and show in messagebox if so.
3310 if (m_ContactSearch.m_dtSelected.Rows[0]["Comment"]!=DBNull.Value) {
3311 var temp = m_ContactSearch.m_dtSelected.Rows[0]["Comment"].ToString();
3312 if (!string.IsNullOrEmpty(temp))
3313 MessageBox.Show("LaunchContactSearch error: "+temp);
3314 }
3315
3316 if (m_ContactSearch.m_dtSelected.Rows[0]["LastName"]!=DBNull.Value)
3317 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConLastName_c"].ToString()!=m_ContactSearch.m_dtSelected.Rows[0]["LastName"].ToString())
3318 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConLastName_c"] = m_ContactSearch.m_dtSelected.Rows[0]["LastName"].ToString();
3319 if (m_ContactSearch.m_dtSelected.Rows[0]["FirstName"]!=DBNull.Value)
3320 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConFirstName_c"].ToString()!=m_ContactSearch.m_dtSelected.Rows[0]["FirstName"].ToString())
3321 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConFirstName_c"] = m_ContactSearch.m_dtSelected.Rows[0]["FirstName"].ToString();
3322
3323 if (m_ContactSearch.m_dtSelected.Rows[0]["DOB"]!=DBNull.Value)
3324 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConDOB_c"].ToString()!=m_ContactSearch.m_dtSelected.Rows[0]["DOB"].ToString())
3325 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConDOB_c"] = m_ContactSearch.m_dtSelected.Rows[0]["DOB"];
3326
3327 if (m_ContactSearch.m_dtSelected.Rows[0]["EmployeeNum"]!=DBNull.Value)
3328 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"].ToString()!=m_ContactSearch.m_dtSelected.Rows[0]["EmployeeNum"].ToString())
3329 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["EmployeeNum_c"] = m_ContactSearch.m_dtSelected.Rows[0]["EmployeeNum"];
3330
3331 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"].ToString()!=m_ContactSearch.m_dtSelected.Rows[0]["Company"].ToString())
3332 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerConCorpName_c"] = m_ContactSearch.m_dtSelected.Rows[0]["Company"];
3333
3334 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"].ToString()!=perConID.ToString())
3335 edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PerCon_c"] = perConID;
3336
3337 if (edvOrderDtl.dataView.Table.Rows[edvOrderDtl.Row]["PartNum"].ToString().EndsWith("R")) {
3338 select =
3339 string.Format(
3340 "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', "+
3341 " case when PerCon_1_2_c = {0} then '1' when PerCon_3_4_c = {0} then '3' when PerCon_5_6_c = {0} then '5' when PerCon_7_8_c = {0} then '7' when PerCon_9_10_c = {0} then '9' else '' end as RightMould, "+
3342 " case when PerCon_1_2_c = {0} then '2' when PerCon_3_4_c = {0} then '4' when PerCon_5_6_c = {0} then '6' when PerCon_7_8_c = {0} then '8' when PerCon_9_10_c = {0} then '10' else '' end as LeftMould, "+
3343 " case when PerCon_1_2_c = {0} then lotnum + '1-2' when PerCon_3_4_c = {0} then lotnum + '3-4' when PerCon_5_6_c = {0} then lotnum + '5-6' when PerCon_7_8_c = {0} then lotnum + '7-8' when PerCon_9_10_c = {0} then lotnum + '9-10' else '' end as SerialNo, "+
3344 " case when PerCon_1_2_c = {0} then PerCon_1_2_Notes_c when PerCon_3_4_c = {0} then PerCon_3_4_Notes_c when PerCon_5_6_c = {0} then PerCon_5_6_Notes_c when PerCon_7_8_c = {0} then PerCon_7_8_Notes_c when PerCon_9_10_c = {0} then PerCon_9_10_Notes_c else '' end as Notes from dbo.partlot where company = '{1}' and expirationdate > GETDATE() and ( PerCon_1_2_c = {0} or PerCon_3_4_c = {0} or PerCon_5_6_c = {0} or PerCon_7_8_c = {0} or PerCon_9_10_c = {0})",
3345 perConID, ((Session)oTrans.Session).CompanyID);
3346 if (((Session)oTrans.Session).CompanyID=="250")
3347 select =
3348 string.Format(
3349 "select lotnum as 'Cast_Number', ExpirationDate as 'Expiration-Date', "+
3350 " case when PerCon_1_2_c = glb.perconid then '1' when PerCon_3_4_c = glb.perconid then '3' when PerCon_5_6_c = glb.perconid then '5' when PerCon_7_8_c = glb.perconid then '7' when PerCon_9_10_c = glb.perconid then '9' else '' end as RightMould, "+
3351 " case when PerCon_1_2_c = glb.perconid then '2' when PerCon_3_4_c = glb.perconid then '4' when PerCon_5_6_c = glb.perconid then '6' when PerCon_7_8_c = glb.perconid then '8' when PerCon_9_10_c = glb.perconid then '10' else '' end as LeftMould, "+
3352 " case when PerCon_1_2_c = glb.perconid then lotnum + '1-2' when PerCon_3_4_c = glb.perconid then lotnum + '3-4' when PerCon_5_6_c = glb.perconid then lotnum + '5-6' when PerCon_7_8_c = glb.perconid then lotnum + '7-8' when PerCon_9_10_c = glb.perconid then lotnum + '9-10' else '' end as SerialNo, "+
3353 " case when PerCon_1_2_c = glb.perconid then PerCon_1_2_Notes_c when PerCon_3_4_c = glb.perconid then PerCon_3_4_Notes_c when PerCon_5_6_c = glb.perconid then PerCon_5_6_Notes_c when PerCon_7_8_c = glb.perconid then PerCon_7_8_Notes_c when PerCon_9_10_c = glb.perconid then PerCon_9_10_Notes_c else '' end as Notes from dbo.partlot as pl with (nolock) join erp.glbpercon as glb with (nolock) on pl.company = glb.company and glb.glbperconid = {0} and ( pl.PerCon_1_2_c = glb.perconid or pl.PerCon_3_4_c = glb.perconid or pl.PerCon_5_6_c = glb.perconid or pl.PerCon_7_8_c = glb.perconid or pl.PerCon_9_10_c = glb.perconid ) where pl.company = '200' and expirationdate > GETDATE() ",
3354 perConID);
3355 LaunchCastSearch(select, false);
3356 }
3357 }
3358 } catch (Exception ex) {
3359 MessageBox.Show(string.Format("Launch Search error: {0}\n\n{1}", ex.Message, select));
3360 }
3361
3362 return nothingFound;
3363 }
3364
3365 void LaunchCastSearch(string select, bool bAlwaysShow) {
3366 DebugMsg("Launching cast search.", select);
3367 txtQuery.Text = select;
3368 try {
3369 string oneCastNum;
3370 var salesUM = edvOrderDtl.CurrentDataRow["SalesUM"].ToString().Trim().ToLower();
3371 bool nothingFound;
3372 if (m_CastSearch.InitSearch(SQLServer, Database, SQLPass, SQLUser, select, false, out nothingFound, true, out oneCastNum)) {
3373 if (string.IsNullOrEmpty(oneCastNum) || bAlwaysShow) {
3374 m_CastSearch.ShowDialog();
3375 if (m_CastSearch.m_bSelected) {
3376 grdDtlList.ActiveCell = grdDtlList.ActiveRow.Cells["PartNum"];
3377 grdDtlList.PerformAction(UltraGridAction.EnterEditMode, false, false);
3378 var castNum = Convert.ToString(m_CastSearch.m_dtSelected.Rows[0]["Cast_Number"]);
3379 var leftMould = Convert.ToString(m_CastSearch.m_dtSelected.Rows[0]["leftMould"]);
3380 var rightMould = Convert.ToString(m_CastSearch.m_dtSelected.Rows[0]["rightMould"]);
3381 if (castNum.ToLower()=="new") {
3382 castNum = "";
3383 leftMould = "";
3384 rightMould = "";
3385 }
3386
3387 edvOrderDtl.CurrentDataRow["CPE_Cast_c"] = castNum;
3388 if (salesUM=="pr" || salesUM=="right" || salesUM=="ea")
3389 edvOrderDtl.CurrentDataRow["CPE_DspMouldRight_c"] = rightMould;
3390 if (salesUM=="pr" || salesUM=="left" || salesUM=="ea")
3391 edvOrderDtl.CurrentDataRow["CPE_DspMouldLeft_c"] = leftMould;
3392 }
3393 } else if (!string.IsNullOrEmpty(oneCastNum)) {
3394 try {
3395 var leftMould = Convert.ToString(m_CastSearch.m_dtResults.Rows[0]["leftMould"]);
3396 var rightMould = Convert.ToString(m_CastSearch.m_dtResults.Rows[0]["rightMould"]);
3397 if (salesUM=="pr" || salesUM=="right" || salesUM=="ea")
3398 edvOrderDtl.CurrentDataRow["CPE_DspMouldRight_c"] = rightMould;
3399 if (salesUM=="pr" || salesUM=="left" || salesUM=="ea")
3400 edvOrderDtl.CurrentDataRow["CPE_DspMouldLeft_c"] = leftMould;
3401
3402 edvOrderDtl.CurrentDataRow["CPE_MouldRight_c"] = rightMould;
3403
3404 edvOrderDtl.CurrentDataRow["CPE_MouldLeft_c"] = leftMould;
3405 } catch (Exception ex) {
3406 DebugMsg(ex);
3407 }
3408
3409 edvOrderDtl.CurrentDataRow["CPE_Cast_c"] = oneCastNum;
3410 }
3411 } else {
3412 try {
3413 var leftMould = Convert.ToString(m_CastSearch.m_dtResults.Rows[0]["leftMould"]);
3414 var rightMould = Convert.ToString(m_CastSearch.m_dtResults.Rows[0]["rightMould"]);
3415 if (salesUM=="pr" || salesUM=="right" || salesUM=="ea")
3416 edvOrderDtl.CurrentDataRow["CPE_DspMouldRight_c"] = rightMould;
3417 if (salesUM=="pr" || salesUM=="left" || salesUM=="ea")
3418 edvOrderDtl.CurrentDataRow["CPE_DspMouldLeft_c"] = leftMould;
3419 edvOrderDtl.CurrentDataRow["CPE_MouldRight_c"] = rightMould;
3420 edvOrderDtl.CurrentDataRow["CPE_MouldLeft_c"] = leftMould;
3421 } catch (Exception ex) {
3422 DebugMsg(ex);
3423 }
3424
3425 edvOrderDtl.CurrentDataRow["CPE_Cast_c"] = oneCastNum;
3426 }
3427 } catch (Exception ex) {
3428 MessageBox.Show("Launch Cast Search error: "+ex.Message);
3429 }
3430 }
3431 #endregion
3432
3433 void DebugMsg(Exception e) {
3434 //MessageBox.Show(string.Format("Error: {0}{1}At: {2}", e.Message, Environment.NewLine, e.StackTrace));
3435 }
3436
3437 void DebugMsg(string msg, params object[] stuff) {
3438 //MessageBox.Show(string.Format(msg, stuff));
3439 }
3440
3441 #region Classes
3442 public class ContactSearch : Form {
3443 public string columnName;
3444 public string selectedValue;
3445 public bool m_bSelected;
3446 public string m_server;
3447 public string m_user;
3448 public string m_password;
3449 public string m_dataBase;
3450 public string m_select;
3451 public bool m_multiSelect;
3452 public DataTable m_dtSelected;
3453 public DataTable m_dtResults;
3454
3455 Button btnSelect;
3456 Button btnCancel;
3457 DataGridView dataGridView1;
3458 readonly IContainer components = null;
3459
3460 public ContactSearch(string title) {
3461 InitializeComponent();
3462 m_dtSelected = new DataTable();
3463 Text = title;
3464 }
3465
3466 public bool InitSearch(string server, string database, string password, string user, string select, bool multiselect, out bool nothingFound, bool newRow,
3467 out string oneRecord) {
3468 oneRecord = "";
3469 nothingFound = false;
3470 m_bSelected = false;
3471 m_server = server;
3472 m_password = password;
3473 m_user = user;
3474 m_dataBase = database;
3475 m_select = select;
3476 m_multiSelect = multiselect;
3477 dataGridView1.MultiSelect = multiselect;
3478
3479 return LoadGrid(out nothingFound, out oneRecord, newRow);
3480 }
3481
3482 protected override void Dispose(bool disposing) {
3483 m_dtSelected.Dispose();
3484 m_dtSelected = null;
3485 if (disposing && components!=null)
3486 components.Dispose();
3487 base.Dispose(disposing);
3488 }
3489
3490 void InitializeComponent() {
3491 btnSelect = new Button();
3492 btnCancel = new Button();
3493 dataGridView1 = new DataGridView();
3494 ((ISupportInitialize)dataGridView1).BeginInit();
3495 SuspendLayout();
3496 //
3497 // btnSelect
3498 //
3499 btnSelect.Location = new Point(12, 192);
3500 btnSelect.Name = "btnSelect";
3501 btnSelect.Size = new Size(117, 26);
3502 btnSelect.TabIndex = 0;
3503 btnSelect.Text = "Select";
3504 btnSelect.UseVisualStyleBackColor = true;
3505 btnSelect.Click += btnSelect_Click;
3506 //
3507 // btnCancel
3508 //
3509 btnCancel.Location = new Point(135, 192);
3510 btnCancel.Name = "btnCancel";
3511 btnCancel.Size = new Size(117, 26);
3512 btnCancel.TabIndex = 1;
3513 btnCancel.Text = "Cancel";
3514 btnCancel.UseVisualStyleBackColor = true;
3515 btnCancel.Click += btnCancel_Click;
3516 //
3517 // dataGridView1
3518 //
3519 dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
3520 dataGridView1.Location = new Point(12, 12);
3521 dataGridView1.Name = "dataGridView1";
3522 dataGridView1.Size = new Size(840, 174);
3523 dataGridView1.TabIndex = 2;
3524 dataGridView1.CellContentClick += dataGridView1_CellContentClick;
3525 dataGridView1.CellDoubleClick += dataGridView1_CellDoubleClick;
3526 dataGridView1.Anchor = AnchorStyles.Top|AnchorStyles.Right|AnchorStyles.Left;
3527 //
3528 // Form1
3529 //
3530 AutoScaleDimensions = new SizeF(6F, 13F);
3531 AutoScaleMode = AutoScaleMode.Font;
3532 ClientSize = new Size(860, 230);
3533 Controls.Add(dataGridView1);
3534 Controls.Add(btnCancel);
3535 Controls.Add(btnSelect);
3536 Name = "Form1";
3537 Text = "Person / Contact";
3538 Load += Form1_Load;
3539 ((ISupportInitialize)dataGridView1).EndInit();
3540 ResumeLayout(false);
3541 }
3542
3543 void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { }
3544
3545 void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {
3546 m_dtSelected = ((DataTable)dataGridView1.DataSource).Clone();
3547 var row = ((DataRowView)dataGridView1.Rows[e.RowIndex].DataBoundItem).Row;
3548 m_dtSelected.ImportRow(row);
3549 m_bSelected = true;
3550 Close();
3551 }
3552
3553 bool LoadGrid(out bool nothingFound, out string oneRecord, bool newRow) {
3554 nothingFound = false;
3555 oneRecord = "";
3556 try {
3557 dataGridView1.DataSource = null;
3558 m_dtResults = SQLExecuteSelect(m_select);
3559 dataGridView1.DataSource = m_dtResults;
3560
3561 if (m_dtResults.Rows.Count<=0) {
3562 nothingFound = true;
3563 return false;
3564 }
3565
3566 dataGridView1.Rows[0].Selected = true;
3567
3568 if (m_dtResults.Rows.Count==1)
3569 oneRecord = m_dtResults.Rows[0][0].ToString();
3570
3571 if (!newRow)
3572 return true;
3573
3574 var theNewRow = m_dtResults.NewRow();
3575 theNewRow[0] = "New";
3576 for (var index = 1; index<m_dtResults.Columns.Count; ++index)
3577 try {
3578 theNewRow[index] = "";
3579 } catch {
3580 try {
3581 theNewRow[index] = 0;
3582 } catch (Exception ex) {
3583 DebugMsg(ex);
3584 }
3585 }
3586
3587 m_dtResults.Rows.Add(theNewRow);
3588
3589 return true;
3590 } catch (Exception ex) {
3591 MessageBox.Show("LoadGrid error: "+ex.Message);
3592 return false;
3593 }
3594 }
3595
3596 void Form1_Load(object sender, EventArgs e) {
3597 dataGridView1.AllowUserToAddRows = false;
3598 dataGridView1.ReadOnly = true;
3599
3600 m_bSelected = false;
3601 }
3602
3603 void btnCancel_Click(object sender, EventArgs e) {
3604 Close();
3605 }
3606
3607 void btnSelect_Click(object sender, EventArgs e) {
3608 if (dataGridView1.SelectedRows.Count<=0) {
3609 MessageBox.Show("Nothing selected.");
3610 return;
3611 }
3612
3613 m_dtSelected = ((DataTable)dataGridView1.DataSource).Clone();
3614 for (var index = 0; index<dataGridView1.SelectedRows.Count; ++index) {
3615 var row = ((DataRowView)dataGridView1.SelectedRows[index].DataBoundItem).Row;
3616 m_dtSelected.ImportRow(row);
3617 m_bSelected = true;
3618 }
3619
3620 Close();
3621 }
3622
3623 DataTable SQLExecuteSelect(string selectStatement) {
3624 DebugMsg("Executing some sql. {0}{1}", Environment.NewLine, selectStatement);
3625
3626 using (var SQLCon = new SqlConnection()) {
3627 SQLCon.ConnectionString = string.Format("Persist Security Info=false;Integrated Security=false;database={0};User ID={1};password={2};server={3};Connect Timeout=60",
3628 m_dataBase, m_user, m_password, m_server);
3629 SQLCon.Open();
3630 var command = new SqlCommand(selectStatement, SQLCon);
3631 command.CommandTimeout = 90;
3632 var reader = command.ExecuteReader();
3633
3634 var dt = new DataTable();
3635 dt.Load(reader);
3636
3637 foreach (DataColumn col in dt.Columns)
3638 col.ReadOnly = false;
3639
3640 SQLCon.Close();
3641 return dt;
3642 }
3643 }
3644
3645 void DebugMsg(Exception e) {
3646 //MessageBox.Show(string.Format("Error: {0}{1}At: {2}", e.Message, Environment.NewLine, e.StackTrace));
3647 }
3648
3649 void DebugMsg(string msg, params object[] stuff) {
3650 //MessageBox.Show(string.Format(msg, stuff));
3651 }
3652 }
3653 #endregion
3654}