|  |  | 
 |  |  | #include <wobject/xstring.hpp> | 
 |  |  | #include <wobject/xstring.hpp> | 
 |  |  | #include <xcontrol/xtreeview.hpp> | 
 |  |  | #include <xcontrol/xdwgrid.hpp> | 
 |  |  | #include <xcontrol/xcell.hpp> | 
 |  |  | 
 |  |  |  | 
 |  |  | using xml = KXMLDOMDocument; | 
 |  |  |  | 
 |  |  |    class __declspec(dllexport) PaymentTermEdit : public xframe | 
 |  |  |    class __declspec(dllexport) PaymentTermSOEdit : public xframe | 
 |  |  |    { | 
 |  |  |    public: | 
 |  |  |       xdwtable   dw_1; | 
 |  |  |       xdwtable   dw_p; | 
 |  |  |  | 
 |  |  |       xcell dw_cell; | 
 |  |  |       vcontrol vc; | 
 |  |  |  | 
 |  |  |       //xcell dw_cell; | 
 |  |  |       xstring sCryno; | 
 |  |  |  | 
 |  |  |    public: | 
 |  |  |       PaymentTermEdit(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} | 
 |  |  |       PaymentTermSOEdit(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} | 
 |  |  |    public: | 
 |  |  |       static PaymentTermEdit* CreateInstance(void* implPtr, void* hWnd) | 
 |  |  |       static PaymentTermSOEdit* CreateInstance(void* implPtr, void* hWnd) | 
 |  |  |       { | 
 |  |  |          PaymentTermEdit* pWin = new PaymentTermEdit(implPtr, (HWND)hWnd); | 
 |  |  |          PaymentTermSOEdit* pWin = new PaymentTermSOEdit(implPtr, (HWND)hWnd); | 
 |  |  |          return pWin; | 
 |  |  |       } | 
 |  |  |  | 
 |  |  | 
 |  |  |          xstring sTxt = OnCreateTxt(); | 
 |  |  |          dw_1.SetItemString(1, L"PaymentTermEx", sTxt); | 
 |  |  |  | 
 |  |  |          xml x; | 
 |  |  |          dw_1.DwUpdateAllTo(x); | 
 |  |  |          GetArg().SetArg(L"content", x.xml()); | 
 |  |  |          GetArg().SetArg(L"process", L"ok"); | 
 |  |  |  | 
 |  |  |          CloseWindow(); | 
 |  |  |  | 
 |  |  |          return 1; | 
 |  |  | 
 |  |  |  | 
 |  |  |       int OnAttachEvent() | 
 |  |  |       { | 
 |  |  |          AttachEvent(L"WM_XCOMMAND", (FEvent)&PaymentTermEdit::OnXCommand); | 
 |  |  |          AttachEvent(L"dw_1", L"DWV_ITEMCHANGED", (FEvent)&PaymentTermEdit::OnItemChanged); | 
 |  |  |          AttachEvent(L"dw_1", L"DWV_CLICKED", (FEvent)&PaymentTermEdit::OnClick); | 
 |  |  |          AttachEvent(L"WM_XCOMMAND", (FEvent)&PaymentTermSOEdit::OnXCommand); | 
 |  |  |          AttachEvent(L"dw_1", L"DWV_ITEMCHANGED", (FEvent)&PaymentTermSOEdit::OnItemChanged); | 
 |  |  |          AttachEvent(L"dw_1", L"DWV_CLICKED", (FEvent)&PaymentTermSOEdit::OnClick); | 
 |  |  |  | 
 |  |  |          return 1; | 
 |  |  |       } | 
 |  |  |  | 
 |  |  |       int OnInit() | 
 |  |  |       { | 
 |  |  |          xaserver Args = GetArg(); | 
 |  |  |  | 
 |  |  |          xaserverarg Args = GetArg(); | 
 |  |  |          /* | 
 |  |  |          XXmlContentSvr xdoc = new XXmlContentSvr; | 
 |  |  |          xdoc.setNativePointer(Args); | 
 |  |  |          vc = new vcontrol; | 
 |  |  | 
 |  |  |  | 
 |  |  |          vbind bind = new vbind; | 
 |  |  |          bind.bind(dw_1, vc); | 
 |  |  |  | 
 |  |  |          xml x; | 
 |  |  | 			 | 
 |  |  |             xml x; | 
 |  |  |          x.loadXML(vc.GetContent()); | 
 |  |  |  | 
 |  |  |          */ | 
 |  |  |          //alert(x.GetXml()); | 
 |  |  |  | 
 |  |  |          xml x; | 
 |  |  |          xstring xs = GetArg().GetArgString(L"content"); | 
 |  |  |          x.loadXML(xs.c_str()); | 
 |  |  |          dw_1.Retrieve(x); | 
 |  |  |  | 
 |  |  |          //if (x.GetXmlDoc().documentElement.selectSingleNode(L"CurrencyCode")) | 
 |  |  | 
 |  |  |  | 
 |  |  |       int onload() | 
 |  |  |       { | 
 |  |  |          SetArg(); | 
 |  |  |          dw_1 = GetControl(L"dw_1"); | 
 |  |  |          dw_1.openUrl(L"/sale/view/SaleOrder/template/payment"); //base.maint.so.tpl/payment | 
 |  |  |  | 
 |  |  |          /* | 
 |  |  |          xml x = new xml; | 
 |  |  |          xml x ; | 
 |  |  |          x.setNativePointer(xml::CreateInstance()); | 
 |  |  |          if(url::get(L"/sale/view/SaleOrder/template/SaleOrder/payment1",L"",x)!=1) //SO.updata.oldserver.pr.xq | 
 |  |  |          { | 
 |  |  | 
 |  |  |          dw_1.SetRowSelectorWidth(0); | 
 |  |  |          dw_1.SetScrollState(false); | 
 |  |  |  | 
 |  |  |          dw_cell = new xcell; | 
 |  |  |          dw_cell.setNativePointer(dw_1.QueryItem(L"ixcell")); | 
 |  |  |          //dw_cell = new xcell; | 
 |  |  |          //dw_cell.setNativePointer(dw_1.QueryItem(L"ixcell")); | 
 |  |  |  | 
 |  |  |          OnAttachEvent(); | 
 |  |  |  | 
 |  |  |          if (GetParam())OnInit(); | 
 |  |  |          if (GetWinParam())OnInit(); | 
 |  |  |  | 
 |  |  |          return 1; | 
 |  |  |       } |