From 7a91c3a1ed37b0332d4ff0ebeae60bd6da3665c0 Mon Sep 17 00:00:00 2001 From: xj qian <qianxj15@sina.com> Date: 星期二, 16 七月 2024 18:28:58 +0800 Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/mis-prj --- jrj/project/business/BasicCode/PaymentTerm.list.cpp | 144 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 144 insertions(+), 0 deletions(-) diff --git a/jrj/project/business/BasicCode/PaymentTerm.list.cpp b/jrj/project/business/BasicCode/PaymentTerm.list.cpp new file mode 100644 index 0000000..d21425f --- /dev/null +++ b/jrj/project/business/BasicCode/PaymentTerm.list.cpp @@ -0,0 +1,144 @@ +#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; + } +}; \ No newline at end of file -- Gitblit v1.9.3