| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\AccountUnitMaint.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\AddUomGroup.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\basicfareTypeList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\brand.regtype.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\ColorCardNew.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\CustomerMarketList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\ExchangeRate.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\ExpressList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\FreightExpenseType.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\PaymentTerm.list.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\ProfitParam.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\QuickCode.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\SetUpRemarks.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\ShipcompanyList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\SourceRemark.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\SpecialDeductFeeList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\TestingCompanyList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\BasicCode\TypeList.maint.supplier.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\Company\CompanyList.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class AccountUnitMaintWin : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) AccountUnitMaintWin : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | AccountUnitMaintWin(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static AccountUnitMaintWin* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | AccountUnitMaintWin* pWin = new AccountUnitMaintWin(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=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | dw_list.InsertRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmRefresh") |
| | | else if(comdid==L"xmRefresh") |
| | | return OnRetrieve(); |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&AccountUnitMaintWin::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&AccountUnitMaintWin::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | if (url::get("/sale/data/TradeFinance3/accountunit/update",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"content",x.xml()); |
| | | if (xurl::get(L"/sale/data/TradeFinance3/accountunit/update",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | trace(x.xml()); |
| | | if(x.selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | win32::MessageBox(GetHWND(),"保存成功!","提示",0); |
| | | MessageBox(GetHWND(),L"保存成功!",L"提示",0); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | if (url::get("/sale/data/TradeFinance3/accountunit/list",arg.GetString(),x)!=1) |
| | | |
| | | xaserverarg arg; |
| | | |
| | | if (xurl::get(L"/sale/data/TradeFinance3/accountunit/list",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/FinancialCode/template/AccountUnit"); |
| | | dw_list.SetColumnState("TAUID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/FinancialCode/template/AccountUnit"); |
| | | dw_list.SetColumnState(L"TAUID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | field: |
| | | [ |
| | | xdwpages__ dw_pages; |
| | | string m_QueryTxt; |
| | | xstring m_QueryTxt; |
| | | msxml::IXMLDOMDocument m_configDoc; |
| | | static int dw_hWnd; |
| | | ] |
| | |
| | | method: |
| | | [ |
| | | |
| | | int alert(string str) |
| | | int alert(xstring str) |
| | | { |
| | | //win__::MessageBox(this.GetHWND(),str,"提示22:",0); |
| | | //win__::MessageBox(this.GetHWND(),str,L"提示22:",0); |
| | | TApp::alert(this,str); |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | string GetGuid(){ |
| | | xstring GetGuid(){ |
| | | return TApp::GetGuid(); |
| | | } |
| | | int OnAddrow() |
| | |
| | | this.dw_list.InsertRow(0); |
| | | int rows = this.dw_list.GetRowCount(); |
| | | this.dw_list.SetRow(rows); |
| | | this.dw_list.SetItemString(rows,"PartyID",GetGuid()); |
| | | this.dw_list.SetItemString(rows,"ContactID",GetGuid()); |
| | | this.dw_list.SetItemString(rows,"PAStatus","1"); |
| | | this.dw_list.SetItemString(rows,"PStatus","1"); |
| | | this.dw_list.SetItemString(rows,"PCStatus","1"); |
| | | this.dw_list.SetItemString(rows,"Type","7"); |
| | | this.dw_list.SetItemString(rows,L"PartyID",GetGuid()); |
| | | this.dw_list.SetItemString(rows,L"ContactID",GetGuid()); |
| | | this.dw_list.SetItemString(rows,L"PAStatus",L"1"); |
| | | this.dw_list.SetItemString(rows,L"PStatus",L"1"); |
| | | this.dw_list.SetItemString(rows,L"PCStatus",L"1"); |
| | | this.dw_list.SetItemString(rows,L"Type",L"7"); |
| | | } |
| | | int OnInsertRow() |
| | | { |
| | | int row = this.dw_list.GetRow(); |
| | | if(row<1 || row>this.dw_list.GetRowCount()) return 0; |
| | | this.dw_list.InsertRow(row); |
| | | this.dw_list.SetItemString(row,"PartyID",GetGuid()); |
| | | this.dw_list.SetItemString(row,"ContactID",GetGuid()); |
| | | this.dw_list.SetItemString(row,"PAStatus","1"); |
| | | this.dw_list.SetItemString(row,"PStatus","1"); |
| | | this.dw_list.SetItemString(row,"PCStatus","1"); |
| | | this.dw_list.SetItemString(row,"Type","7"); |
| | | this.dw_list.SetItemString(row,L"PartyID",GetGuid()); |
| | | this.dw_list.SetItemString(row,L"ContactID",GetGuid()); |
| | | this.dw_list.SetItemString(row,L"PAStatus",L"1"); |
| | | this.dw_list.SetItemString(row,L"PStatus",L"1"); |
| | | this.dw_list.SetItemString(row,L"PCStatus",L"1"); |
| | | this.dw_list.SetItemString(row,L"Type",L"7"); |
| | | } |
| | | |
| | | int ViewUpdate(param pr,string updateItem,xaserverarg__ arg) |
| | | int ViewUpdate(param pr,xstring updateItem,xaserverarg__ arg) |
| | | { |
| | | if( updateItem=="del") |
| | | if( updateItem==L"del") |
| | | { |
| | | int DelRow = this.dw_list.GetRow(); |
| | | this.dw_list.DeleteRow(DelRow); |
| | |
| | | |
| | | int OnSave() |
| | | { |
| | | /*string no = this.dw_list.GetItemString(1,"CarTermNo"); |
| | | if(no==""){ |
| | | alert("请输入车队编码!"); |
| | | /*xstring no = this.dw_list.GetItemString(1,L"CarTermNo"); |
| | | if(no==L""){ |
| | | alert(L"请输入车队编码!"); |
| | | return -1; |
| | | } |
| | | string SName = this.dw_list.GetItemString(1,"Name"); |
| | | if(SName==""){ |
| | | alert("请输入车队名称!"); |
| | | xstring SName = this.dw_list.GetItemString(1,L"Name"); |
| | | if(SName==L""){ |
| | | alert(L"请输入车队名称!"); |
| | | return -1; |
| | | } |
| | | string ContacterName = this.dw_list.GetItemString(1,"ContacterName"); |
| | | if(ContacterName==""){ |
| | | alert("请输入联系人名称!"); |
| | | xstring ContacterName = this.dw_list.GetItemString(1,L"ContacterName"); |
| | | if(ContacterName==L""){ |
| | | alert(L"请输入联系人名称!"); |
| | | return -1; |
| | | } */ |
| | | xml__ x=new xml__; |
| | |
| | | trace(x.GetXml()); |
| | | xaserverarg__ arg=new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | arg.AddArg("dbmap","CarTerm.dbmap"); |
| | | if (getUrl("/sale/data/CarTerm/entity/carterm/save",arg.GetString(),x) != 1) |
| | | arg.AddArg(L"content",x.GetXml()); |
| | | arg.AddArg(L"dbmap",L"CarTerm.dbmap"); |
| | | if (getUrl(L"/sale/data/CarTerm/entity/carterm/save",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+x.GetXml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | if(x.GetXmlDoc().selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | alert("保存成功!"); |
| | | alert(L"保存成功!"); |
| | | this.dw_list.ResetUpdateStatus(); |
| | | } |
| | | this.dw_list.Redraw(); |
| | | return 0; |
| | | } |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid.find("action:bill.row.add",0)>=0) { |
| | | if(comdid.find(L"action:bill.row.add",0)>=0) { |
| | | OnAddrow(); |
| | | } |
| | | else if(comdid.find("bill.row.insert",0)>=0) { |
| | | else if(comdid.find(L"bill.row.insert",0)>=0) { |
| | | OnInsertRow(); |
| | | } |
| | | else if(comdid.find("bill.row.delete",0)>=0) { |
| | | else if(comdid.find(L"bill.row.delete",0)>=0) { |
| | | OnDeleteRow(); |
| | | } |
| | | else if(comdid.find("bill.save",0)>=0) { |
| | | else if(comdid.find(L"bill.save",0)>=0) { |
| | | trace(1); |
| | | OnSave(); |
| | | } |
| | |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND",OnXCommand); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | /*use "list.vd" |
| | | use "xtreeview.vd" |
| | | use "publiccode.vd"*/ |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | unit trade |
| | | [ |
| | | class ColorCardNew : public listwin |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ColorCardNew : public listwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xdwgrid dw_detail; |
| | | bool ismodify; |
| | | xnode m_agentNode; |
| | | string m_agentCond; |
| | | |
| | | xstring m_agentCond; |
| | | public: |
| | | ColorCardNew(void* implPtr, HWND hWnd) :listwin(implPtr, hWnd) {} |
| | | public: |
| | | static ColorCardNew* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ColorCardNew* pWin = new ColorCardNew(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int SetAgent() |
| | | { |
| | | string xfNodeAgentArea = "agentarea"; |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | msxml::IXMLDOMElement xframeElement = GetElement(); |
| | | msxml::IXMLDOMNode agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*"); |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMNode agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*"); |
| | | if(agent) |
| | | SetAgentNodeContent(anode, agent.xml); |
| | | SetAgentNode(anode, agent.xml()); |
| | | return 1; |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | SetAgent(); |
| | | |
| | | //重置工具条 |
| | | return 1; |
| | | } |
| | | int ProcessFlowAction(string guid,string comdid) |
| | | int ProcessFlowAction(xstring guid,xstring comdid) |
| | | { |
| | | //int pr = pr1; |
| | | //string action = comdid;//.mid(comdid.find("action:",0)+7,9999); |
| | | /*if(action == "bill.delete" || action == "bill.deleteEx") |
| | | //xstring action = comdid;//.mid(comdid.find(L"action:",0)+7,9999); |
| | | /*if(action == L"bill.delete" || action == L"bill.deleteEx") |
| | | { |
| | | if (MessageBox(GetHWND(),"是否确定删除记录!","提示1",1) == 2) |
| | | if (MessageBox(GetHWND(),L"是否确定删除记录!",L"提示1",1) == 2) |
| | | return 1; |
| | | }*/ |
| | | |
| | | xaserverarg arg0 = new xaserverarg ; |
| | | xaserverarg arg0 ; |
| | | arg0.setNativePointer(arg0.CreateInstance()); |
| | | //arg0.AddArg("Action", action,"xs:string"); |
| | | arg0.AddArg("EntityName", "ColorCard","xs:string"); |
| | | arg0.AddArg("EntityIDName", "ColorCardID","xs:string"); |
| | | arg0.AddArg("EntityID", guid,"xs:string"); |
| | | arg0.AddArg("FunctionCode", comdid,"xs:string"); |
| | | //arg0.AddArg(L"Action", action,L"xs:xstring"); |
| | | arg0.AddArg(L"EntityName", L"ColorCard",L"xs:xstring"); |
| | | arg0.AddArg(L"EntityIDName", L"ColorCardID",L"xs:xstring"); |
| | | arg0.AddArg(L"EntityID", guid,L"xs:xstring"); |
| | | arg0.AddArg(L"FunctionCode", comdid,L"xs:xstring"); |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | |
| | | |
| | | if(url::get("/sale/data/Role.config/sys/sql/action", arg0.GetString(), x) != 1) |
| | | if(xurl::get(L"/sale/data/Role.config/sys/sql/action", arg0.GetString(), x) != 1) |
| | | { |
| | | //ismodify=false; |
| | | //dw_list.SetReadOnly(ismodify); |
| | | return -1; |
| | | } |
| | | string kk=x.GetXml(); |
| | | if(kk.find("<root/>",0)>=0) |
| | | xstring kk=x.xml(); |
| | | if(kk.find(L"<root/>",0)>=0) |
| | | { |
| | | //ismodify=true; |
| | | //dw_list.SetReadOnly(ismodify); |
| | |
| | | return -1; |
| | | } |
| | | |
| | | int ModifyProcessAction(string guid,string comdid) |
| | | int ModifyProcessAction(xstring guid,xstring comdid) |
| | | { |
| | | if(ProcessFlowAction(guid,comdid)>0) |
| | | { |
| | |
| | | return -1; |
| | | } |
| | | } |
| | | int DeleteProcessAction(string guid,string comdid) |
| | | int DeleteProcessAction(xstring guid,xstring comdid) |
| | | { |
| | | if(ProcessFlowAction(guid,comdid)>0) |
| | | { |
| | |
| | | } |
| | | |
| | | //根据ColorCardID加载Detail数据 |
| | | int OnRetrieveDetail(string ColorCardID) |
| | | int OnRetrieveDetail(xstring ColorCardID) |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | xml x; |
| | | |
| | | xaserverarg arg; |
| | | |
| | | |
| | | arg.AddArg("ColorCardID",ColorCardID); |
| | | if (url::get("ColorCard/entity/list1",arg.GetString(),x) != 1) |
| | | arg.AddArg(L"ColorCardID",ColorCardID); |
| | | if (xurl::get(L"ColorCard/entity/list1",arg.GetString(),x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | trace(x.text()); |
| | | return -1; |
| | | } |
| | | dw_detail.Retrieve(x); |
| | |
| | | { |
| | | if (dw_list) |
| | | { |
| | | string colorCardCName; |
| | | string colorCardName; |
| | | string orgID; |
| | | xstring colorCardCName; |
| | | xstring colorCardName; |
| | | xstring orgID; |
| | | int i; |
| | | int row = dw_list.GetRowCount(); |
| | | for (i=1; i<=row;i++) |
| | | { |
| | | colorCardCName=dw_list.GetItemString(i,"ColorCardCName",0)+""; |
| | | colorCardName=dw_list.GetItemString(i,"ColorCardName",0)+""; |
| | | orgID=dw_list.GetItemString(i,"OrgID",0)+""; |
| | | if (colorCardCName=="" || !colorCardCName) |
| | | colorCardCName=dw_list.GetItemString(i,L"ColorCardCName")+L""; |
| | | colorCardName=dw_list.GetItemString(i,L"ColorCardName")+L""; |
| | | orgID=dw_list.GetItemString(i,L"OrgID")+L""; |
| | | if (colorCardCName==L"" || !colorCardCName) |
| | | { |
| | | alert("第"+i.toString()+"行色卡名称中文为空"); |
| | | alert(L"第"+xstring(i)+L"行色卡名称中文为空"); |
| | | return -1; |
| | | } |
| | | if (colorCardName=="" || !colorCardName) |
| | | if (colorCardName==L"" || !colorCardName) |
| | | { |
| | | alert("第"+i.toString()+"行色卡名称为空"); |
| | | alert(L"第"+ xstring(i) +L"行色卡名称为空"); |
| | | return -1; |
| | | } |
| | | if (orgID=="" || !orgID) |
| | | if (orgID==L"" || !orgID) |
| | | { |
| | | alert("第"+i.toString()+"行关联组织为空"); |
| | | alert(L"第"+ xstring(i) +L"行关联组织为空"); |
| | | return -1; |
| | | } |
| | | } |
| | |
| | | if (rec == -1) |
| | | return -1; |
| | | xml x= new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | msxml::IXMLDOMElement e= x.GetXmlDoc().selectSingleNode("root"); |
| | | arg.AddArg("content",e.xml); |
| | | arg.AddArg("dbmap","ColorCard.dbmap"); |
| | | if (url::get("ColorCard/pref/colorcard.save",arg.GetString(),x) != 1) |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | KXMLDOMElement e= x.selectSingleNode(L"root"); |
| | | arg.AddArg(L"content",e.xml()); |
| | | arg.AddArg(L"dbmap",L"ColorCard.dbmap"); |
| | | if (xurl::get(L"ColorCard/pref/colorcard.save",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | alert("保存成功!"); |
| | | alert(L"保存成功!"); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | dw_list.AcceptText(); |
| | | int nrow=dw_list.InsertRow(0); |
| | | dw_list.ShowRowTo(nrow); |
| | | string tempguid = publiccode::GetGuid(); |
| | | dw_list.SetItemString(nrow,"ColorCardID",tempguid); |
| | | xstring tempguid = publiccode::GetGuid(); |
| | | dw_list.SetItemString(nrow,L"ColorCardID",tempguid); |
| | | OnRetrieveDetail(tempguid); |
| | | return 1; |
| | | } |
| | | |
| | | //插入 |
| | |
| | | int row = dw_list.GetRow(); |
| | | if(row<1) return 0; |
| | | int nrow=dw_list.InsertRow(row); |
| | | string tempguid = publiccode::GetGuid(); |
| | | dw_list.SetItemString(nrow,"ColorCardID",tempguid); |
| | | xstring tempguid = publiccode::GetGuid(); |
| | | dw_list.SetItemString(nrow,L"ColorCardID",tempguid); |
| | | OnRetrieveDetail(tempguid); |
| | | } |
| | | |
| | |
| | | dw_list.AcceptText(); |
| | | int row = dw_list.GetRow(); |
| | | if(row<1) return 0; |
| | | string id=dw_list.GetItemString(row,"ColorCardID"); |
| | | if(DeleteProcessAction(id,"DeleteColorCard")<0) |
| | | xstring id=dw_list.GetItemString(row,L"ColorCardID"); |
| | | if(DeleteProcessAction(id,L"DeleteColorCard")<0) |
| | | { |
| | | alert("您没有权限删除该数据"); |
| | | alert(L"您没有权限删除该数据"); |
| | | return -1; |
| | | } |
| | | if(id !="") |
| | | if(id !=L"") |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | xml x; |
| | | |
| | | xaserverarg arg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("ColorCardID", id); |
| | | if(url::get("ColorCard/pref/beforedelete",arg.GetString(),x)!=1) |
| | | arg.AddArg(L"ColorCardID", id); |
| | | if(xurl::get(L"ColorCard/pref/beforedelete",arg.GetString(),x)!=1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("删除出错!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"删除出错!"); |
| | | return 0; |
| | | } |
| | | msxml::IXMLDOMElement e= x.GetXmlDoc().documentElement; |
| | | if(e.selectSingleNode("error")) |
| | | KXMLDOMElement e= x.documentElement(); |
| | | if(e.selectSingleNode(L"error")) |
| | | { |
| | | alert(e.selectSingleNode("error").text); |
| | | alert(e.selectSingleNode(L"error").text()); |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | { |
| | | dw_detail.AcceptText(); |
| | | int nrow=dw_detail.InsertRow(0); |
| | | string tempguid = publiccode::GetGuid(); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),"ColorCardID",dw_list.GetItemString(dw_list.GetRow(),"ColorCardID")); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),"ColorID",tempguid); |
| | | xstring tempguid = publiccode::GetGuid(); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),L"ColorCardID",dw_list.GetItemString(dw_list.GetRow(),L"ColorCardID")); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),L"ColorID",tempguid); |
| | | //OnRetrieveDetail(tempguid); |
| | | dw_detail.ShowRowTo(nrow); |
| | | |
| | |
| | | int row = dw_detail.GetRow(); |
| | | if(row<1) return 0; |
| | | int nrow=dw_detail.InsertRow(row); |
| | | string tempguid = publiccode::GetGuid(); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),"ColorCardID",dw_list.GetItemString(dw_list.GetRow(),"ColorCardID")); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),"ColorID",tempguid); |
| | | xstring tempguid = publiccode::GetGuid(); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),L"ColorCardID",dw_list.GetItemString(dw_list.GetRow(),L"ColorCardID")); |
| | | dw_detail.SetItemString(dw_detail.GetRow(),L"ColorID",tempguid); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | int rowz = dw_list.GetRow(); |
| | | if(row<1)return 0; |
| | | dw_detail.DeleteRow(row); |
| | | msxml::IXMLDOMElement ez= this.dw_list.GetRowElement(rowz); |
| | | xml xz=new xml; |
| | | xz.setNativePointer(xml::CreateInstance()); |
| | | dw_detail.DwUpdateAllToEx(xz.GetXmlDoc()); |
| | | if (ez.selectSingleNode("root")) |
| | | ez.removeChild(ez.selectSingleNode("root")); |
| | | ez.appendChild(xz.GetXmlDoc().documentElement); |
| | | KXMLDOMElement ez= dw_list.GetRowElement(rowz); |
| | | xml xz; |
| | | dw_detail.DwUpdateAllToEx(xz); |
| | | if (ez.selectSingleNode(L"root")) |
| | | ez.removeChild(ez.selectSingleNode(L"root")); |
| | | ez.appendChild(xz.documentElement()); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid=="save") OnSave(); |
| | | else if(comdid=="add") OnAdd(); |
| | | else if(comdid=="insert") OnInsert(); |
| | | else if(comdid=="del") OnDelete(); |
| | | else if(comdid=="addrowDetail") OnAddRowDetail(); |
| | | else if(comdid=="insertrowDetail") OnInsertRowDetail(); |
| | | else if(comdid=="deleterowDetail") OnDelRowDetail(); |
| | | if(comdid==L"save") OnSave(); |
| | | else if(comdid==L"add") OnAdd(); |
| | | else if(comdid==L"insert") OnInsert(); |
| | | else if(comdid==L"del") OnDelete(); |
| | | else if(comdid==L"addrowDetail") OnAddRowDetail(); |
| | | else if(comdid==L"insertrowDetail") OnInsertRowDetail(); |
| | | else if(comdid==L"deleterowDetail") OnDelRowDetail(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | //行改变事件 |
| | | int OnListRowChanged(ref TNotifyEvent evt,int p) |
| | | int OnListRowChanged(TEvent* evt, int p) |
| | | { |
| | | dw_detail.AcceptText(); |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | dw_detail.AcceptText(); |
| | | |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | dw_list.Redraw(); |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string ColorCardID = e.selectSingleNode("ColorCardID").text; |
| | | KXMLDOMElement e = dw_list.GetRowElement(row); |
| | | xstring ColorCardID = e.selectSingleNode(L"ColorCardID").text(); |
| | | OnRetrieveDetail(ColorCardID); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnDetailChanged(ref TNotifyEvent evt,int p) |
| | | int OnDetailChanged(TEvent* evt, int p) |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | msxml::IXMLDOMElement e= this.dw_list.GetRowElement(row); |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_detail.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | if (e.selectSingleNode("root")) |
| | | e.removeChild(e.selectSingleNode("root")); |
| | | e.appendChild(x.GetXmlDoc().documentElement); |
| | | KXMLDOMElement e= dw_list.GetRowElement(row); |
| | | xml x; |
| | | |
| | | dw_detail.DwUpdateAllToEx(x); |
| | | if (e.selectSingleNode(L"root")) |
| | | e.removeChild(e.selectSingleNode(L"root")); |
| | | e.appendChild(x.documentElement()); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int OnDwListClick(ref TNotifyEvent evt,int p) |
| | | int OnDwListClick(TEvent* evt, int p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | dw_list.Redraw(); |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string ColorCardID = e.selectSingleNode("ColorCardID").text; |
| | | ModifyProcessAction(ColorCardID,"ModifyColorCard"); |
| | | KXMLDOMElement e = dw_list.GetRowElement(row); |
| | | xstring ColorCardID = e.selectSingleNode(L"ColorCardID").text(); |
| | | ModifyProcessAction(ColorCardID,L"ModifyColorCard"); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ColorCardNew::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ColorCardNew::OnSetFocus); |
| | | //行改变事件 |
| | | AttachEvent("dw_list","DWV_ROWFOCUSCHANGED",OnListRowChanged); |
| | | AttachEvent("dw_detail","DWV_ITEMCHANGED",OnDetailChanged); |
| | | //AttachEvent("dw_list","DWV_ITEMCHANGED",OnDetailChanged); |
| | | AttachEvent("dw_list","DWV_CLICKED",OnDwListClick); |
| | | AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED", (FEvent)&ColorCardNew::OnListRowChanged); |
| | | AttachEvent(L"dw_detail",L"DWV_ITEMCHANGED", (FEvent)&ColorCardNew::OnDetailChanged); |
| | | //AttachEvent(L"dw_list",L"DWV_ITEMCHANGED",OnDetailChanged); |
| | | AttachEvent(L"dw_list",L"DWV_CLICKED", (FEvent)&ColorCardNew::OnDwListClick); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve(string str) |
| | | int OnRetrieve(xstring str) |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("id",str); |
| | | if (url::get("ColorCard/entity/list",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"id",str); |
| | | if (xurl::get(L"ColorCard/entity/list",arg.GetString(),x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | trace(x.text()); |
| | | return -1; |
| | | } |
| | | //doc=x; |
| | |
| | | int onload() |
| | | { |
| | | |
| | | dw_list = GetControl("dw_list"); |
| | | dw_list.openUrl("产品设置.vface/template/ColorCard/list"); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"产品设置.vface/template/ColorCard/list"); |
| | | |
| | | dw_detail = GetControl("dw_detail"); |
| | | dw_detail.openUrl("产品设置.vface/template/ColorCard/listex"); |
| | | dw_detail = GetControl(L"dw_detail"); |
| | | dw_detail.openUrl(L"产品设置.vface/template/ColorCard/listex"); |
| | | OnInitial(); |
| | | |
| | | OnRetrieve("FND_ColorCard"); |
| | | OnRetrieve(L"FND_ColorCard"); |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | 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 <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class ExchangeRateWin : public xframe |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ExchangeRateWin : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | int hSignWin; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | ExchangeRateWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static ExchangeRateWin* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ExchangeRateWin* pWin = new ExchangeRateWin(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 OnSave() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.AcceptText(); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xml x0 = ViewObject::MakeXml(); |
| | | x0.LoadXml("<data/>"); |
| | | |
| | | msxml::IXMLDOMNodeList t = x.GetXmlDoc().selectNodes("data/Item[@update.modify='1' or @update.delete ='1']"); |
| | | msxml::IXMLDOMElement e1= x0.GetXmlDoc().documentElement; |
| | | int len = t.length; |
| | | dw_list.AcceptText(); |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xml x0; |
| | | x0.loadXML(L"<data/>"); |
| | | |
| | | KXMLDOMNodeList t = x.selectNodes(L"data/Item[@update.modify='1' or @update.delete ='1']"); |
| | | KXMLDOMElement e1= x0.documentElement(); |
| | | int len = t.length(); |
| | | for(int i=0;i<len;i++) |
| | | { |
| | | e1.appendChild(t.item(i)); |
| | | } |
| | | xaserverarg arg = ViewObject::MakeArg(); |
| | | arg.AddArg("content",x0.GetXml()); |
| | | trace(x0.GetXml()); |
| | | if(url::get("/sale/data/expense3/update/ExchangeRate", arg.GetString(),x)!=1) |
| | | xaserverarg arg ; |
| | | arg.AddArg(L"content",x0.xml()); |
| | | trace(x0.xml()); |
| | | if(xurl::get(L"/sale/data/expense3/update/ExchangeRate", arg.GetString(),x)!=1) |
| | | { |
| | | string error = x.GetXmlDoc().text; |
| | | alert("err:"+error); |
| | | xstring error = x.text(); |
| | | alert(L"err:"+error); |
| | | return 1; |
| | | } |
| | | string str = x.GetXmlDoc().documentElement.getAttribute("text"); |
| | | if(str == "true") |
| | | xstring str = x.documentElement().getAttribute(L"text"); |
| | | if(str == L"true") |
| | | { |
| | | dw_list.ResetUpdateStatus(); |
| | | alert("保存成功!"); |
| | | alert(L"保存成功!"); |
| | | }else |
| | | { |
| | | alert("保存失败!"); |
| | | alert(L"保存失败!"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | string sdate = publiccode::GetCurrentDate(); |
| | | string suserid = publiccode::GetUser().id; |
| | | string susername = publiccode::GetUser().name; |
| | | xstring sdate = publiccode::GetCurrentDate(); |
| | | xstring suserid = publiccode::GetUser().id; |
| | | xstring susername = publiccode::GetUser().name; |
| | | int row =dw_list.GetRowCount(); |
| | | dw_list.InsertRow(0); |
| | | dw_list.SetItemString(row+1,"CreatorID",suserid); |
| | | dw_list.SetItemDisplayString(row+1,"CreatorID",susername); |
| | | dw_list.SetItemString(row+1,"CreateDate",sdate); |
| | | dw_list.SetItemString(row+1,L"CreatorID",suserid); |
| | | dw_list.SetItemDisplayString(row+1,L"CreatorID",susername); |
| | | dw_list.SetItemString(row+1,L"CreateDate",sdate); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if (comdid == "xmSave") |
| | | else if (comdid == L"xmSave") |
| | | { |
| | | OnSave(); |
| | | } |
| | | else if (comdid == "xmRefresh") |
| | | else if (comdid == L"xmRefresh") |
| | | { |
| | | OnRetrieve(); |
| | | } |
| | | else if(comdid =="ToUpdate") |
| | | else if(comdid ==L"ToUpdate") |
| | | { |
| | | ToUpdate(); |
| | | } |
| | |
| | | |
| | | int ToUpdate() |
| | | { |
| | | string Months = dw_list.GetItemString(dw_list.GetRow(),"Months"); |
| | | xstring Months = dw_list.GetItemString(dw_list.GetRow(),L"Months"); |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret = win32::MessageBox(GetHWND(),"确认更新"+Months+"盈亏汇率?","提示",MB_OKCANCEL); |
| | | int ret = MessageBox(GetHWND(),L"确认更新"+Months+L"盈亏汇率?",L"提示",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | xml x = ViewObject::RetrieveData("/sale/data/Expense3/ExchangeRateUpdateEx","Months",Months); |
| | | string status = x.GetXml(); |
| | | if(status.find("ok") == 1) |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/Expense3/ExchangeRateUpdateEx",L"Months",Months); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert("更新成功"); |
| | | alert(L"更新成功"); |
| | | }else |
| | | { |
| | | alert("更新失败"); |
| | | alert(L"更新失败"); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //触发鼠标离开后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) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | } |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ExchangeRateWin::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent("dw_list","DWV_ITEMCHANGED",OnBaseItemChanged); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ExchangeRateWin::OnSetFocus); |
| | | AttachEvent(L"dw_list",L"DWV_ITEMCHANGED", (FEvent)&ExchangeRateWin::OnBaseItemChanged); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("QueryTxt",GetControl("search").GetText()); |
| | | |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"QueryTxt",xcontrol(GetControl(L"search")).GetText()); |
| | | |
| | | |
| | | if (getUrl("/sale/data/Expense3/ExchangeRateList",arg.GetString(),x)!=1) |
| | | if (getUrl(L"/sale/data/Expense3/ExchangeRateList",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/Expense3/ExchangeRate"); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/Expense3/ExchangeRate"); |
| | | |
| | | |
| | | OnRetrieve(); |
| | |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class FreightExpenseTypeWin : public xframe |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) FreightExpenseTypeWin : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | int seqno; |
| | | |
| | | public: |
| | | FreightExpenseTypeWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static FreightExpenseTypeWin* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | FreightExpenseTypeWin* pWin = new FreightExpenseTypeWin(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; |
| | |
| | | seqno = -1; |
| | | for(int i=1; i<dw_list.GetRowCount();i++) |
| | | { |
| | | string val = dw_list.GetItemString(i,"FieldName"); |
| | | if(val.find("OtherFee")==0) continue; |
| | | if(val.find("Other")==0) |
| | | xstring val = dw_list.GetItemString(i,L"FieldName"); |
| | | if(val.find(L"OtherFee")==0) continue; |
| | | if(val.find(L"Other")==0) |
| | | { |
| | | string no = val.mid(5,99999); |
| | | xstring no = val.mid(5,99999); |
| | | if(no.toInt()>seqno) seqno = no.toInt(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt,int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | |
| | | { |
| | | dw_list.AcceptText(); |
| | | xml x= new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | |
| | | xaserverarg arg = new xaserverarg; |
| | | dw_list.DwUpdateAllToEx(x); |
| | | |
| | | xaserverarg arg; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | arg.AddArg(L"content",x.xml()); |
| | | |
| | | //trace(x.GetXml()); |
| | | //trace(x.xml()); |
| | | |
| | | if(url::get("/sale/data/LogisticsCode/entity/freightexpensetype/update", arg.GetString(),x)!=1) |
| | | if(xurl::get(L"/sale/data/LogisticsCode/entity/freightexpensetype/update", arg.GetString(),x)!=1) |
| | | { |
| | | string error = x.GetXmlDoc().text; |
| | | alert("err:"+error); |
| | | xstring error = x.text(); |
| | | alert(L"err:"+error); |
| | | return 1; |
| | | } |
| | | //alert(x.GetXml()); |
| | | string str = x.GetXmlDoc().documentElement.getAttribute("text"); |
| | | trace(x.GetXml()); |
| | | if(str == "true") |
| | | //alert(x.xml()); |
| | | xstring str = x.documentElement().getAttribute(L"text"); |
| | | trace(x.xml()); |
| | | if(str == L"true") |
| | | { |
| | | dw_list.ResetUpdateStatus(); |
| | | alert("保存成功!"); |
| | | alert(L"保存成功!"); |
| | | }else |
| | | { |
| | | alert("保存失败!"); |
| | | alert(L"保存失败!"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | dw_list.InsertRow(0); |
| | | if(seqno==-1) CalcSeqNo(); |
| | | seqno++; |
| | | dw_list.SetItemString(dw_list.GetRowCount(),"FieldName", "Other"+seqno.toString()); |
| | | dw_list.SetItemString(dw_list.GetRowCount(),L"FieldName", L"Other"+xstring(seqno)); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | { |
| | | return OnSave(); |
| | | } |
| | |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&FreightExpenseTypeWin::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&FreightExpenseTypeWin::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | if (getUrl("/sale/data/LogisticsCode/entity/freightexpensetype/list","",x)!=1) |
| | | |
| | | if (getUrl(L"/sale/data/LogisticsCode/entity/freightexpensetype/list",L"",x)!=1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | trace(x.text()); |
| | | return -1; |
| | | }else |
| | | { |
| | |
| | | |
| | | int onload() |
| | | { |
| | | dw_list = GetControl("dw_list"); |
| | | dw_list.openUrl("/sale/view/LogisticsCode/template/freightexpensetype/list"); |
| | | dw_list.SetColumnState("ID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/LogisticsCode/template/freightexpensetype/list"); |
| | | dw_list.SetColumnState(L"ID",false); |
| | | OnAttachEvent(); |
| | | seqno = -1; |
| | | |
| | |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | 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 <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class ProfitParamList : public frame |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ProfitParamList : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | ProfitParamList(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static ProfitParamList* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ProfitParamList* pWin = new ProfitParamList(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 OnSave() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | |
| | | dw_list.AcceptText(); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg = new xaserverarg; |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | if(url::get("/sale/data/Gdn/update/ProParamUpdate", arg.GetString(),x)!=1) |
| | | arg.AddArg(L"content",x.xml()); |
| | | if(xurl::get(L"/sale/data/Gdn/update/ProParamUpdate", arg.GetString(),x)!=1) |
| | | { |
| | | string error = x.GetXmlDoc().text; |
| | | alert("err:"+error); |
| | | xstring error = x.text(); |
| | | alert(L"err:"+error); |
| | | return 1; |
| | | } |
| | | string str = x.GetXmlDoc().documentElement.getAttribute("text"); |
| | | if(str == "true") |
| | | xstring str = x.documentElement().getAttribute(L"text"); |
| | | if(str == L"true") |
| | | { |
| | | dw_list.ResetUpdateStatus(); |
| | | dw_list.Redraw(); |
| | | alert("保存成功!"); |
| | | alert(L"保存成功!"); |
| | | }else |
| | | { |
| | | alert("保存失败!"); |
| | | alert(L"保存失败!"); |
| | | } |
| | | } |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid == "xmsave") |
| | | if(comdid == L"xmsave") |
| | | { |
| | | OnSave(); |
| | | } |
| | | else if(comdid == "xmrefresh") |
| | | else if(comdid == L"xmrefresh") |
| | | { |
| | | OnRetrieve(); |
| | | } |
| | |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&ProfitParamList::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ProfitParamList::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x = ViewObject::RetrieveData("/sale/data/Gdn/profit/profitParamList"); |
| | | x = ViewObject::RetrieveData(L"/sale/data/Gdn/profit/profitParamList"); |
| | | if(x) |
| | | { |
| | | //alert(x.GetXml()); |
| | | //alert(x.xml()); |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | } |
| | |
| | | int onload() |
| | | { |
| | | OnAttachEvent(); |
| | | dw_list = GetControl("dw_list"); |
| | | dw_list.openUrl("/sale/view/VATNotify/template/profitparam/list"); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/VATNotify/template/profitparam/list"); |
| | | |
| | | OnRetrieve(); |
| | | return 1; |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class SetUpRemarks : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) SetUpRemarks : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | SetUpRemarks(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static SetUpRemarks* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | SetUpRemarks* pWin = new SetUpRemarks(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=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | int row =dw_list.GetRowCount(); |
| | | dw_list.InsertRow(0); |
| | | dw_list.SetItemString(row+1,"State","Y"); |
| | | dw_list.SetItemString(row+1,L"State",L"Y"); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmRefresh") |
| | | else if(comdid==L"xmRefresh") |
| | | return OnRetrieve(); |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&SetUpRemarks::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&SetUpRemarks::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | if (url::get("/sale/data/TradeFinance3/SetUpRemarks/update",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"content",x.xml()); |
| | | if (xurl::get(L"/sale/data/TradeFinance3/SetUpRemarks/update",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | trace(x.xml()); |
| | | if(x.selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | win32::MessageBox(GetHWND(),"保存成功!","提示",0); |
| | | MessageBox(GetHWND(),L"保存成功!",L"提示",0); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | if (url::get("/sale/data/TradeFinance3/SetUpRemarks/list",arg.GetString(),x)!=1) |
| | | |
| | | xaserverarg arg; |
| | | |
| | | if (xurl::get(L"/sale/data/TradeFinance3/SetUpRemarks/list",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/FinancialCode/template/SetUpRemarksList"); |
| | | dw_list.SetColumnState("ID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/FinancialCode/template/SetUpRemarksList"); |
| | | dw_list.SetColumnState(L"ID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class SourceRemark : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) SourceRemark : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | SourceRemark(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static SourceRemark* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | SourceRemark* pWin = new SourceRemark(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=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | int row =dw_list.GetRowCount(); |
| | | dw_list.InsertRow(0); |
| | | //dw_list.SetItemString(row+1,"State","Y"); |
| | | //dw_list.SetItemString(row+1,L"State",L"Y"); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmRefresh") |
| | | else if(comdid==L"xmRefresh") |
| | | return OnRetrieve(); |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&SourceRemark::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&SourceRemark::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | if (url::get("/sale/data/TradeFinance3/SourceRemark/update",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"content",x.xml()); |
| | | if (xurl::get(L"/sale/data/TradeFinance3/SourceRemark/update",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | trace(x.xml()); |
| | | if(x.selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | win32::MessageBox(GetHWND(),"保存成功!","提示",0); |
| | | MessageBox(GetHWND(),L"保存成功!",L"提示",0); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | if (url::get("/sale/data/TradeFinance3/SourceRemark/list",arg.GetString(),x)!=1) |
| | | |
| | | xaserverarg arg; |
| | | |
| | | if (xurl::get(L"/sale/data/TradeFinance3/SourceRemark/list",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/FinancialCode/template/SourceRemarkList"); |
| | | dw_list.SetColumnState("ID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/FinancialCode/template/SourceRemarkList"); |
| | | dw_list.SetColumnState(L"ID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class SpecialDeductFeeList : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) SpecialDeductFeeList : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | SpecialDeductFeeList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static SpecialDeductFeeList* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | SpecialDeductFeeList* pWin = new SpecialDeductFeeList(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=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | int row =dw_list.GetRowCount(); |
| | | dw_list.InsertRow(0); |
| | | //dw_list.SetItemString(row+1,"State","Y"); |
| | | //dw_list.SetItemString(row+1,L"State",L"Y"); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmRefresh") |
| | | else if(comdid==L"xmRefresh") |
| | | return OnRetrieve(); |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&SpecialDeductFeeList::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&SpecialDeductFeeList::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | trace(x.GetXml()); |
| | | if (url::get("/sale/data/expense3/update/SpecialDeductFee",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"content",x.xml()); |
| | | trace(x.xml()); |
| | | if (xurl::get(L"/sale/data/expense3/update/SpecialDeductFee",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | trace(x.xml()); |
| | | if(x.selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | win32::MessageBox(GetHWND(),"保存成功!","提示",0); |
| | | MessageBox(GetHWND(),L"保存成功!",L"提示",0); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | if (url::get("/sale/data/expense3/SpecialDeductFeeList",arg.GetString(),x)!=1) |
| | | |
| | | xaserverarg arg; |
| | | |
| | | if (xurl::get(L"/sale/data/expense3/SpecialDeductFeeList",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/expense3/SpecialDeductFeeList"); |
| | | dw_list.SetColumnState("ID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/expense3/SpecialDeductFeeList"); |
| | | dw_list.SetColumnState(L"ID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | 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 <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class TypeListMaintWin : public xframe |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) TypeListMaintWin : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xtreeview tv_folder; |
| | | |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | TypeListMaintWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static TypeListMaintWin* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | TypeListMaintWin* pWin = new TypeListMaintWin(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 OnSave() |
| | | { |
| | | xml x = ViewObject::MakeXml(); |
| | | xaserverarg arg = ViewObject::MakeArg(); |
| | | xml x; |
| | | xaserverarg arg ; |
| | | |
| | | xml x1 = ViewObject::MakeXml(); |
| | | x1.LoadXml("<root/>"); |
| | | xml x1; |
| | | x1.loadXML(L"<root/>"); |
| | | |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | msxml::IXMLDOMNodeList t = x.GetXmlDoc().selectNodes("root/Supplier[@update.modify]"); |
| | | msxml::IXMLDOMElement e1= x1.GetXmlDoc().documentElement; |
| | | int len = t.length; |
| | | dw_list.DwUpdateAllToEx(x); |
| | | KXMLDOMNodeList t = x.selectNodes(L"root/Supplier[@update.modify]"); |
| | | KXMLDOMElement e1= x1.documentElement(); |
| | | int len = t.length(); |
| | | for(int i=0;i<len;i++) |
| | | { |
| | | e1.appendChild(t.item(i)); |
| | | } |
| | | arg.AddArg("content",x1.GetXml()); |
| | | if(url::get("/sale/data/SupplierV3/entity/save/v3", arg.GetString(),x)!=1) |
| | | arg.AddArg(L"content",x1.xml()); |
| | | if(xurl::get(L"/sale/data/SupplierV3/entity/save/v3", arg.GetString(),x)!=1) |
| | | { |
| | | string error = x.GetXmlDoc().text; |
| | | xstring error = x.text(); |
| | | alert(error); |
| | | return 1; |
| | | }else |
| | | { |
| | | |
| | | if( x.GetXmlDoc().selectSingleNode("ok")) |
| | | if( x.selectSingleNode(L"ok")) |
| | | { |
| | | alert("保存成功"); |
| | | alert(L"保存成功"); |
| | | dw_list.ResetUpdateStatus(); |
| | | }else |
| | | { |
| | | alert("保存失败!"); |
| | | alert(L"保存失败!"); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //命令发布函数 |
| | | int OnCmdDispatch(string comdid) |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | if(comdid=="xmSave") |
| | | if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmSearch") |
| | | else if(comdid==L"xmSearch") |
| | | return OnRetrieve(); |
| | | |
| | | return 0; |
| | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | int hItem =tv_folder.GetSelectedItem(); |
| | | string typ = tv_folder.GetItemData(hItem); |
| | | string searchStr = GetControl("SearchContent").GetText(); |
| | | HTREEITEM hItem =tv_folder.GetSelectedItem(); |
| | | xstring typ = tv_folder.GetItemData(hItem); |
| | | xstring searchStr = xcontrol(GetControl(L"SearchContent")).GetText(); |
| | | |
| | | int hCursor = xutil::SetCursorWait(); |
| | | xml x = ViewObject::RetrieveData("/sale/data/SupplierV3/type/list", "sType",typ,"SearchText",searchStr); |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/SupplierV3/type/list", L"sType",typ,L"SearchText",searchStr); |
| | | if(x) |
| | | dw_list.Retrieve(x); |
| | | else |
| | |
| | | } |
| | | |
| | | //树选择 |
| | | int OnTreeSelChanged(ref TNotifyEvent evt,int p) |
| | | int OnTreeSelChanged(TEvent* evt, int p) |
| | | { |
| | | ref NMTREEVIEW nmtv = cast(evt.pnmh as NMTREEVIEW); |
| | | int hItem = nmtv.itemNew.hItem; |
| | | NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; |
| | | |
| | | HTREEITEM hItem = nmtv.itemNew.hItem; |
| | | return OnRetrieve(); |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&TypeListMaintWin::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent("tv_folder", "TVN_SELCHANGED",OnTreeSelChanged); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&TypeListMaintWin::OnSetFocus); |
| | | AttachEvent(L"tv_folder", L"TVN_SELCHANGED", (FEvent)&TypeListMaintWin::OnTreeSelChanged); |
| | | return 1; |
| | | } |
| | | |
| | | /* |
| | |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("xxx","xxx"); |
| | | if (getUrl("",arg.GetString(),x)!=1) |
| | | arg.AddArg(L"xxx",L"xxx"); |
| | | if (getUrl(L"",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/SupplierV3/template/supplier/mainttypelist"); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/SupplierV3/template/supplier/mainttypelist"); |
| | | |
| | | tv_folder = GetControl("tv_folder"); |
| | | tv_folder = GetControl(L"tv_folder"); |
| | | OnAttachEvent(); |
| | | xtreeview::ExpandItem(tv_folder.GetId(),xtreeview::GetRootItem(tv_folder.GetId())); |
| | | tv_folder.ExpandItem(tv_folder.GetRootItem()); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |
| | |
| | | use "xcontrol.vframe.vbusiness.vd" |
| | | use "xbase.vframe.vbusiness.vd" |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | #include <xcontrol/xdatetimepick.hpp> |
| | | |
| | | unit trade |
| | | [ |
| | | class basicfareTypeList : public xwin |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) basicfareTypeList : public xwin |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xnode m_agentNode; //Agent Condition |
| | | |
| | | public: |
| | | basicfareTypeList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static basicfareTypeList* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | basicfareTypeList* pWin = new basicfareTypeList(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=="xmAddRow") |
| | | if(comdid==L"xmAddRow") |
| | | { |
| | | int row =dw_list.GetRowCount(); |
| | | dw_list.InsertRow(0); |
| | | dw_list.SetItemString(row+1,"State","Y"); |
| | | dw_list.SetItemString(row+1,L"State",L"Y"); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmDeleteRow") |
| | | else if(comdid==L"xmDeleteRow") |
| | | { |
| | | dw_list.DeleteRow(0); |
| | | return 1; |
| | | } |
| | | else if(comdid=="xmSave") |
| | | else if(comdid==L"xmSave") |
| | | return OnSave(); |
| | | else if(comdid=="xmRefresh") |
| | | else if(comdid==L"xmRefresh") |
| | | return OnRetrieve(); |
| | | return 0; |
| | | } |
| | | |
| | | //命令处理事件 |
| | | 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)&basicfareTypeList::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&basicfareTypeList::OnSetFocus); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml x=new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | xaserverarg arg=new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("content",x.GetXml()); |
| | | if (url::get("/sale/data/expense3/update/basicfareType",arg.GetString(),x) != 1) |
| | | xml x; |
| | | |
| | | dw_list.DwUpdateAllToEx(x); |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"content",x.xml()); |
| | | if (xurl::get(L"/sale/data/expense3/update/basicfareType",arg.GetString(),x) != 1) |
| | | { |
| | | trace("error:"+x.GetXml()); |
| | | alert("保存失败!"); |
| | | trace(L"error:"+(xstring)x.xml()); |
| | | alert(L"保存失败!"); |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | trace(x.GetXml()); |
| | | if(x.GetXmlDoc().selectSingleNode("error")) |
| | | trace(x.xml()); |
| | | if(x.selectSingleNode(L"error")) |
| | | { |
| | | alert("保存出错2!"); |
| | | alert(L"保存出错2!"); |
| | | return 0; |
| | | } |
| | | win32::MessageBox(GetHWND(),"保存成功!","提示",0); |
| | | MessageBox(GetHWND(),L"保存成功!",L"提示",0); |
| | | dw_list.ResetUpdateStatus(); |
| | | } |
| | | dw_list.Redraw(); |
| | |
| | | int OnRetrieve() |
| | | { |
| | | xml x = new xml; |
| | | x.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg = new xaserverarg; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | if (url::get("/sale/data/expense3/basicfareTypeLsit",arg.GetString(),x)!=1) |
| | | |
| | | xaserverarg arg; |
| | | |
| | | if (xurl::get(L"/sale/data/expense3/basicfareTypeLsit",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/expense3/basicfareTypeList"); |
| | | dw_list.SetColumnState("ID",false); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/expense3/basicfareTypeList"); |
| | | dw_list.SetColumnState(L"ID",false); |
| | | |
| | | OnRetrieve(); |
| | | |
| | |
| | | |
| | | return 1; |
| | | } |
| | | }; |
| | | ] |
| | | }; |