LiFan
2025-04-24 9b3b2eb20b09e13da837a28f16e552ba70a090c4
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
þÿ#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/xcheckbox.hpp>
//#include <xcontrol/xedit.hpp>
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
 
using xml = KXMLDOMDocument;
    class __declspec(dllexport) PaymentEdit : public xframe
    {
    public:
        xstring Paymentmethod = L"";
        xstring currbox;
    public:
        PaymentEdit(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static PaymentEdit* CreateInstance(void* implPtr, void* hWnd)
        {
            PaymentEdit* pWin = new PaymentEdit(implPtr, (HWND)hWnd);
            return pWin;
        }
        int OnOK()
        {
            xaserverarg arg = GetArg();
            if (currbox == L"cbx1")
            {
                xcheckbox cbx1_val1 = GetControl(L"cbx1_val1");
                Paymentmethod = L"ÛNÓT" + cbx1_val1.GetText() + L"Y)QíSÑyhNØn";
            }
            else if (currbox == L"cbx2")
            {
                xcheckbox cbx2_val1 = GetControl(L"cbx2_val1");
                xcheckbox cbx2_val2 = GetControl(L"cbx2_val2");
                Paymentmethod = L"N§RMh7xn‹¤T˜„NØ" + cbx2_val1.GetText() + L"% [š‘Ñÿ OYk>" + cbx2_val2.GetText() + L"Y)QíSÑyhNØn";
            }
            else if (currbox == L"cbx3")
            {
                xcheckbox cbx3_val1 = GetControl(L"cbx3_val1");
                xcheckbox cbx3_val2 = GetControl(L"cbx3_val2");
                xcheckbox cbx3_val3 = GetControl(L"cbx3_val3");
                Paymentmethod = L"N§RMh7xn‹¤T˜„NØ" + cbx3_val1.GetText() + L"% [š‘Ñÿ šŒ'Th<T" + cbx3_val2.GetText() + L"% k>R0Sэ'ÿ OYk>" + cbx3_val3.GetText() + L"Y)QíSÑyhkcg,NØn";
            }
            else if (currbox == L"cbx4")
            {
                Paymentmethod = L"šŒ'Th<TQíO›e¹kcg,SÑyhbSÑyhOÝQýk>R0Sэ'";
            }
            else if (currbox == L"cbx5")
            {
                xcheckbox cbx5_val1 = GetControl(L"cbx5_val1");
                xcheckbox cbx5_val2 = GetControl(L"cbx5_val2");
                Paymentmethod = L"šŒ'Th<T " + cbx5_val1.GetText() + L"% k>R0Sэ'ÿ OYk>" + cbx5_val2.GetText() + L"Y)QíSÑyhNØn";
            }
            else if (currbox == L"cbx6")
            {
                xcheckbox cbx6_val1 = GetControl(L"cbx6_val1");
                Paymentmethod = L"N§RMh7xn‹¤T˜„NØ " + cbx6_val1.GetText() + L"% [š‘Ñÿ OYk>šŒ'Th<TQíO›e¹kcg,SÑyhb€SÑyhOÝQýk>R0Sэ'";
            }
            else
            {
                Paymentmethod = L"";
            }
            arg.AddArg(L"Paymentmethod", Paymentmethod);
            CloseWindow();
            return 1;
        }
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmClose")
            {
                CloseWindow();
                return 1;
            }
            else if (comdid == L"xmOK")
            {
                OnOK();
            }
            return 0;
        }
 
        int OnXCommand(TEvent* evt, LPARAM p)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
 
        int OnCkbCLick(TEvent* evt, LPARAM p)
        {
            LPARAM param = 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();
            if ((HWND)param == cbx_1.GetHWND())
            {
                cbx_2.SetUnCheck();
                cbx_3.SetUnCheck();
                cbx_4.SetUnCheck();
                cbx_5.SetUnCheck();
                cbx_6.SetUnCheck();
                if (state1 == 1)
                {
                    currbox = L"cbx1";
                }
                else
                {
                    currbox = L"";
                }
            }
            else if ((HWND)param == cbx_2.GetHWND())
            {
                cbx_1.SetUnCheck();
                cbx_3.SetUnCheck();
                cbx_4.SetUnCheck();
                cbx_5.SetUnCheck();
                cbx_6.SetUnCheck();
                if (state2 == 1)
                {
                    currbox = L"cbx2";
                }
                else
                {
                    currbox = L"";
                }
            }
            else if ((HWND)param == cbx_3.GetHWND())
            {
                cbx_1.SetUnCheck();
                cbx_2.SetUnCheck();
                cbx_4.SetUnCheck();
                cbx_5.SetUnCheck();
                cbx_6.SetUnCheck();
                if (state3 == 1)
                {
                    currbox = L"cbx3";
                }
                else
                {
                    currbox = L"";
                }
            }
            else if ((HWND)param == cbx_4.GetHWND())
            {
                cbx_1.SetUnCheck();
                cbx_2.SetUnCheck();
                cbx_3.SetUnCheck();
                cbx_5.SetUnCheck();
                cbx_6.SetUnCheck();
                if (state4 == 1)
                {
                    currbox = L"cbx4";
                }
                else
                {
                    currbox = L"";
                }
            }
            else if ((HWND)param == cbx_5.GetHWND())
            {
                cbx_1.SetUnCheck();
                cbx_2.SetUnCheck();
                cbx_3.SetUnCheck();
                cbx_4.SetUnCheck();
                cbx_6.SetUnCheck();
                if (state5 == 1)
                {
                    currbox = L"cbx5";
                }
                else
                {
                    currbox = L"";
                }
            }
            else if ((HWND)param == cbx_6.GetHWND())
            {
                cbx_1.SetUnCheck();
                cbx_2.SetUnCheck();
                cbx_3.SetUnCheck();
                cbx_4.SetUnCheck();
                cbx_5.SetUnCheck();
                if (state6 == 1)
                {
                    currbox = L"cbx6";
                }
                else
                {
                    currbox = L"";
                }
            }
            return 1;
        }
 
        int OnAttachEvent()
        {
            AttachEvent(L"WM_XCOMMAND", (FEvent)&PaymentEdit::OnXCommand);
            AttachEvent(L"WM_COMMAND", (FEvent)&PaymentEdit::OnCkbCLick);
            return 1;
        }
 
        int onload()
        {
            SetArg();
            OnAttachEvent();
            return 1;
        }
    };