¶Ô±ÈÐÂÎļþ |
| | |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) manageSupplierID : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xdwtable dw_arg; |
| | | xstring DatePicker; |
| | | xnode m_agentNode; //Agent Condition |
| | | public: |
| | | manageSupplierID(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static manageSupplierID* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | manageSupplierID* pWin = new manageSupplierID(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | 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, LPARAM p) |
| | | { |
| | | //é置工å
·æ¡ |
| | | //SetAgent(); |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid==L"xmSearch" ||comdid==L"xmRefresh") |
| | | { |
| | | OnRetrieve(DatePicker); |
| | | return 1; |
| | | } |
| | | if(comdid==L"xmSaveAs") |
| | | { |
| | | dw_list.SaveAs(L""); |
| | | return 1; |
| | | } |
| | | if(comdid==L"xmRefresh") |
| | | { |
| | | OnRetrieve(DatePicker); |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&manageSupplierID::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&manageSupplierID::OnSetFocus); |
| | | AttachEvent(L"cbx_state",L"CBN_SELCHANGE", (FEvent)&manageSupplierID::OnDatePicker); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnDatePicker(TEvent* evt, LPARAM lParam) |
| | | { |
| | | |
| | | int h = xcombobox::GetCurSel(evt->command.hCtrl); |
| | | if(h > -1) |
| | | { |
| | | xstring txt = xcombobox::GetLBText(evt->command.hCtrl, h); |
| | | if(txt==L"åºè¿æ¥æ") |
| | | { |
| | | |
| | | DatePicker=L"ETD"; |
| | | OnRetrieve(DatePicker); |
| | | } |
| | | else if(txt==L"éç¨æ¥æ") |
| | | { |
| | | |
| | | DatePicker=L"RefundAmountDate"; |
| | | OnRetrieve(DatePicker); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | xstring GetQueryArg() |
| | | { |
| | | dw_arg.AcceptText(); |
| | | xml x; |
| | | |
| | | dw_arg.DwUpdateAllTo(x); |
| | | return x.xml(); |
| | | } |
| | | |
| | | int OnRetrieve(xstring DatePicker) |
| | | { |
| | | xml x; |
| | | xaserverarg arg ; |
| | | arg.AddArg(L"QueryTxt",xcontrol(GetControl(L"sle_search")).GetText()); |
| | | arg.AddArg(L"QueryArg",GetQueryArg()); |
| | | arg.AddArg(L"DatePicker",DatePicker); |
| | | trace(L"QueryTxt:===L"+ xcontrol(GetControl(L"sle_search")).GetText()+L"QueryArg:====L"+GetQueryArg()+L"DatePicker:====L"+DatePicker); |
| | | if (getUrl(L"/sale/data/AP/InvoiceSupplierIDList",arg.GetString(),x)!=1) |
| | | { |
| | | trace(x.text()); |
| | | return -1; |
| | | }else |
| | | { |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/AP/ManageSupplierID"); |
| | | |
| | | dw_arg = GetControl(L"dw_arg"); |
| | | dw_arg.openUrl(L"/sale/view/AR/template/queryarg"); |
| | | dw_arg.SetColHeaderHeight(0); |
| | | dw_arg.SetRowSelectorWidth(0); |
| | | dw_arg.SetHScrollState(false); |
| | | dw_arg.SetVScrollState(false); |
| | | dw_arg.SetItemString(1,L"DateType",L"æ¬æ"); |
| | | //OnRetrieve(); |
| | | OnAttachEvent(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | //SetAgent(); |
| | | |
| | | return 1; |
| | | } |
| | | }; |