| ÎļþÃû´Ó jrj/project/business/AP/list.Test.ap.cpp ÐÞ¸Ä |
| | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | class __declspec(dllexport) ListTestAP : public xframe |
| | | { |
| | |
| | | ListTestAP* pWin = new ListTestAP(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | int SetAgent() |
| | | /*int SetAgent() |
| | | { |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | }*/ |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //é置工å
·æ¡ |
| | | SetAgent(); |
| | | //é置工å
·æ¡ |
| | | SetAgent(L"list", GetEntityID(1)); |
| | | return 1; |
| | | } |
| | | |
| | | xstring GetEntityName(LPARAM pr) |
| | | { |
| | | return L"APTest"; |
| | | } |
| | | |
| | | xstring GetEntityID(LPARAM pr) |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | xstring id = dw_list.GetItemString(row, L"APID"); |
| | | //alert(id); |
| | | return id; |
| | | } |
| | | |
| | | xstring GetPayType() |
| | |
| | | else return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | xstring payType = GetPayType(); |
| | | xstring payType =L"æµè¯è´¹"; |
| | | |
| | | |
| | | |
| | | if (comdid == L"xmBank") return OnBank(); |
| | | if (comdid == L"xmBank" || comdid == L"action:bill.xmBank") return OnBank(); |
| | | if (comdid == L"xmSave") return OnSave(); |
| | | if (comdid == L"xmRefresh" || comdid == L"xmSearch") |
| | | if (comdid == L"xmRefresh" || comdid == L"xmSearch" || comdid == L"action:bill.refresh") |
| | | { |
| | | return OnRetrieveEx(apType); |
| | | } |
| | | if (comdid == L"xmAddRow") |
| | | if (comdid == L"xmAddRow" || comdid == L"action:bill.new" ) |
| | | { |
| | | xaserverarg arg1; |
| | | |
| | | if (payType == L"è¿æè´¹" or payType == L"æµè¯è´¹") |
| | | if (payType == L"è¿æè´¹" or payType == L"æµè¯è´¹") |
| | | arg1.AddArg(L"payType", payType); |
| | | OpenWindow(L"dev:xpage[maint.expense.ap.vx]", arg1); |
| | | return 1; |
| | | } |
| | | if (comdid == L"xmModifyRow") |
| | | if (comdid == L"xmModifyRow" || comdid == L"action:bill.open") |
| | | { |
| | | xaserverarg arg; |
| | | int row = dw_list.GetRow(); |
| | |
| | | OpenWindow(L"dev:xpage[maint.expense.ap.vx]", arg); |
| | | return 1; |
| | | } |
| | | if (comdid == L"xmDeleteRow") |
| | | if (comdid == L"xmDeleteRow" || comdid == L"action:bill.delete") |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | if (row < 1) return 1; |
| | |
| | | |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret = MessageBox(GetHWND(), L"确认å é¤äº§åæµè¯è´¹?", L"æç¤º", MB_OKCANCEL); |
| | | int ret = MessageBox(GetHWND(), L"确认å é¤äº§åæµè¯è´¹?", L"æç¤º", MB_OKCANCEL); |
| | | if (ret == IDOK) |
| | | { |
| | | ViewObject::RetrieveData(L"/sale/data/AP/delete/AP", L"EntityID", APID1); |
| | |
| | | |
| | | return 1; |
| | | } |
| | | if (comdid == L"xmPrint") |
| | | if (comdid == L"xmPrint" || comdid == L"action:bill.xmPrint") |
| | | { |
| | | return OnPrint(); |
| | | } |
| | | if (comdid == L"action:bill.check.ask") |
| | | { |
| | | ProcessFlowAction(L"action:bill.check.ask", 1); |
| | | PostMessage(GetFrameWindow().GetHWND(), 0x401, (LPARAM)L"xmRefresh", 0); |
| | | return 1; |
| | | } |
| | | if (comdid.find(L"action:", 0) >= 0) |
| | | { |
| | | if (dw_list.GetRow() < 1) |
| | | return 0; |
| | | int ret1 = ProcessFlowAction(comdid, 1); |
| | | return ret1; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | |
| | | int h = xcombobox::GetCurSel(evt->command.hCtrl); |
| | | if (h > -1) |
| | | { |
| | | xstring txt = (string)xcombobox::GetLBText(evt->command.hCtrl, h); |
| | | xstring txt = L"æµè¯è´¹"; |
| | | apType = L"---"; |
| | | if (txt == L"è¿æè´¹") |
| | | if (txt == L"è¿æè´¹") |
| | | { |
| | | dw_list.openUrl(L"/sale/view/AP/template/AP/Expense/List"); |
| | | apType = L"003"; |
| | | } |
| | | if (txt == L"æµè¯è´¹") |
| | | if (txt == L"æµè¯è´¹") |
| | | { |
| | | dw_list.openUrl(L"/sale/view/AP/template/AP/Expense/List"); |
| | | apType = L"021"; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&ListTestAP::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&ListTestAP::OnSetFocus); |
| | | AttachEvent(L"cbx_type", L"CBN_SELCHANGE", (FEvent)&ListTestAP::OnCombboChanged);//屿§ç»åæ¢listä¸åçæ°éåå |
| | | AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&ListTestAP::OnDoubleClicked);//è¡åå» |
| | | AttachEvent(L"cbx_type", L"CBN_SELCHANGE", (FEvent)&ListTestAP::OnCombboChanged);//屿§ç»åæ¢listä¸åçæ°éåå |
| | | AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&ListTestAP::OnDoubleClicked);//è¡åå» |
| | | AttachEvent(L"dw_list", L"DWV_CLICKED", (FEvent)&ListTestAP::OnDwClicked); |
| | | return 1; |
| | | } |
| | |
| | | if (str == L"true") |
| | | { |
| | | dw_list.ResetUpdateStatus(); |
| | | alert(L"ä¿åæå!"); |
| | | alert(L"ä¿åæå!"); |
| | | } |
| | | else |
| | | { |
| | | alert(L"ä¿å失败!"); |
| | | alert(L"ä¿å失败!"); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | |
| | | xaserverarg arg; |
| | | |
| | | |
| | | arg.AddArg(L"APType",L"021"); |
| | | arg.AddArg(L"QueryTxt", xcontrol(GetControl(L"sle_search")).GetText()); |
| | | arg.AddArg(L"APType", APType); |
| | | arg.AddArg(L"QueryArg", GetQueryArg()); |
| | | arg.AddArg(L"DatePicker", L"APDate"); |
| | | if (getUrl(L"/sale/data/AP/list", arg.GetString(), x) != 1) |
| | | //alert(arg.GetString()); |
| | | if (getUrl(L"/sale/data/AP/listAPTest", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.text()); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | dw_list.SetReadOnly(true); |
| | | dw_list.SetSelectionMode(3); |
| | | dw_list.SetSelectionMode(1); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"/sale/view/AP/template/AP/Expense/List"); |
| | | dw_list.SetColumnState(L"APID", false); |
| | | |
| | | dw_arg = GetControl(L"dw_arg"); |
| | | dw_arg.openUrl(L"/sale/view/AR/template/queryarg"); |
| | |
| | | dw_arg.SetRowSelectorWidth(0); |
| | | dw_arg.SetHScrollState(false); |
| | | dw_arg.SetVScrollState(false); |
| | | |
| | | dw_arg.SetItemString(1, L"DateType", L"ä¸è®¾å®"); |
| | | |
| | | OnAttachEvent(); |
| | | apType = L"003"; |
| | | apType = L"021"; |
| | | OnRetrieveEx(apType); |
| | | |
| | | return 1; |
| | |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | SetAgent(L"list", GetEntityID(1)); |
| | | |
| | | return 1; |
| | | } |