xj qian
2024-08-21 9ac9cc9e9cd91b97d35a6e28400df71630765e40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
#include <wobject/xwin.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xoffice.hpp>
#include <xcontrol/xcell.hpp>
#include <xcontrol/xflowchart.hpp>
#include <xcontrol/ximageview.hpp>
#include <xcontrol/xcombobox.hpp>
#include "xcontrol/xshtml.hpp"
 
#include <vbusiness/vutil/publiccode.vutil.vbusiness.hpp>
#include "viewobject/view.base.hpp"
#include "vbusiness/vframe/frame.vframe.vbusiness.hpp"
#include "viewobject/productlibrary.view.hpp"
 
using xml = KXMLDOMDocument;
    class __declspec(dllexport) ProductNewList : public xframe
    {
    public:
        ProductNewList(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static ProductNewList* CreateInstance(void* implPtr, void* hWnd)
        {
            ProductNewList* pWin = new ProductNewList(implPtr, (HWND)hWnd);
            return pWin;
        }
    public:
        xdwgrid    dw_list;
        KXMLDOMElement imageElement;
        xnode    m_agentNode;    //Agent Condition
 
        int SetAgent()
        {
            xstring xfNodeAgentArea = L"agentarea";
            xnode anode = GetAgentNode(xfNodeAgentArea);
            if (m_agentNode)
            {
                SetAgentNode(anode, m_agentNode);
            }
            else
            {
                KXMLDOMElement xframeElement = GetElement();
                KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
                if (agent)
                {
                    xstring s = agent.xml();
                    m_agentNode = SetAgentNode(anode, s);
                }
            }
            return 1;
        }
 
        //½¹µã¼¤»î´¦Àíº¯Êý
        int OnSetFocus(TEvent * evt, int param)
        {
            //ÖØÖù¤¾ßÌõ
            SetAgent();
            return 1;
        }
 
        int OnRetrieve()
        {
            xml x;
            xcontrol query = GetControl(L"sle_search");
            xstring keyword = query.GetText();
            //alert(keyword);
        
            xaserverarg arg ;
            
            arg.AddArg(L"keyword", keyword);
            if (xurl::get(L"/sale/data/ProductLibrary3/data/list/newlist", arg.GetString(), x) != 1)
            {
                xstring error = x.text();
                trace(error);
            }
            else
            {
                //alert(x.GetXml());
                dw_list.Retrieve(x);
                //dw_list.SetReadOnly(true);
            }
 
            for (int i = 1; i <= dw_list.GetColumnCount(); i++)
            {
                //trace(dw_list.GetColumnName(i));
                if (dw_list.GetColumnName(i) != L"GoodsNo" &&
                    dw_list.GetColumnName(i) != L"EName" &&
                    dw_list.GetColumnName(i) != L"CName")
                    dw_list.SetReadOnlyColumn(i);
            }
            dw_list.Redraw();
            return 1;
        }
 
        int OnRetrieveEx()
        {
            xml x;
            xcontrol query = GetControl(L"sle_search");
            xstring keyword = query.GetText();
            //alert(keyword);
        
            xaserverarg arg ;
            
            arg.AddArg(L"keyword", keyword);
            if (xurl::get(L"/sale/data/ProductLibrary3/data/list/newlistEx", arg.GetString(), x) != 1)
            {
                xstring error = x.text();
                trace(error);
            }
            else
            {
                //alert(x.GetXml());
                dw_list.Retrieve(x);
                //dw_list.SetReadOnly(true);
            }
 
            for (int i = 1; i <= dw_list.GetColumnCount(); i++)
            {
                //trace(dw_list.GetColumnName(i));
                if (dw_list.GetColumnName(i) != L"GoodsNo" &&
                    dw_list.GetColumnName(i) != L"EName" &&
                    dw_list.GetColumnName(i) != L"CName")
                    dw_list.SetReadOnlyColumn(i);
            }
            dw_list.Redraw();
            return 1;
        }
 
        xml  GetGoodsPropList(xstring guid)
        {
            xml x;
        
            xaserverarg arg ;
            
            arg.AddArg(L"guid", guid);
            if (xurl::get(L"/sale/data/SO/goods/goodsprop/list", arg.GetString(), x) != 1)
            {
                xstring error = x.text();
                alert(error);
            }
            return x;
        }
 
        xml  GetGoodsPropListEx(xstring guid)
        {
            xml x;
        
            xstring fields = L"<data>";
            //fields +=L"<field name='HighestPrice' label='×î¸ß¼Û'/>";
            //fields +=L"<field name='LowestPrice' label='×îµÍ¼Û'/>";
 
            //fields +=L"<field name='BulkPrice' label='É¢»õ¼Û'/>";
            //fields +=L"<field name='CardPrice' label='Ö½¿¨¼Û'/>";
            //fields +=L"<field name='BuyPrice' label='²É¹º¼Û'/>";
            //fields +=L"<field name='SupplierID' label='»õÔ´'/>";
 
            fields += L"<field name='Packing' label='°ü×°·½Ê½'/>";
            fields += L"<field name='PackingRate' label='ÿÏäÊýÁ¿'/>";
            fields += L"<field name='VolumeDesc1' label='°ü×°³ßÂë'/>";
            fields += L"<field name='GWPerPkg' label='Ã«ÖØ'/>";
            fields += L"<field name='NWPerPkg' label='¾»ÖØ'/>";
            //fields +=L"<field name='DeveloperID' label='¿ª·¢ÈËÔ±'/>";
            fields += L"<field name='AttributeValue_1' label='²úÆ·ÊôÐÔ'/>";
            //fields +=L"<field name='Remark' label='±¸×¢'/>";
 
            fields += L"</data>";
            x.loadXML(fields);
 
            return x;
        }
 
        xstring makeHtml(int row)
        {
            xstring id = dw_list.GetGuid(row);
 
            xml x = GetGoodsPropList(id);
            xml x1 = GetGoodsPropListEx(id);
 
            xstring html = L"<html><style> .text{ font-weight:400} .label { font-weight:400;}</style><body style='margin:2;background-color:#ccdccc none #f0f0f0 none'>";
            html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >±àºÅ:</span><span  style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"SKUNo") +
                L"</span> <span style='font-weight:700;width:50;font-size:10pt' >ÀàÏî:</span><span  style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"RefNo") +
                L"</span></div>";
            html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >¹«Ë¾ÐͺÅ:</span><span  style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"GoodsNo") +
                L"</span></div>";
            html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >Æ·Ãû:</span><span  style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"CName") +
                L"</span></div>";
            if (dw_list.GetItemString(row, L"CSpec") != L"")
                html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >¹æ¸ñ:</span><span  style='width:90;font-size:10pt'>" + dw_list.GetItemString(row, L"CSpec") +
                L"</span></div>";
 
            KXMLDOMNodeList fieldsEx = x1.selectNodes(L"data/field");
            xstring ls_detail = L"";
            xstring ls_item = L"";
            xstring name;
            xstring label;
            int len = fieldsEx.length();
            int i = 0;
 
            for (i = 0; i < len; true)
            {
                int cnt = 0;
                ls_item = L"";
                while (cnt < 2)
                {
                    name = fieldsEx.item(i).selectSingleNode(L"@name").text();
                    label = fieldsEx.item(i).selectSingleNode(L"@label").text();
                    ls_item += L"<td>" + label + L"</td>" + L"<td style='text-align:center'>" + dw_list.GetItemString(row, name) + L"</td>";
                    cnt++;
                    i++;
                    if (i == len)break;
                }
                ls_detail += L"<tr>" + ls_item + L"</tr>";
            }
            html += (xstring)L"<div style='margin-left:8px;margin-right:16px;'>" +
                +L"<table><colgroup span='1' width='70'/><colgroup span='1' width='120'/><colgroup span='1' width='70'/><colgroup span='1' width='120'/>"
                + ls_detail
                + L"</table>"
                + L"</div>";
 
            xstring ls_star = L"";
            KXMLDOMNodeList fields = x.selectNodes(L"data/field");
            len = fields.length();
 
            ls_detail = L"";
            if (len > 0)
                html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >¼¼ÊõÒªÇó:</span></div>";
            for (i = 0; i < len; true)
            {
                ls_item = L"";
 
                int count = 0;
                while (count < 2)
                {
                    name = fields.item(i).selectSingleNode(L"@name").text();
                    label = fields.item(i).selectSingleNode(L"@label").text();
                    if (name == L"QualityTerm" || name == L"PackTerm" || label == L"ÖÊÁ¿" || label == L"°ü×°ÖÊÁ¿" || label == L"¼¼ÊõÒªÇó")
                    {
                        i++;
                        if (i >= len)count = 2;
                        continue;
                    }
                    else if (dw_list.GetItemString(row, name) == L"")
                    {
                        KXMLDOMNodeList options = fields.item(i).selectNodes(L"item");
                        int tlen = options.length();
                        xstring terms = L"";
                        for (int k = 0; k < tlen; k++)
                        {
                            if (options.item(k).text())
                            {
                                if (k > 0) terms += L", L";
                                terms += L"[" + xstring(options.item(k).text()) + L"]";
                            }
                        }
                        ls_star += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >" + label + L"*:</span><span  style='width:90;font-size:10pt'>" + terms + L"</span></div>";
                    }
                    else
                    {
                        ls_item = L"<td>" + label + L"</td>" + L"<td>" + dw_list.GetItemString(row, name) + L"</td>";
                        count++;
                    }
                    i++;
                    if (i >= len)count = 2;
                }
                ls_item = L"<tr>" + ls_item + L"</tr>";
                ls_detail += ls_item;
            }
 
            html +=(xstring) L"<div style='margin-left:8px;margin-right:16px;'>" +
                +L"<table><colgroup span='1' width='70'/><colgroup span='1' width='120'/><colgroup span='1' width='70'/><colgroup span='1' width='120'/>"
                + ls_detail
                + L"</table>"
                + L"</div>";
            if (dw_list.GetItemString(row, L"QualityTerm") != L"")
            {
                html += L"<div style='height:12px'/>";
                html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >ÖÊÁ¿:</span></div>";
                html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt'  >" + dw_list.GetItemString(row, L"QualityTerm") + L"</span></div>";
            }
 
            if (dw_list.GetItemString(row, L"PackTerm") != L"")
            {
                html += L"<div style='height:12px'/>";
                html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >°ü×°ÖÊÁ¿:</span></div>";
                html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt' >" + dw_list.GetItemString(row, L"PackTerm") + L"</span></div>";
            }
 
            if (dw_list.GetItemString(row, L"Remark") != L"")
            {
                //html +=  L"<div style='height:12px'/>";
                html += L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >±¸×¢:</span></div>";
                html += L"<div ><span style='margin-left:8px;margin-right:16px;font-weight:400;font-size:10pt' >" + dw_list.GetItemString(row, L"Remark") + L"</span></div>";
            }
 
            html += L"<div style='height:24px'/>";
 
            //ÐDZêÏî
            html += ls_star;
 
            //ÏÔʾͼƬ    
            /*
            if (id != L"")
            {
                xml xp=new xml;
                xp.setNativePointer(xml::CreateInstance());
                xaserverarg arg_pic=new xaserverarg;
                arg_pic.setNativePointer(arg_pic.CreateInstance());
                arg_pic.AddArg(L"SKUID",id);
                if(xurl::get(L"/sale/data/ProductLibrary3/pref/picture/imagelistSKU",arg_pic.GetString(),xp)!=1)
                {
                    trace(L"xxx",xp.GetXml());
                }else {
                    html +=  L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >ͼƬ:</span>"    ;
                    KXMLDOMElement ep=  xp.selectSingleNode(L"ImageList");
                    if (ep)
                    {
                        if (ep.SelectNodes(L"image")){
                            KXMLDOMNodeList  nlistp = ep.SelectNodes(L"image");
                            int ip=0;
                            int lenp = nlistp.length();
                            for(ip=0;ip<lenp;ip++)
                            {
                                KXMLDOMElement xitemp = nlistp.item(ip);
                                xstring filename = xitemp.selectSingleNode(L"PicPath").text();
                                //trace(filename);
                                html +=  L"<control visible='layer' controlclass='ximage'  data='' src='http://192.168.7.241:7001" +  filename +L"'/>";
                            }
                        }
                    }
                    html +=  L"</div>";
                }
            }else {
                xstring picname = L"1FA9E331-F95C-4E51-B80C-73FB9B911D8D.jpg";//dw_list.GetItemString(row,L"ImgName"); //ItemID+L".jpg";
                xstring str = picname.mid(0,2);
                str = str.upper();
                xstring serversrc =L"http://192.168.7.241:1001/business/products/chanpin/"+str+L"/"+picname;
                html +=  L"<div ><span style='font-weight:700;width:50;font-size:10pt'  >ͼƬ:</span>";
                html +=  L"<control visible='layer' controlclass='ximage'  data='' src='"+ serversrc +L"'/></div>";
            }
            */
            html += L"</body></html>";
            //trace(html);
            return html;
        }
 
        int OnShowImage(xstring skuid)
        {
            ximageview im = GetControl(L"im1");
            //im.RemoveImage();
            im.Reset();
 
            xml xp;
            
            xaserverarg arg_pic ;
            
            arg_pic.AddArg(L"SKUID", skuid);
            if (xurl::get(L"/sale/data/ProductLibrary3/pref/picture/imagelistSKU", arg_pic.GetString(), xp) != 1)
            {
                trace(L"xxx:" + xstring(xp.xml(), true));
            }
            else
            {
                //trace(skuid+L" "+xp.GetXml());
                imageElement = xp.documentElement();
                KXMLDOMNodeList  nlistp = xp.selectNodes(L"ImageList/image");
                int lenp = nlistp.length();
                for (int ip = 0; ip < lenp; ip++)
                {
                    KXMLDOMElement xitem = nlistp.item(ip);
                    xstring picname = xitem.selectSingleNode(L"PicPath").text();
                    xstring goodno = xitem.selectSingleNode(L"GoodsNo").text();
                    if (picname == L"/business/products/Thumbs//")
                        picname = L"/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg";
                    im.AddImages(picname, L"");
                }
                im.Redraw();
                //win32::SendMessage(im.GetId(),0x000f,0,1);
                //win32::InvalidateRect(im.GetId(),cast(0 as ref xrect),true);
            }
            return 1;
        }
 
        int OnRowChanged(TEvent* evt, int p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            int row = hdr.row;
 
            xshtml xs = GetControl(L"html_detail");
            xstring html = makeHtml(row);
            xs.SetContent(html);
            xs.Redraw();
 
            xstring id = dw_list.GetGuid(row);
            OnShowImage(id);
 
            return 1;
        }
 
        int OnImgDBClicked(TEvent* evt, int pr)
        {
            IMGNNMHDR& nmtv = *(IMGNNMHDR*)evt->notify.pnmh;
            xstring src = nmtv.path;
            /*if(src.length() > 60)
                src = src.right(44);
            else
                src=src.mid(src.find(L"Thumbs", 0)+6, 50);
            */
            xaserverarg& arg = *new xaserverarg;
            
            //arg.AddArg(L"src",L"/business/products/chanpin"+src);    
            arg.AddArg(L"src", src);
 
            //win::OpenWindow(L"dev:xpage[BigPicture.vx]",arg);    
 
            //int h = (L"/sale/view/ProductLibrary/xpage/bigpictureview", arg);    
            int h = openUrl(L"dev:xpage[BigPictureView.Product3.vx]", &arg);
 
            /*
            xwin x = new xwin;
            x.setNativePointer(h);
            m_winHwnd = x.GetHWND();
 
            xstring sh = doc.GetXml();
            int p = cast(sh as int);
            win32::SendMessage(m_winHwnd, 0x401, p, 0);
            */
            return 1;
        }
 
        int OnSave()
        {
            dw_list.AcceptText();
            if (dw_list.GetRowCount() < 1) return 0;
            xstring error = L"";
            xml x;
            
            dw_list.DwUpdateAllToEx(x);
            xaserverarg arg ;
            
            arg.AddArg(L"content", x.xml());
 
            //trace(x.GetXml());
            if (xurl::get(L"/sale/data/ProductLibrary3/update/productex", arg.GetString(), x) != 1)
            {
                error = x.text();
                alert(error);
                return 1;
            }
            else
            {
                alert(L"±£´æ³É¹¦");
                arg.AddArg(L"No", dw_list.GetItemString(dw_list.GetRow(), L"SKUNo"));
                if (xurl::get(L"/sale/data/business/message/productApplyedMessage", arg.GetString(), x) != 1)
                {
                    error = x.text();
                    trace(error);
                    return 0;
                }
            }
            return 1;
        }
        int OnMakeNewGoodsNo()
        {
            if (dw_list.GetItemString(dw_list.GetRow(), L"GoodsNo") != L"") return 1;
            if (dw_list.GetRowCount() < 1) return 1;
            xaserverarg arg;
 
            arg.AddArg(L"EntityID", dw_list.GetGuid(dw_list.GetRow()));
            KXMLDOMElement e = dw_list.GetRowElement(dw_list.GetRow());
            arg.SetParam(L"data", e);
            arg.SetParam(L"dw", dw_list);
            arg.SetParam(L"HWND", GetHWND());
            OpenWindow(L"dev:xpage[ProductNewItem.vx]", arg);
            return 1;
 
        }
 
        //ÃüÁî·¢²¼º¯Êý
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmCancel")
            {
                CloseWindow();
                return 1;
            }
            if (comdid == L"xmMakeGoodsNo")
            {
                return OnMakeNewGoodsNo();
            }
            if (comdid == L"xmProductView")
            {
                OpenWindow(L"dev:xpage[Product.SearchDlg.vx]", 0);
                return 1;
            }
            if (comdid == L"xmRefresh")
            {
                if (xaserver::GetUserNo() != L"00A01")
                {
                    OnRetrieve();
                }
                else
                {
                    OnRetrieveEx();
                }
                return 1;
            }
            if (comdid == L"xmDelete")
            {
 
                int row = dw_list.GetNextSelectRow(1);
 
                if (row < 1) {
                    row = dw_list.GetRow();
                    if (row < 1) {
                        //win::MessageBox(GetHWND(),L"ÇëÑ¡ÖÐҪɾ³ýµÄÐУ¡",L"Ìáʾ",0);
                        return -1;
                    }
                }
 
                KXMLDOMElement e = dw_list.GetRowElement(row);
 
                xstring sguid = e.selectSingleNode(L"@guid").text();
 
                int  MB_YESNO = 0x00000004;
                int  IDYES = 6;
                if (MessageBox(GetHWND(), L"È·ÈÏɾ³ýÂð£¿", L"Ìáʾ", MB_YESNO) != IDYES) return 1;
                xml x;
                
                xaserverarg arg ;
                
                arg.AddArg(L"EntityID", sguid);
                //    trace(sguid);
                if (xurl::post(L"/sale/data/ProductLibrary3/delete/Product", arg.GetString(), x) != 1)
                {
                    xstring error = x.text();
                    trace(error);
                }
                else
                {
                    KXMLDOMElement msg = x.selectNodes(L"process").item(0);
                    xstring success = msg.selectSingleNode(L"@finished").text();
                    if (success == L"0")
                    {
                        alert(msg.selectSingleNode(L"@errInfo").text());
                    }
                    else
                    {
                        MessageBox(GetHWND(), L"ɾ³ý³É¹¦£¡", L"Ìáʾ", 0);
                        dw_list.DeleteRow(row);
                    }
                }
                return 1;
            }
 
            if (comdid == L"xmSave")     return OnSave();
 
            return 0;
        }
 
 
 
        //ÃüÁî´¦Àíʼþ
        int OnXCommand(TEvent* evt, int param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
        int OnAttachEvent()
        {
            //°ó¶¨¹¤¾ßÌõµã»÷ʼþ
            AttachEvent(L"WM_XCOMMAND", (FEvent)&ProductNewList::OnXCommand);
            //»ñÈ¡½¹µãʼþ£¬ÓÃÓÚÖØÖù¤¾ßÌõ
            AttachEvent(L"WM_SETFOCUS", (FEvent)&ProductNewList::OnSetFocus);
            AttachEvent(L"dw_list", L"DWV_ROWFOCUSCHANGED", (FEvent)&ProductNewList::OnRowChanged);
            AttachEvent(L"im1", L"IMG_LDBCLICK", (FEvent)&ProductNewList::OnImgDBClicked);
            return 1;
        }
 
        int onload()
        {
            dw_list = GetControl(L"dw_list");
            dw_list.SetDataObject(ProductLibraryView::GetMaintListForm3(L""));
            dw_list.SetEditUpperMode(true);
            dw_list.SetReadOnly(true);
            OnAttachEvent();
 
            dw_list.SetColumnState(L"SKUID", false);
 
            return 1;
        }
 
        int onloaded()
        {
            SetAgent();
 
            if (xaserver::GetUserNo() != L"00A01") OnRetrieve();
 
 
            return 1;
        }
    };