| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #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) ForwarderList : public xwin |
| | | { |
| | | |
| | | public: |
| | | //xdwpages dw_pages; |
| | | xstring m_QueryTxt; |
| | | KXMLDOMDocument m_configDoc; |
| | | xtreeview tv_1; |
| | | xstring sType; |
| | | static int dw_hWnd; |
| | | int m_pageIndex; |
| | | int m_pageNumber; |
| | | xdwgrid dw_list; |
| | | public: |
| | | ForwarderList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {} |
| | | public: |
| | | static ForwarderList* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | ForwarderList* pWin = new ForwarderList(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | |
| | | |
| | | int SetEntityData(xaserverarg arg) |
| | | { |
| | | |
| | | arg.AddArg(L"sType", sType); |
| | | xml x; |
| | | |
| | | getUrl(L"/sale/data/LogisticsCode/entity/list", arg.GetString(), x); |
| | | KXMLDOMElement e = x.documentElement(); |
| | | if (e) |
| | | { |
| | | if (list::dw_pages.nativept && e.selectSingleNode(L"@TotalPage")) |
| | | { |
| | | xstring s = e.selectSingleNode(L"@TotalPage").text(); //æ»æ°é |
| | | list::dw_pages.SetMaxPage(s.toInt()); |
| | | } |
| | | } |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"pageindex", xstring(m_pageIndex)); //第å 页 |
| | | arg.AddArg(L"pagenumber", xstring(m_pageNumber)); //æ¯é¡µæ°é |
| | | //trace(list::m_QueryTxt); |
| | | arg.AddArg(L"QueryTxt", list::m_QueryTxt); //æ¯é¡µæ°é |
| | | return SetEntityData(arg); |
| | | } |
| | | int OnTreeSelChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; |
| | | HTREEITEM hItem = nmtv.itemNew.hItem; |
| | | list::m_QueryTxt = L""; |
| | | |
| | | HTREEITEM hitem = tv_1.GetSelectedItem(); |
| | | //c_type=dw_type.GetItemLabel(hitem); |
| | | //妿æ¯è·èç¹ |
| | | HTREEITEM roothitem = tv_1.GetRootItem(); |
| | | KXMLDOMElement e = tv_1.GetItemData(hitem); |
| | | xstring value = e.selectSingleNode(L"@data").text(); |
| | | sType = value + L""; |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | | int OnChangePages(TEvent* evt, LPARAM p) |
| | | { |
| | | PAGENMHDR& h = *(PAGENMHDR*)evt->notify.pnmh; |
| | | int c = h.cur; |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | m_pageIndex = c; |
| | | OnRetrieve(); |
| | | xutil::RestoreCursor(hCursor); |
| | | return 1; |
| | | } |
| | | |
| | | int ViewUpdate(param pr, xstring updateItem, xaserverarg arg) |
| | | { |
| | | if (updateItem == L"del") |
| | | { |
| | | int DelRow = dw_list.GetRow(); |
| | | dw_list.DeleteRow(DelRow); |
| | | |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //è·å¾æ çéæ©äºä»¶ |
| | | AttachEvent(L"tv_1", L"TVN_SELCHANGED", (FEvent)&ForwarderList::OnTreeSelChanged); |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | list::m_QueryTxt = L""; |
| | | m_pageIndex = 1; |
| | | m_pageNumber = 30; |
| | | sType = L"0"; |
| | | list::onload(); |
| | | |
| | | OnAttachEvent(); |
| | | |
| | | |
| | | |
| | | tv_1 = new treeview; |
| | | tv_1.setNativePointer(GetControl(L"tv_1")); |
| | | |
| | | HTREEITEM root = tv_1.GetRootItem(); |
| | | tv_1.ExpandItem(root); |
| | | dw_list.SetColumnStaus(L"ForwarderID", false); |
| | | return 1; |
| | | } |
| | | }; |