| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | use "base.view.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/xcell.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class ProcessManagement : public xframe |
| | | |
| | | #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() |
| | | { |
| | | string xfNodeAgentArea = "agentarea"; |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if(m_agentNode) |
| | | { |
| | | SetAgentNodeContent (anode,m_agentNode); |
| | | SetAgentNode (anode,m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement xframeElement = GetElement(); |
| | | msxml::IXMLDOMElement agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*"); |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | if(agent) |
| | | { |
| | | string s = agent.xml; |
| | | m_agentNode = SetAgentNodeContent (anode,s); |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode (anode,s); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | |
| | | if(comdid == "xmDelete") |
| | | if(comdid == L"xmDelete") |
| | | { |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret = win32::MessageBox(GetHWND(),"确认删除流程?","提示",MB_OKCANCEL); |
| | | int ret =MessageBox(GetHWND(),L"确认删除流程?",L"提示",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | string TaskID = dw_list.GetItemString(row,"TaskID"); |
| | | xstring TaskID = dw_list.GetItemString(row,L"TaskID"); |
| | | |
| | | |
| | | xml x = ViewObject::RetrieveData("/sale/data/business/DelProcessManagement","TaskID",TaskID); |
| | | string status = x.GetXml(); |
| | | if(status.find("ok") == 1) |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/DelProcessManagement",L"TaskID",TaskID); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert("删除成功"); |
| | | alert(L"删除成功"); |
| | | dw_list.DeleteRow(row); |
| | | }else |
| | | { |
| | | alert("删除失败"); |
| | | alert(L"删除失败"); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | |
| | | } |
| | | else if (comdid == "xmRefresh") |
| | | else if (comdid == L"xmRefresh") |
| | | { |
| | | OnRetrieve(); |
| | | } |
| | | else if (comdid == "AA") |
| | | else if (comdid == L"AA") |
| | | { |
| | | AA(); |
| | | } |
| | |
| | | int AA() |
| | | { |
| | | |
| | | //string FobUnitPriceEx=dw_cell.GetItemString(row,colFOBPrice); |
| | | string FobUnitPriceEx="$123.0"; |
| | | if(FobUnitPriceEx=="$") FobUnitPriceEx="123"; |
| | | //alert(FobUnitPriceEx.find("$").toString()); |
| | | if(FobUnitPriceEx.find("$") >=0) FobUnitPriceEx=FobUnitPriceEx.right(FobUnitPriceEx.length() - 1); |
| | | //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(ref TNotifyEvent evt,int p) |
| | | int OnBaseItemChanged(TEvent* evt, int p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | string colname=hdr.colname; |
| | | string value = hdr.data; |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring colname=hdr.colname; |
| | | xstring value = hdr.data; |
| | | |
| | | string dwname = "dw_list"; |
| | | if(value != "") |
| | | xstring dwname = L"dw_list"; |
| | | if(value != L"") |
| | | { |
| | | msxml::IXMLDOMNodeList nlist = GetElement().selectNodes("//*[@name='"+dwname+"']/trans[@for='"+colname+"']"); |
| | | KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='"+dwname+L"']/trans[@for='"+colname+L"']"); |
| | | ViewObject::TransData(nlist, dw_list, hdr.row, colname, value); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | |
| | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ProcessManagement::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent("dw_list","DWV_ITEMCHANGED",OnBaseItemChanged); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ProcessManagement::OnSetFocus); |
| | | AttachEvent(L"dw_list",L"DWV_ITEMCHANGED", (FEvent)&ProcessManagement::OnBaseItemChanged); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | |
| | | if (getUrl("/sale/data/business/ProcessManagement",arg.GetString(),x)!=1) |
| | | xml x; |
| | | xaserverarg arg; |
| | | if (getUrl(L"/sale/data/business/ProcessManagement",arg.GetString(),x)!=1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | trace(x.text()); |
| | | return -1; |
| | | }else |
| | | { |
| | |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl("dw_list"); |
| | | dw_list.openUrl("/sale/view/Business3/template/ProcessManagement"); |
| | | dw_list.SetColumnState("TaskID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/Business3/template/ProcessManagement"); |
| | | dw_list.SetColumnState(L"TaskID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |