¶Ô±ÈÐÂÎļþ |
| | |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/xcell.hpp> |
| | | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ProcessManagement : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | ProcessManagement(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static ProcessManagement* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ProcessManagement* pWin = new ProcessManagement(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 param) |
| | | { |
| | | //é置工å
·æ¡ |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | |
| | | if(comdid == L"xmDelete") |
| | | { |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret =MessageBox(GetHWND(),L"确认å 餿µç¨?",L"æç¤º",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | xstring TaskID = dw_list.GetItemString(row,L"TaskID"); |
| | | |
| | | |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/DelProcessManagement",L"TaskID",TaskID); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert(L"å 餿å"); |
| | | dw_list.DeleteRow(row); |
| | | }else |
| | | { |
| | | alert(L"å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | |
| | | } |
| | | else if (comdid == L"xmRefresh") |
| | | { |
| | | OnRetrieve(); |
| | | } |
| | | else if (comdid == L"AA") |
| | | { |
| | | AA(); |
| | | } |
| | | return 0; |
| | | } |
| | | int AA() |
| | | { |
| | | |
| | | //xstring FobUnitPriceEx=dw_cell.GetItemString(row,colFOBPrice); |
| | | xstring FobUnitPriceEx=L"$123.0"; |
| | | if(FobUnitPriceEx==L"$") FobUnitPriceEx=L"123"; |
| | | //alert(FobUnitPriceEx.find(L"$").toString()); |
| | | if(FobUnitPriceEx.find(L"$") >=0) FobUnitPriceEx=FobUnitPriceEx.right(FobUnitPriceEx.length() - 1); |
| | | trace(FobUnitPriceEx); |
| | | } |
| | | //触åé¼ æ 离å¼åtranäºä»¶ï¼éè¿æ¥æ¾æä¸ªåæ°å¾å°å¯¹åºçå |
| | | int OnBaseItemChanged(TEvent* evt, int p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring colname=hdr.colname; |
| | | xstring value = hdr.data; |
| | | |
| | | xstring dwname = L"dw_list"; |
| | | if(value != L"") |
| | | { |
| | | KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='"+dwname+L"']/trans[@for='"+colname+L"']"); |
| | | ViewObject::TransData(nlist, dw_list, hdr.row, colname, value); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ProcessManagement::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ProcessManagement::OnSetFocus); |
| | | AttachEvent(L"dw_list",L"DWV_ITEMCHANGED", (FEvent)&ProcessManagement::OnBaseItemChanged); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml x; |
| | | xaserverarg arg; |
| | | if (getUrl(L"/sale/data/business/ProcessManagement",arg.GetString(),x)!=1) |
| | | { |
| | | trace(x.text()); |
| | | return -1; |
| | | }else |
| | | { |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | dw_list.SetSelectionMode(1); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/Business3/template/ProcessManagement"); |
| | | dw_list.SetColumnState(L"TaskID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | | OnAttachEvent(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | }; |