LiFan
2025-04-29 6c8c9ddaeb2bc6245a374c9354296bcfc2d96c06
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
þÿ#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xcheckbox.hpp>
 
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
 
using xml = KXMLDOMDocument;
    class __declspec(dllexport) InspectionSupplier : public xframe
    {
    public:
 
        xstring currbox;
        xstring aa = L"";
        xstring Paymentmethod = L"";
    public:
        InspectionSupplier(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static InspectionSupplier* CreateInstance(void* implPtr, void* hWnd)
        {
            InspectionSupplier* pWin = new InspectionSupplier(implPtr, (HWND)hWnd);
            return pWin;
        }
        int OnOK()
        {
 
            xaserverarg arg=GetArg();
            if (aa.find(L",cbx1") >= 0)
            {
                Paymentmethod += L"eà,";
            }
            if (aa.find(L",cbx2") >= 0)
            {
                Paymentmethod += L"BSCI,";
            }
            if (aa.find(L",cbx3") >= 0)
            {
                Paymentmethod += L"ISO,";
            }
            if (aa.find(L",cbx4") >= 0)
            {
                Paymentmethod += L"SEDEX,";
            }
            if (aa.find(L",cbx5") >= 0)
            {
                Paymentmethod += L"WALGREEN,";
            }
            if (aa.find(L",cbx6") >= 0)
            {
                Paymentmethod += L"CVS,";
            }
            if (aa.find(L",cbx7") >= 0)
            {
                Paymentmethod += L"WALMART";
            }
            arg.AddArg(L"ThirdPartyReport", Paymentmethod);
            
            CloseWindow();
            return 1;
        }
 
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmClose")
            {
                CloseWindow();
                return 1;
            }
            else if (comdid == L"xmOK")
            {
                OnOK();
                return 1;
            }
            return 1;
        }
 
        int OnXCommand(TEvent* evt, LPARAM p)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
        int OnCkbCLick(TEvent* evt, LPARAM p)
        {
            HWND param = (HWND)evt->lParam;
            xcheckbox cbx_1 = GetControl(L"cbx1");
            int state1 = cbx_1.GetCheck();
            xcheckbox cbx_2 = GetControl(L"cbx2");
            int state2 = cbx_2.GetCheck();
            xcheckbox cbx_3 = GetControl(L"cbx3");
            int state3 = cbx_3.GetCheck();
            xcheckbox cbx_4 = GetControl(L"cbx4");
            int state4 = cbx_4.GetCheck();
            xcheckbox cbx_5 = GetControl(L"cbx5");
            int state5 = cbx_5.GetCheck();
            xcheckbox cbx_6 = GetControl(L"cbx6");
            int state6 = cbx_6.GetCheck();
            xcheckbox cbx_7 = GetControl(L"cbx7");
            int state7 = cbx_7.GetCheck();
 
 
            if (param == cbx_1.GetHWND())
            {
                if (state1 == 1)
                {
                    aa = aa + L",cbx1";
                    currbox = L"cbx1";
                }
                else
                {
                    aa = aa.replace(L",cbx1", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_2.GetHWND())
            {
                if (state2 == 1)
                {
                    aa = aa + L",cbx2";
                    currbox = L"cbx2";
                }
                else
                {
                    aa = aa.replace(L",cbx2", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_3.GetHWND())
            {
                if (state3 == 1)
                {
                    aa = aa + L",cbx3";
                    currbox = L"cbx3";
                }
                else
                {
                    aa = aa.replace(L",cbx3", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_4.GetHWND())
            {
                if (state4 == 1)
                {
                    aa = aa + L",cbx4";
                    currbox = L"cbx4";
                }
                else
                {
                    aa = aa.replace(L",cbx4", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_5.GetHWND())
            {
                if (state5 == 1)
                {
                    aa = aa + L",cbx5";
                    currbox = L"cbx5";
                }
                else
                {
                    aa = aa.replace(L",cbx5", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_6.GetHWND())
            {
                if (state6 == 1)
                {
                    aa = aa + L",cbx6";
                    currbox = L"cbx6";
                }
                else
                {
                    aa = aa.replace(L",cbx6", L"");
                    currbox = L"";
                }
            }
            else if (param == cbx_7.GetHWND())
            {
                if (state7 == 1)
                {
                    aa = aa + L",cbx7";
                    currbox = L"cbx7";
                }
                else
                {
                    aa = aa.replace(L",cbx7", L"");
                    currbox = L"";
                }
            }
            return 1;
        }
 
        int OnAttachEvent()
        {
            AttachEvent(L"WM_XCOMMAND", (FEvent)&InspectionSupplier::OnXCommand);
            AttachEvent(L"WM_COMMAND", (FEvent)&InspectionSupplier::OnCkbCLick);
            return 1;
        }
 
        int onload()
        {
            SetArg();
            OnAttachEvent();
            return 1;
        }
    };