þÿ#include <wobject/xstring.hpp> #include <xcontrol/xtreeview.hpp> #include <xcontrol/xdwgrid.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; if (aa.find(L",cbx1") >= 0) { Paymentmethod += L"eà,L"; } if (aa.find(L",cbx2") >= 0) { Paymentmethod += L"BSCI,L"; } if (aa.find(L",cbx3") >= 0) { Paymentmethod += L"ISO,L"; } if (aa.find(L",cbx4") >= 0) { Paymentmethod += L"SEDEX,L"; } if (aa.find(L",cbx5") >= 0) { Paymentmethod += L"WALGREEN,L"; } if (aa.find(L",cbx6") >= 0) { Paymentmethod += L"CVS,L"; } 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 0; } int OnXCommand(TEvent* evt, LPARAM p) { return OnCmdDispatch(evt->xcommand.pStrID); } int OnCkbCLick(ref TEvent evt, int p) { int param = evt.lParam; xcheckbox cbx_1 = GetControl(L"cbx1"); int state1 = cbx_1.GetCheck(cbx_1.GetId()); xcheckbox cbx_2 = GetControl(L"cbx2"); int state2 = cbx_2.GetCheck(cbx_2.GetId()); xcheckbox cbx_3 = GetControl(L"cbx3"); int state3 = cbx_3.GetCheck(cbx_3.GetId()); xcheckbox cbx_4 = GetControl(L"cbx4"); int state4 = cbx_4.GetCheck(cbx_4.GetId()); xcheckbox cbx_5 = GetControl(L"cbx5"); int state5 = cbx_5.GetCheck(cbx_5.GetId()); xcheckbox cbx_6 = GetControl(L"cbx6"); int state6 = cbx_6.GetCheck(cbx_6.GetId()); xcheckbox cbx_7 = GetControl(L"cbx7"); int state7 = cbx_7.GetCheck(cbx_7.GetId()); if (param == cbx_1.GetId()) { if (state1 == 1) { aa = aa + L",cbx1"; currbox = L"cbx1"; } else { aa = aa.replace(L",cbx1", L""); currbox = L""; } } else if (param == cbx_2.GetId()) { if (state2 == 1) { aa = aa + L",cbx2"; currbox = L"cbx2"; } else { aa = aa.replace(L",cbx2", L""); currbox = L""; } } else if (param == cbx_3.GetId()) { if (state3 == 1) { aa = aa + L",cbx3"; currbox = L"cbx3"; } else { aa = aa.replace(L",cbx3", L""); currbox = L""; } } else if (param == cbx_4.GetId()) { if (state4 == 1) { aa = aa + L",cbx4"; currbox = L"cbx4"; } else { aa = aa.replace(L",cbx4", L""); currbox = L""; } } else if (param == cbx_5.GetId()) { if (state5 == 1) { aa = aa + L",cbx5"; currbox = L"cbx5"; } else { aa = aa.replace(L",cbx5", L""); currbox = L""; } } else if (param == cbx_6.GetId()) { if (state6 == 1) { aa = aa + L",cbx6"; currbox = L"cbx6"; } else { aa = aa.replace(L",cbx6", L""); currbox = L""; } } else if (param == cbx_7.GetId()) { 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() { OnAttachEvent(); return 1; } };