| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #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 <vbusiness/vutil/publiccode.vutil.vbusiness.hpp> |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) FactoryPaymentMethod : public xwin |
| | | { |
| | | public: |
| | | FactoryPaymentMethod(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static FactoryPaymentMethod* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | FactoryPaymentMethod* pWin = new FactoryPaymentMethod(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | public: |
| | | xdwgrid dw_list; |
| | | xoffice dw_office; |
| | | xcell dw_cell; |
| | | xnode m_agentNode; //Agent Condition |
| | | xstring m_category; |
| | | xstring argStr; |
| | | |
| | | 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 OnCmdDispatch(xstring comdid) |
| | | { |
| | | HCURSOR hCursor = 0; |
| | | if (comdid == L"xmQuery") |
| | | { |
| | | xaserverarg ar; |
| | | |
| | | ar.AddArg(L"argurl", L"/sale/view/Total3/arg/GDNItemshipfull"); |
| | | if (argStr != L"") |
| | | ar.AddArg(L"arg", argStr); |
| | | ar.AddArg(L"action", L""); |
| | | OpenWindow(L"dev:xpage[view.total.arg.vx]", ar); |
| | | xstring arstr = ar.GetArgString(L"arg"); |
| | | if (arstr != L"" && ar.GetArgString(L"action") == L"ok") |
| | | { |
| | | argStr = arstr; |
| | | hCursor = xutil::SetCursorWait(); |
| | | OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/FactoryPaymentMethod", argStr); |
| | | |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | else |
| | | { |
| | | argStr = L""; |
| | | OnRetrieve(L"/sale/data/Total3/total/GDNTotal/Item/FactoryPaymentMethod", argStr); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | int OnCombboChanged(TEvent* evt, int lParam) |
| | | { |
| | | int h = xcombobox::GetCurSel(evt->command.hCtrl); |
| | | if (h > -1) |
| | | { |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | KXMLDOMElement e = xcombobox::GetItemData(evt->command.hCtrl, h); |
| | | |
| | | PostMessage(GetHWND(), 0x401, (WPARAM)L"xmQuery", 0); |
| | | //OnCmdDispatch(L"xmQuery"); |
| | | xutil::RestoreCursor(hCursor); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, int param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnDWClick(TEvent* evt, int p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | |
| | | if (row < 1) return 1; |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&FactoryPaymentMethod::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&FactoryPaymentMethod::OnSetFocus); |
| | | AttachEvent(L"cb_report", L"CBN_SELCHANGE", (FEvent)&FactoryPaymentMethod::OnCombboChanged); |
| | | AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&FactoryPaymentMethod::OnDWClick); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve(xstring dataurl, xstring argstr) |
| | | { |
| | | dw_list.Reset(); |
| | | |
| | | xml x; |
| | | |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"arg", argstr); |
| | | |
| | | |
| | | if (xurl::get(dataurl, arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.text()); |
| | | dw_list.Redraw(); |
| | | return -1; |
| | | } |
| | | |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl(L"dw_report"); |
| | | dw_office = GetControl(L"dw_office"); |
| | | dw_cell = GetControl(L"dw_cell"); |
| | | dw_list.openUrl(L"/sale/view/Total3/template/business/gdn/FactoryPaymentMethod"); |
| | | |
| | | dw_list.SetColumnState(L"å
è£
ä»·", false); |
| | | dw_list.SetColumnState(L"å
è£
æ»ä»·", false); |
| | | dw_list.SetColumnState(L"UnitPrice", false); |
| | | dw_list.SetColumnState(L"SUMUnitPrice", false); |
| | | dw_list.SetColumnState(L"Packages", false); |
| | | dw_list.SetColumnState(L"HasImage", false); |
| | | dw_list.SetColumnState(L"Note", false); |
| | | |
| | | argStr = L""; |
| | | xcombobox xc = GetControl(L"cb_report"); |
| | | |
| | | |
| | | OnAttachEvent(); |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | OnCmdDispatch(L"xmQuery"); |
| | | return 1; |
| | | } |
| | | }; |