¶Ô±ÈÐÂÎļþ |
| | |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | #include <xcontrol/xlayersheet.hpp> |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) PaymentTermlist111 : public xwin |
| | | { |
| | | public: |
| | | |
| | | xdwgrid dw_list; |
| | | public: |
| | | PaymentTermlist111(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static PaymentTermlist111* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | PaymentTermlist111* pWin = new PaymentTermlist111(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | //xdwgrid dw_list; |
| | | int OnDBClick(TEvent* evt, LPARAM p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | //alert(row.toString()); |
| | | KXMLDOMElement e = dw_list.GetRowElement(row); |
| | | xstring id = e.selectSingleNode(L"TermID").text(); |
| | | //alert( id); |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"EntityID", id); |
| | | //arg.AddArg(L"hwnd", GetHWND().toString()); |
| | | |
| | | openUrl(L"/sale/view/Payment/worknode/Payment/maint", arg); |
| | | if (arg.GetArgString(L"ret") == L"Ok") |
| | | { |
| | | alert(L"OK"); |
| | | list::onloaded(); |
| | | } |
| | | return 1; |
| | | } |
| | | int OnDelete() |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | if (row < 1) return 1; |
| | | KXMLDOMElement ele = dw_list.GetRowElement(row); |
| | | xstring termid = ele.selectSingleNode(L"TermID").text(); |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"termId",termid); |
| | | //alert(termid); |
| | | xml x1 ; |
| | | |
| | | if (xurl::post(L"/sale/data/PaymentTerm/entity/delete",arg.GetString(),x1) != 1) |
| | | { |
| | | xstring error = x1.text(); |
| | | trace(error); |
| | | } |
| | | else |
| | | { |
| | | //error = x1.text(); |
| | | //alert(error); |
| | | MessageBox(GetHWND(),L"å 餿åï¼",L"æç¤º",0); |
| | | dw_list.DeleteRow(row); |
| | | } |
| | | } |
| | | |
| | | int OnNew() |
| | | { |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"EntityID", L"new"); |
| | | |
| | | //openUrl(L"/sale/view/Test/worknode/company/maint", arg); |
| | | openUrl(L"/sale/view/Payment/worknode/Payment/maint", arg); |
| | | return 0; |
| | | } |
| | | int OnOpen() |
| | | { |
| | | xaserverarg arg ; |
| | | |
| | | int row = dw_list.GetRow(); |
| | | if (row < 1) |
| | | { |
| | | MessageBox(GetHWND(),L"请éä¸è¦ä¿®æ¹çè¡ï¼",L"æç¤º",0); |
| | | return -1; |
| | | } |
| | | KXMLDOMElement e = dw_list.GetRowElement(row); |
| | | xstring guid = e.selectSingleNode(L"TermID").text(); |
| | | arg.AddArg(L"EntityID",guid); |
| | | |
| | | openUrl(L"/sale/view/Test2/worknode/company2/maint", arg); |
| | | |
| | | } |
| | | int OnRefresh() |
| | | { |
| | | list::onloaded(); |
| | | return 0; |
| | | } |
| | | //æé®äºä»¶ |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | //alert(comdid); |
| | | if (comdid == L"action:bill.new") return OnNew(); |
| | | else if(comdid == L"action:bill.open") return OnOpen(); |
| | | else if(comdid == L"Refresh") return OnRefresh(); |
| | | else if(comdid == L"action:bill.delete") return OnDelete(); |
| | | return 0; |
| | | } |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnAttachEvent() |
| | | { |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&PaymentTermlist111::OnXCommand); |
| | | //AttachEvent(L"WM_SETFOCUS",OnSetFocus); |
| | | |
| | | //AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED",OnRowChanged); |
| | | AttachEvent(L"dw_list",L"DWV_DOUBLECLICKED", (FEvent)&PaymentTermlist111::OnDBClick); |
| | | return 1; |
| | | } |
| | | int onload() |
| | | { |
| | | |
| | | list::onload(); |
| | | OnAttachEvent(); |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | //OnRetrieve(); |
| | | //alert(L"12"); |
| | | list::onloaded(); |
| | | |
| | | |
| | | return -1; |
| | | } |
| | | }; |