From aca1cda66c85390941657258fbd7ccaf82b3200c Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 09 七月 2024 10:28:37 +0800
Subject: [PATCH] update ap ar enquery
---
jrj/project/business/AR/maint.SettlementExchange.cpp | 4
jrj/project/start.vframe.vbusiness.cpp | 1048 ++++++++++++++++++++++++++++++++++++++---
jrj/project/business/AR/ExchageInput3.cpp | 24
jrj/project/business/AP/APNew3.warizd.cpp | 11
jrj/project/total3/ViewTotalWin.cpp | 4
jrj/project/business/Enquiry.list.cpp | 289 ++++------
jrj/project/business/AP/list.ap.cpp | 19
jrj/ext-jrj/ext-jrj.vcxproj.filters | 3
jrj/xframe/xcontrol/xcombobox.hpp | 5
jrj/project/business/AR/ExchangeSignFast.cpp | 22
jrj/project/business/AR/Deduction.cpp | 2
jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp | 4
jrj/project/business/AP/maint.ap.cpp | 6
jrj/project/business/AR/ExchageFile.cpp | 2
jrj/ext-jrj/ext-jrj.vcxproj | 24
15 files changed, 1,143 insertions(+), 324 deletions(-)
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index a38f618..ac47fa4 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -127,7 +127,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
- <AdditionalDependencies>xarch.shape.lib;xarch.base.lib;xarch.util.lib;xarch.network.lib;xarch.xframe.lib;xarch.xcontrol.lib;xoffice.xcell.lib;xoffice.xgrid.lib;xoffice.xreport.lib;shlwapi.lib;xoffice.xflow.lib;comsuppw.lib;%(AdditionalDependencies);$(CoreLibraryDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>xarch.shape.lib;xarch.base.lib;xarch.util.lib;xarch.network.lib;xarch.xframe.lib;xarch.xcontrol.lib;xoffice.xcell.lib;xoffice.xgrid.lib;xoffice.xreport.lib;xoffice.frame.lib;shlwapi.lib;xoffice.xflow.lib;comsuppw.lib;%(AdditionalDependencies);$(CoreLibraryDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>D:\xclient64</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
@@ -224,6 +224,7 @@
<ClInclude Include="..\xframe\wobject\xview.hpp" />
<ClInclude Include="..\xframe\wobject\xwin.hpp" />
<ClInclude Include="..\xframe\xcontrol\xcell.hpp" />
+ <ClInclude Include="..\xframe\xcontrol\xcheckbox.hpp" />
<ClInclude Include="..\xframe\xcontrol\xcombobox.hpp" />
<ClInclude Include="..\xframe\xcontrol\xdwgrid.hpp" />
<ClInclude Include="..\xframe\xcontrol\xdwpages.hpp" />
@@ -249,28 +250,29 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AP\APNew3.warizd.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AP\list.ap.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AP\maint.ap.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AP\Select.AP.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\CustomerTran.AR.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\Deduction.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\ExchageFile.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\ExchageInput3.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\ExchangeBankTran.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
@@ -279,10 +281,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\ExchangeSignFast.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\AR\maint.SettlementExchange.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\Customer3.list.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
@@ -291,7 +293,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\Enquiry.list.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\project\business\EnquiryEx3.list.cpp" />
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index 55d98b6..e72e70b 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -342,6 +342,9 @@
<ClInclude Include="..\xframe\kobject\koffice.hpp">
<Filter>xframe\kobject</Filter>
</ClInclude>
+ <ClInclude Include="..\xframe\xcontrol\xcheckbox.hpp">
+ <Filter>xframe\xcontrol</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
diff --git a/jrj/project/business/AP/APNew3.warizd.cpp b/jrj/project/business/AP/APNew3.warizd.cpp
index deaedf2..a22bcaa 100644
--- a/jrj/project/business/AP/APNew3.warizd.cpp
+++ b/jrj/project/business/AP/APNew3.warizd.cpp
@@ -2,6 +2,7 @@
#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"
@@ -430,8 +431,8 @@
int row = hdr.row;
OnPrepayRetrieve(row, bstart);
- xml x = ViewObject::RetrieveData( L"/sale/data/AP/list/invoice/supplier", L"InvoiceNo", dw_1.GetItemString(row, L"InvoiceNo"),
- "SupplierID", dw_1.GetItemString(row, L"SupplierID"));
+ xml x = ViewObject::RetrieveData(GetServerUrl(), L"/sale/data/AP/list/invoice/supplier", L"InvoiceNo", dw_1.GetItemString(row, L"InvoiceNo"),
+ L"SupplierID", dw_1.GetItemString(row, L"SupplierID"));
if (x) dw_101.Retrieve(x);
dw_2.Redraw();
@@ -548,13 +549,9 @@
KXMLDOMElement e = lst.item(i);
docElement.appendChild(e);
KXMLDOMElement fe = x1.createElement(L"FilterColumn");
- fe.text = filterStr;
+ fe.settext(filterStr);
e.appendChild(fe);
- fe.Release();
- e.Release();
}
- docElement.Release();
- lst.Release();
dw_2.Retrieve(x1);
}
else
diff --git a/jrj/project/business/AP/list.ap.cpp b/jrj/project/business/AP/list.ap.cpp
index 11b76e5..79200b8 100644
--- a/jrj/project/business/AP/list.ap.cpp
+++ b/jrj/project/business/AP/list.ap.cpp
@@ -188,10 +188,10 @@
{
xstring id = L"";
xstring name = L"";
- int h = xcombobox::GetCurSel(evt.hCtrl);
+ int h = xcombobox::GetCurSel(evt->command.hCtrl);
if (h > -1)
{
- xstring txt = xcombobox::GetLBText(evt.hCtrl, h);
+ xstring txt = xcombobox::GetLBText(evt->command.hCtrl, h);
apType = L"---";
if (txt == L"已付货款")
{
@@ -297,10 +297,10 @@
xstring payTypeTwo = GetPayType();
if (payTypeTwo == L"已付货款" || payTypeTwo == L"待付货款")
{
- int h = xcombobox::GetCurSel(evt.hCtrl);
+ int h = xcombobox::GetCurSel(evt->command.hCtrl);
if (h > -1)
{
- xstring txt = xcombobox::GetLBText(evt.hCtrl, h);
+ xstring txt = xcombobox::GetLBText(evt->command.hCtrl, h);
if (txt == L"出运日期")
{
apType = L"000";
@@ -323,10 +323,10 @@
}
else if (payTypeTwo == L"预付货款")
{
- int h1 = xcombobox::GetCurSel(evt.hCtrl);
+ int h1 = xcombobox::GetCurSel(evt->command.hCtrl);
if (h1 > -1)
{
- xstring txt1 = xcombobox::GetLBText(evt.hCtrl, h1);
+ xstring txt1 = xcombobox::GetLBText(evt->command.hCtrl, h1);
if (txt1 == L"出运日期")
{
apType = L"001";
@@ -349,10 +349,10 @@
}
else if (payTypeTwo == L"预付货款(已冲)L")
{
- int h2 = xcombobox::GetCurSel(evt.hCtrl);
+ int h2 = xcombobox::GetCurSel(evt->command.hCtrl);
if (h2 > -1)
{
- xstring txt2 = xcombobox::GetLBText(evt.hCtrl, h2);
+ xstring txt2 = xcombobox::GetLBText(evt->command.hCtrl, h2);
if (txt2 == L"出运日期")
{
apType = L"001";
@@ -476,8 +476,7 @@
xaserverarg arg;
arg.AddArg(L"html", str);
- int obj = cast(dw_list as int);
- arg.AddArg(L"obj", obj.toString());
+ arg.SetParam(L"obj", &dw_list);
OpenWindow(L"dev:xpage[data.vanalysis.vx]", arg);
xutil::RestoreCursor(hCursor);
return 1;
diff --git a/jrj/project/business/AP/maint.ap.cpp b/jrj/project/business/AP/maint.ap.cpp
index ae45d3e..b5723e2 100644
--- a/jrj/project/business/AP/maint.ap.cpp
+++ b/jrj/project/business/AP/maint.ap.cpp
@@ -58,9 +58,9 @@
xstring ChargeOffDate = dw_base.GetItemString(1, L"APDate");
xstring PayedAmount = dw_base.GetItemString(1, L"PayedAmount");
xstring val = L"<data><PO><item guid='" + AdvanceID + L"' update.modify='1'>" +
- "<ChargeOffState update.modify='1'>" + ChargeOffState + L"</ChargeOffState>" +
- "<ChargeOffMoney update.modify='1'>" + PayedAmount + L"</ChargeOffMoney>" +
- "<ChargeOffDate update.modify='1'>" + ChargeOffDate + L"</ChargeOffDate></item></PO></data>";
+ L"<ChargeOffState update.modify='1'>" + ChargeOffState + L"</ChargeOffState>" +
+ L"<ChargeOffMoney update.modify='1'>" + PayedAmount + L"</ChargeOffMoney>" +
+ L"<ChargeOffDate update.modify='1'>" + ChargeOffDate + L"</ChargeOffDate></item></PO></data>";
xaserverarg arg;
arg.AddArg(L"content", val);
diff --git a/jrj/project/business/AR/Deduction.cpp b/jrj/project/business/AR/Deduction.cpp
index c2d29b0..cb4571d 100644
--- a/jrj/project/business/AR/Deduction.cpp
+++ b/jrj/project/business/AR/Deduction.cpp
@@ -161,7 +161,7 @@
xaserverarg arg ;
arg.AddArg(L"InvoiceNo", InvoiceNo);
- arg.AddArg(L"InvoiceNoEx", GetControl(L"search").GetText());
+ arg.AddArg(L"InvoiceNoEx", xcontrol(GetControl(L"search")).GetText());
arg.AddArg(L"EntityID", EntityID);
//trace(GetControl(L"search").GetText());
diff --git a/jrj/project/business/AR/ExchageFile.cpp b/jrj/project/business/AR/ExchageFile.cpp
index 0824aad..f03cdd1 100644
--- a/jrj/project/business/AR/ExchageFile.cpp
+++ b/jrj/project/business/AR/ExchageFile.cpp
@@ -73,7 +73,7 @@
const xstring data;
int anchorrow;
int anchorcol;*/
- if (hdr.currentcol == 1 && hdr.data != L"")
+ if (hdr.col == 1 && hdr.data != L"")
{
//dw_exchangefile.SetItemString(hdr.currentrow,hdr.currentcol, L"");
}
diff --git a/jrj/project/business/AR/ExchageInput3.cpp b/jrj/project/business/AR/ExchageInput3.cpp
index 6b46415..02f0db0 100644
--- a/jrj/project/business/AR/ExchageInput3.cpp
+++ b/jrj/project/business/AR/ExchageInput3.cpp
@@ -18,7 +18,7 @@
xnode m_agentNode; //Agent Condition
xstring tabname;
xstring tabagent;
- int hSignWin;
+ HWND hSignWin;
///sale/data/AR/list
public:
@@ -147,7 +147,7 @@
int OnSign()
{
- OpenWindow(L"dev:xpage[ExchangeSignFast.vx]", cast(dw_list as int));
+ OpenWindow(L"dev:xpage[ExchangeSignFast.vx]", (WPARAM) & dw_list);
return 1;
}
@@ -272,8 +272,8 @@
else if (comdid == L"xmExchangeFile")
{
//if(iswindow(hSignWin) & 0x1) return 1;
- xwin xw = OpenWindow(L"dev:xpage[ExchageFile.vx]", 0);
- hSignWin = xw.GetHWND();
+ xwin* xw = OpenWindow(L"dev:xpage[ExchageFile.vx]", 0);
+ hSignWin = xw->GetHWND();
return 1;
}
else if (comdid == L"xmRefresh")
@@ -306,14 +306,14 @@
}
if (frow > dw_list.GetRowCount()) return 1;
dw_list.SetRow(frow);
- OpenWindow(L"dev:xpage[ExchangeSignFast.vx]", cast(dw_list as int));
+ OpenWindow(L"dev:xpage[ExchangeSignFast.vx]", (WPARAM)&dw_list);
return 1;
}
else if (comdid == L"xmAdd")
{
xaserverarg arg ;
- arg.AddArg(L"HWND", GetHWND());
+ arg.SetParam(L"HWND", GetHWND());
OpenWindow(L"dev:xpage[maint.SettlementExchange.vx]", arg);
}
@@ -321,7 +321,7 @@
{
xaserverarg arg1 ;
- arg1.AddArg(L"HWND", GetHWND().toString());
+ arg1.SetParam(L"HWND", GetHWND());
arg1.AddArg(L"SettlementExchangeID", dw_list.GetGuid(dw_list.GetRow()));
OpenWindow(L"dev:xpage[maint.SettlementExchange.vx]", arg1);
@@ -353,15 +353,15 @@
}
- int OnCombboChanged(ref TCommandEvent evt, int lParam)
+ int OnCombboChanged(TEvent* evt, int lParam)
{
xstring id = L"";
xstring name = L"";
- int h = xcombobox::GetCurSel(evt.hCtrl);
+ int h = xcombobox::GetCurSel(evt->command.hCtrl);
if (h > -1)
{
- tabname = xcombobox::GetItemData(evt.hCtrl, h);
- SwitchLayer(L"sheet" + (h + 1).toString(), L"frame");
+ tabname = xcombobox::GetItemData(evt->command.hCtrl, h);
+ SwitchLayer(L"sheet" + xstring(h + 1), L"frame");
RetrieveData();
SetAgent();
}
@@ -428,7 +428,7 @@
xaserverarg arg ;
arg.setNativePointer(arg.CreateInstance());
- arg.AddArg(L"QueryTxt", GetControl(L"sle_search").GetText());
+ arg.AddArg(L"QueryTxt", xcontrol(GetControl(L"sle_search")).GetText());
arg.AddArg(L"QueryArg", GetQueryArg());
//trace(L"QueryArg======L"+GetQueryArg());
if (getUrl(dataUrl, arg.GetString(), x) != 1)
diff --git a/jrj/project/business/AR/ExchangeSignFast.cpp b/jrj/project/business/AR/ExchangeSignFast.cpp
index 8084cea..1fae6e8 100644
--- a/jrj/project/business/AR/ExchangeSignFast.cpp
+++ b/jrj/project/business/AR/ExchangeSignFast.cpp
@@ -75,7 +75,7 @@
dw_list.DwUpdateAllToEx(x);
//trace(x.xml());
- xml x0 = ViewObject::MakeXml();
+ xml x0;
x0.loadXML(L"<data/>");
KXMLDOMNodeList t = x.selectNodes(L"data/Item[@update.modify or @update.delete]");
@@ -85,7 +85,7 @@
{
e1.appendChild(t.item(i));
}
- xaserverarg arg = ViewObject::MakeArg();
+ xaserverarg arg;
arg.AddArg(L"content", x0.xml());
if (xurl::get(L"/sale/data/AR/update/item", arg.GetString(), x) != 1)
@@ -127,14 +127,14 @@
return 0;
}
- int OnCombboChanged(ref TCommandEvent evt, int lParam)
+ int OnCombboChanged(TEvent * evt, int lParam)
{
xstring id = L"";
xstring name = L"";
- int h = xcombobox::GetCurSel(evt.hCtrl);
+ int h = xcombobox::GetCurSel(evt->command.hCtrl);
if (h > -1)
{
- xstring txt = xcombobox::GetLBText(evt.hCtrl, h);
+ xstring txt = xcombobox::GetLBText(evt->command.hCtrl, h);
if (txt == L"限定客户")
{
OnRetrieve(1);
@@ -152,7 +152,7 @@
dw_unexch.AcceptText();
int row = dw_unexch.GetRow();
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
double AdjustAmount = dw_unexch.GetItemDouble(row, L"AdjustAmount");//调整数
double amted = dw_unexch.GetItemDouble(row, L"实收汇金额");//往次
double samt = dw_unexch.GetItemDouble(row, L"应收汇金额");//应收汇金额
@@ -166,8 +166,8 @@
}
double amt1 = dw_obj.GetItemDouble(dw_obj.GetRow(), L"BalanceAmt");
- int v1 = (amt * 100.0).toString().toInt();
- int v2 = (amt1 * 100.0).toString().toInt();
+ int v1 = xstring(amt * 100.0).toInt();
+ int v2 = xstring(amt1 * 100.0).toInt();
if (v2 > v1)
{
dw_unexch.ItemChangeTo(row, L"Amount", xstring(amt));
@@ -348,9 +348,9 @@
xstring path1 = L"/sale/data/AR/item/exch/listwithcustomer";
if (customer == 0) path1 = L"/sale/data/AR/item/exch/list";
- arg.AddArg(L"QueryTxt", GetControl(L"sle_search").GetText());
+ arg.AddArg(L"QueryTxt", xcontrol(GetControl(L"sle_search")).GetText());
arg.AddArg(L"QueryArg", GetQueryArg());
- trace(L"SEID+++L" + SEID + L"+++QueryTxt+++L" + GetControl(L"sle_search").GetText() + L"+++QueryArg+++L" + GetQueryArg());
+ trace(L"SEID+++L" + SEID + L"+++QueryTxt+++L" + xcontrol(GetControl(L"sle_search")).GetText() + L"+++QueryArg+++L" + GetQueryArg());
if (getUrl(path, arg.GetString(), x) != 1)
{
trace(L"错误信息1=L" + xstring(x.text()));
@@ -406,7 +406,7 @@
/*xaserverarg arg = GetParam();
xstring CustomerIDOne = arg.GetArgString(L"CustomerID");
xstring SEIDOne = arg.GetArgString(L"SEID");*/
- if (GetWinParam())dw_obj = GetParam();
+ if (GetWinParam())dw_obj = *(xdwgrid*)GetWinParam();
OnAttachEvent();
return 1;
diff --git a/jrj/project/business/AR/maint.SettlementExchange.cpp b/jrj/project/business/AR/maint.SettlementExchange.cpp
index 9785b86..2bc9485 100644
--- a/jrj/project/business/AR/maint.SettlementExchange.cpp
+++ b/jrj/project/business/AR/maint.SettlementExchange.cpp
@@ -138,7 +138,7 @@
}
arg.AddArg(L"CustomerID", dw_base.GetItemString(1, L"CustomerID"));
arg.AddArg(L"SEID", dw_base.GetGuid(1));
- SendMessage(hObject, 0x401, L"xmSignEx:" + dw_base.GetGuid(1), 0);
+ SendMessage(hObject, 0x401, (WPARAM)((xstring)L"xmSignEx:" + dw_base.GetGuid(1)).c_str(), 0);
return 1;
}
@@ -215,7 +215,7 @@
{
xaserverarg arg =GetArg();
SettlementExchangeID = arg.GetArgString(L"SettlementExchangeID");
- hObject = arg.GetArgString(L"HWND").toInt();
+ hObject = (HWND)arg.GetParam(L"HWND");
}
if (SettlementExchangeID != L"")
{
diff --git a/jrj/project/business/Enquiry.list.cpp b/jrj/project/business/Enquiry.list.cpp
index f46437b..9e6968c 100644
--- a/jrj/project/business/Enquiry.list.cpp
+++ b/jrj/project/business/Enquiry.list.cpp
@@ -1,6 +1,7 @@
#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
+#include <xcontrol/xcheckbox.hpp>
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
@@ -60,7 +61,7 @@
if(agent)
{
xstring s = agent.xml();
- m_agentNode = SetAgentNodeContent (anode,s);
+ m_agentNode = SetAgentNode(anode,s);
}
//}
return 1;
@@ -131,7 +132,7 @@
}*/
tools +=L"</vbox>";
//trace(tools);
- SetAgentNodeContent(anode, tools);
+ SetAgentNode(anode, tools);
return 1;
}
@@ -295,7 +296,6 @@
alert(L"淇濆瓨澶辫触!");
}
}
- if(x) x.Free();
return 1;
}
@@ -309,7 +309,7 @@
xstring Subject = L"浠锋牸鍗曞凡鍏变韩["+CName+L"]";
xstring Category = L"浠锋牸鍗曞叡浜�";
xstring Content = L"";
- KXMLDOMDocument x = ViewObject::AddMessage(Category, Reciever, NO, EntityID, Subject, Content);
+ ViewObject::AddMessage(Category, Reciever, NO, EntityID, Subject, Content);
return 1;
}
int SendNotice(xml content)
@@ -390,16 +390,14 @@
dw_pricelist.DwUpdateAllToEx(x0);
if(x0.xml() !=L"")
{
- xml x1 = xml::Make();
+ xml x1;
dw_priceitem.DwUpdateAllToEx(x1);
if(x0.documentElement())
{
if(x1.documentElement())
x0.documentElement().appendChild(x1.documentElement());
}
- x1.Free();
arg.AddArg(L"content", x0.xml() );
- x0.Free();
if(xurl::get(L"/sale/data/Enquiry/update/pricelist", arg.GetString(),x)!=1)
{
error = x.text();
@@ -440,13 +438,11 @@
alert(L"淇濆瓨鎴愬姛!");
OnProductPriceShareRetrieve();//鍒锋柊鏁版嵁
SendNotice(x2);//鍙戦�侀�氱煡
- x2.Free();
}else
{
alert(L"鍏变韩鏁版嵁淇濆瓨澶辫触!");
}
}
- x.Free();
return 1;
}
@@ -495,11 +491,11 @@
int OnPreRetrieve()
{
- int hItem = tv_folder.GetSelectedItem();
+ HTREEITEM hItem = tv_folder.GetSelectedItem();
if(hItem <=0) return 1;
- int hCursor = xutil::SetCursorWait();
- KXMLDOMElement e1 = cast(tv_folder.GetItemData(hItem) as KXMLDOMElement);
+ HCURSOR hCursor = xutil::SetCursorWait();
+ KXMLDOMElement e1 = tv_folder.GetItemData(hItem);
xstring no = e1.getAttribute(L"no");
xml x = 0;
if(!(no ==L"Category:All" && IsEmptyQueryStr(m_QueryTxt)))
@@ -510,9 +506,9 @@
dw_list.Redraw();
}else
{
- dw_list.ResetEx();
+ dw_list.Reset();
dw_list.Redraw();
- dw_goods.ResetEx();
+ dw_goods.Reset();
dw_goods.Redraw();
}
@@ -524,9 +520,9 @@
dw_list2.Redraw();
}else
{
- dw_list2.ResetEx();
+ dw_list2.Reset();
dw_list2.Redraw();
- dw_goods2.ResetEx();
+ dw_goods2.Reset();
dw_goods2.Redraw();
}
@@ -536,9 +532,9 @@
dw_list1.Redraw();
}else
{
- dw_list1.ResetEx();
+ dw_list1.Reset();
dw_list1.Redraw();
- dw_goods1.ResetEx();
+ dw_goods1.Reset();
dw_goods1.Redraw();
}
x = ViewObject::RetrieveData(myDataUrl1,L"no",no,L"QueryTxt", m_QueryTxt);
@@ -548,9 +544,9 @@
dw_list1.Redraw();
}else
{
- dw_list1.ResetEx();
+ dw_list1.Reset();
dw_list1.Redraw();
- dw_goods1.ResetEx();
+ dw_goods1.Reset();
dw_goods1.Redraw();
}
dw_list1.SetReadOnly(true);
@@ -568,29 +564,25 @@
if(row>0)
{
KXMLDOMElement e =dw_list.GetRowElement(row);
- xaserverarg arg=new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
xstring sCustomerID = e.selectSingleNode(L"CustomerID").text();
arg.AddArg(L"CustomerID",sCustomerID,L"");
xstring sCustomerName = e.selectSingleNode(L"CustomerName").text();
arg.AddArg(L"CustomerName",sCustomerName,L"");
arg.AddArg(L"EntityName",GetEntityName(1),L"");
arg.AddArg(L"EntityID",GetEntityID(1),L"");
- int p = arg.ptr_native_;
- openUrl(L"/sale/view/Enquiry3/xpage/histroydata", p);
+ openUrl(L"/sale/view/Enquiry3/xpage/histroydata", &arg);
}
return 1;
}
int OnPrint()
{
- xaserverarg arg=new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
arg.AddArg(L"EntityName",L"Enquiry",L"");
arg.AddArg(L"EntityID",GetEntityID(1),L"");
arg.AddArg(L"EntityNo",GetEntityNo(1),L"");
- int p = arg.ptr_native_;
- openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", p);
+ openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", &arg);
return 0;
}
@@ -598,15 +590,14 @@
{
dw_priceitem.Reset();
- xaserverarg arg = xaserverarg::Make();
+ xaserverarg arg;
arg.AddArg(L"action",L"AddPriceList");
- OpenWindow(L"dev:xpage[ProductSchemaSelect.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[ProductSchemaSelect.vx]",arg);
if(arg.GetArgString(L"process") == L"ok")
{
- xml
- x.setNativePointer(xml::CreateInstance());
+ xml x;
if (getUrl(L"/sale/data/Enquiry/PriceListEx/SKU",arg.GetString(),x)!=1) return 1;
KXMLDOMNodeList nodes = x.selectNodes(L"data/Item");
int len = nodes.length();
@@ -634,13 +625,8 @@
}
KXMLDOMNodeList items = ele.selectNodes(L"data/Item");
AddItems(id,items);
- items.Release();
- ele.Release();
}
- x.Free();
- nodes.Release();
}
- arg.Free();
//OnRetrieveItem(dw_pricelist.GetGuid(row));
return 1;
}
@@ -652,9 +638,8 @@
dw_priceitem.Reset();
- xaserverarg arg = xaserverarg::Make();
- xml
- x.setNativePointer(xml::CreateInstance());
+ xaserverarg arg ;
+ xml x;
arg.AddArg(L"SKUID",dw_pricelist.GetItemString(row,L"SKUID"));
arg.AddArg(L"SchemaNo",dw_pricelist.GetItemString(row,L"BOMSchema"));
if (getUrl(L"/sale/data/Enquiry/PriceListEx/SKU",arg.GetString(),x)!=1) return 1;
@@ -683,12 +668,7 @@
}
KXMLDOMNodeList items = ele.selectNodes(L"data/Item");
AddItems(id,items);
- items.Release();
- ele.Release();
}
- nodes.Release();
- x.Free();
- arg.Free();
//OnRetrieveItem(dw_pricelist.GetGuid(row));
return 1;
@@ -727,11 +707,10 @@
if(dw_pricelist.GetRow() < 1) return 1;
int row = dw_pricelist.GetRow();
- xaserverarg arg= new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
arg.AddArg(L"SKUID",dw_pricelist.GetItemString(row,L"SKUID"));
arg.AddArg(L"SchemaNo",dw_pricelist.GetItemString(row,L"BOMSchema"));
- OpenWindow(L"dev:xpage[PriceList.PurcharItemSelect.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[PriceList.PurcharItemSelect.vx]",arg);
xstring id = dw_pricelist.GetGuid(dw_pricelist.GetRow());
if(id==L"")
{
@@ -741,11 +720,10 @@
if(arg.GetArgString(L"process")==L"ok")
{
xstring content = arg.GetArgString(L"result");
- xml x = xml::Make();
- x.LoadXml(content);
+ xml x;
+ x.loadXML(content);
KXMLDOMNodeList nodes = x.selectNodes(L"data/Item");
AddItems(id,nodes);
- nodes.Release();
xstring PriceInfo = L"";
for(int i=1;i<=dw_pricelist.GetRowCount();i++)
{
@@ -787,14 +765,14 @@
return 1;
}
- int OnRowChanged(ref TNotifyEvent evt,int p)
+ int OnRowChanged(TEvent* evt,LPARAM p)
{
listwin::OnRowChanged(evt,p);
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
int row = hdr.row;
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
xstring EnquiryNo = dw_list.GetItemString(row,L"EnquiryNo");
xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/maint",L"id",EnquiryNo);
if(x)
@@ -807,12 +785,12 @@
return 1;
}
- int OnRowChanged2(ref TNotifyEvent evt,int p)
+ int OnRowChanged2(TEvent* evt,LPARAM p)
{
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
int row = hdr.row;
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
xstring EnquiryNo = dw_list2.GetItemString(row,L"EnquiryNo");
xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/maint",L"id",EnquiryNo);
if(x)
@@ -826,18 +804,18 @@
return 1;
}
- int OnRowChanged1(ref TNotifyEvent evt,int p)
+ int OnRowChanged1(TEvent* evt, LPARAM p)
{
//fixed one event only one process
//listwin::OnRowChanged(evt,p);
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
int row = hdr.row;
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
xstring ItemID = dw_list1.GetItemString(row,L"ItemID");
//alert(ItemID);
- xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",state2.toString());
+ xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",xstring(state2));
if(x)
dw_goods1.Retrieve(x);
else
@@ -851,20 +829,19 @@
int OnShare()
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
- OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",arg);
if(arg.GetArgString(L"process")==L"ok")
{
xdwgrid dw_obj = dw_pricelistex;
if(sheetname==L"tab_pricebillex") dw_obj = dw_pricelist;
sheetname=L"tab_pricebillshare";
- SetAgent(L"list");
+ xframe::SetAgent(L"list");
SwitchLayer(L"sheet5",L"frame");
- xml x = xml::Make();
- x.LoadXml(arg.GetArgString(L"result"));
+ xml x;
+ x.loadXML(arg.GetArgString(L"result"));
KXMLDOMNodeList nodes = x.selectNodes(L"root/item");
int count = nodes.length();
int row = dw_obj.GetNextSelectRow(1);
@@ -915,26 +892,23 @@
int OnShare2()
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg ;
- OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",arg);
return 1;
}
int OnTransPriceBillEx()
{
- xaserverarg arg= new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
arg.AddArg(L"no",L"Category:All");
arg.AddArg(L"QueryTxt",L"");
- OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",arg);
if(arg.GetArgString(L"process") == L"ok")
{
- xml
- x.setNativePointer(xml::CreateInstance());
- x.LoadXml(arg.GetArgString(L"result"));
+ xml x;
+ x.loadXML(arg.GetArgString(L"result"));
KXMLDOMNodeList nodes = x.selectNodes(L"data/Item");
int len = nodes.length();
for(int i=0; i<len;i++)
@@ -973,24 +947,20 @@
if(ele.selectSingleNode(L"EnquiryLineID")) dw_pricelistex.SetItemString(row,L"EnquiryLineID",ele.selectSingleNode(L"EnquiryLineID").text());
ele.Release();
}
- x.Free();
- nodes.Release();
}
return 1;
}
int OnTransPriceBill()
{
- xaserverarg arg= new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
arg.AddArg(L"no",L"Category:All");
arg.AddArg(L"QueryTxt",L"");
- OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",cast(arg as int));
+ OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",arg);
if(arg.GetArgString(L"process") == L"ok")
{
- xml
- x.setNativePointer(xml::CreateInstance());
- x.LoadXml(arg.GetArgString(L"result"));
+ xml x;
+ x.loadXML(arg.GetArgString(L"result"));
KXMLDOMNodeList nodes = x.selectNodes(L"data/Item");
int len = nodes.length();
for(int i=0; i<len;i++)
@@ -1047,21 +1017,18 @@
//items.Release();
ele.Release();
}
- x.Free();
- nodes.Release();
}
return 1;
}
int OnTech(xdwgrid dw_term)
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
int row = dw_term.GetRow();
if(row < 1) return 0;
xstring str = dw_term.GetItemString(row,L"TechNote");
arg.AddArg(L"value",str);
- OpenWindow(L"dev:xpage[memo.edit.new.vx]",arg.getNativePointer());
+ OpenWindow(L"dev:xpage[memo.edit.new.vx]",arg);
if(arg.GetArgString(L"comdid")==L"xmOK")
{
str = arg.GetArgString(L"value");
@@ -1074,8 +1041,7 @@
int OnCopy()
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg ;
int row = dw_pricelistex.GetRow();
if(row < 1) return 0;
@@ -1105,15 +1071,13 @@
arg.AddArg(L"PayTerm",PayTerm);
arg.AddArg(L"CustomerContactName",CustomerContactName);
arg.AddArg(L"ContactTel",ContactTel);
- int pa = arg.getNativePointer();
- openUrl(L"/sale/view/Enquiry3/xpage/maint", pa);
+ openUrl(L"/sale/view/Enquiry3/xpage/maint", &arg);
return 1;
}
int OnGroupCopy()
{
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg ;
int row = dw_priceitem.GetRow();
int row1 = dw_pricelist.GetRow();
if(row < 1) return 0;
@@ -1146,8 +1110,7 @@
arg.AddArg(L"ContactTel",ContactTel);
- int pa = arg.getNativePointer();
- openUrl(L"/sale/view/Enquiry3/xpage/maint", pa);
+ openUrl(L"/sale/view/Enquiry3/xpage/maint", &arg);
return 1;
}
@@ -1174,7 +1137,7 @@
if(comdid==L"tab_pricebill")
{
sheetname=L"tab_pricebill";
- SetAgent(L"list");
+ xframe::SetAgent(L"list");
SwitchLayer(L"tv_folder_pricebill",L"folder_frame");
if(dw_pricelistex.GetRowCount() < 1) OnProductPriceBillRetrieve();
@@ -1183,7 +1146,7 @@
else if(comdid==L"tab_pricebillex")
{
sheetname=L"tab_pricebillex";
- SetAgent(L"list");
+ xframe::SetAgent(L"list");
SwitchLayer(L"tv_folder_pricebill",L"folder_frame");
if(dw_pricelist.GetRowCount() < 1) OnPriceBillRetrieve();
return 0;
@@ -1191,7 +1154,7 @@
{
dw_list = GetControl(L"dw_list2");
sheetname = L"tab_list2";
- SetAgent(L"list");
+ xframe::SetAgent(L"list");
}
else if(comdid.left(4)==L"tab_")
@@ -1206,7 +1169,7 @@
else
SwitchLayer(L"tv_folder",L"folder_frame");
sheetname=comdid;
- SetAgent(L"list");
+ xframe::SetAgent(L"list");
return 0;
}
@@ -1253,7 +1216,7 @@
xml supplier_x = ViewObject::RetrieveData(L"/sale/data/SupplierV3/entity/FindBySaleType",L"id", s);
if(supplier_x)
{
- if(supplier_x.text == L"閲囪喘缁忕悊")
+ if((xstring)supplier_x.text() == L"閲囪喘缁忕悊")
{
alert(L"褰撳墠瑙掕壊涓嶆槸閲囪喘鍛樹笉鑳芥柊澧炲崟瀛愶紝璇烽噸鏂伴�夋嫨瑙掕壊");
return 0;
@@ -1319,17 +1282,17 @@
}
//xcombobox涓嬫媺
- int OnSelectDdlb(ref TNotifyEvent evt,int p)
+ int OnSelectDdlb(TEvent* evt,int p)
{
changeddlb=1;
- int wid = ddlb_1.GetId();
+ HWND wid = ddlb_1.GetHWND();
int CB_GETCURSEL = 0x0147;
- int nIndex = win32::SendMessage(wid,CB_GETCURSEL,0,0);
+ int nIndex = SendMessage(wid,CB_GETCURSEL,0,0);
KXMLDOMElement e = ddlb_1.GetElement();
- KXMLDOMElement e2 = e.selectSingleNode(L"item["+(nIndex+1).toString()+L"]");
+ KXMLDOMElement e2 = e.selectSingleNode(L"item["+xstring(nIndex+1)+L"]");
xstring no=e2.selectSingleNode(L"@element").text();
- int hItem = tv_folder.GetRootItem();
+ HTREEITEM hItem = tv_folder.GetRootItem();
while(tv_folder.GetChildItem(hItem))
tv_folder.DeleteItem(tv_folder.GetChildItem(hItem));
ExpandFolderItem(tv_folder,hItem, no);
@@ -1339,25 +1302,25 @@
}
- int OnCkbCLick(ref TEvent evt,int p)
+ int OnCkbCLick(TEvent* evt,int p)
{
xcheckbox cbx_1 = GetControl(L"cbx1");
- int state=cbx_1.GetCheck(cbx_1.GetId());
- if(evt.lParam == GetControl(L"cbx1").GetId())
+ int state=cbx_1.GetCheck(cbx_1.GetHWND());
+ if(evt->lParam == (LPARAM)GetControl(L"cbx1")->GetHWND())
{
if (state== -1)
SwitchLayer(L"sheet1",L"frame");
else
SwitchLayer(L"sheet2",L"frame");
return 1;
- }else if(evt.lParam == GetControl(L"cbx2").GetId())
+ }else if(evt->lParam == (LPARAM)GetControl(L"cbx2")->GetHWND())
{
cbx_1 = GetControl(L"cbx2");
- state=cbx_1.GetCheck(cbx_1.GetId());
- int hCursor = xutil::SetCursorWait();
+ state=cbx_1.GetCheck(cbx_1.GetHWND());
+ HCURSOR hCursor = xutil::SetCursorWait();
xstring ItemID = dw_list1.GetItemString(dw_list1.GetRow(),L"ItemID");
- xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",state.toString());
+ xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",xstring(state));
if(x)
dw_goods1.Retrieve(x);
else
@@ -1370,21 +1333,21 @@
}
}
- int OnPriceListRowChanged(ref TNotifyEvent evt,int p)
+ int OnPriceListRowChanged(TEvent* evt,LPARAM p)
{
- ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR);
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
int row = hdr.row;
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
OnRetrieveItem(dw_pricelist.GetGuid(row));
return 1;
}
- int OnItemAskStyle(ref TNotifyEvent evt,int p)
+ int OnItemAskStyle(TEvent* evt,LPARAM p)
{
int DMS_CSSSTYLE = 0x8;
- ref DWASKSTYLENMHDR hdr = trust(evt.pnmh as ref DWASKSTYLENMHDR);
+ DWASKSTYLENMHDR& hdr = *(DWASKSTYLENMHDR*)evt->notify.pnmh;
int row = hdr.row;
int col = hdr.col;
xstring colname = hdr.colname;
@@ -1402,14 +1365,14 @@
if(days < 0)
{
hdr.mask = DMS_CSSSTYLE;
- hdr.cssstyle = L"color:#cccccc";
+ hdr.pCssStyle = (LPTSTR)L"color:#cccccc";
}
}
return 1;
}
int OnFilter()
{
- xstring str = GetControl(L"sl_search").GetText();
+ xstring str = xcontrol(GetControl(L"sl_search")).GetText();
xdwgrid dw_obj;
if(sheetname==L"tab_goods") dw_obj = dw_list1;
else if(sheetname==L"tab_pricebill") dw_obj = dw_pricelistex;
@@ -1420,53 +1383,51 @@
return 1;
}
- int OnPriceListDoubleClicked(ref TNotifyEvent evt,int p)
+ int OnPriceListDoubleClicked(TEvent* evt, LPARAM pr)
{
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
int row = dw_pricelistex.GetRow();
if(row > 0) OnTech(dw_pricelistex);
xutil::RestoreCursor(hCursor);
return 1;
}
- int OnDoubleClicked(ref TNotifyEvent evt,int p)
+ int OnDoubleClicked(TEvent* evt, LPARAM)
{
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
int row = dw_list2.GetRow();
- xaserverarg arg=new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xaserverarg arg;
xstring EnquiryNo = dw_list2.GetItemString(row,L"EnquiryNo");
arg.AddArg(L"EnquiryNo",EnquiryNo);
- int pa = arg.getNativePointer();
- openUrl(L"/sale/view/Enquiry3/xpage/maint", pa);
+ openUrl(L"/sale/view/Enquiry3/xpage/maint",&arg);
xutil::RestoreCursor(hCursor);
return 1;
}
- int OnDoubleClicked(ref TNotifyEvent evt,int p)
+ int OnDoubleClicked(TEvent* evt, LPARAM pr)
{
- int hCursor = xutil::SetCursorWait();
+ HCURSOR hCursor = xutil::SetCursorWait();
OnCmdDispatch(L"action:bill.open");
xutil::RestoreCursor(hCursor);
return 1;
}
- int AttachEvent()
+ int AttachListon()
{
- AttachEvent(L"tv_folder", L"TVN_SELCHANGED",OnTreeSelChanged); //鏍戦�夋嫨
- AttachEvent(L"tv_folder", L"TVN_ITEMEXPANDING",OnTreeExpanding); //鏍戝睍寮�
- AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED",OnRowChanged);
- AttachEvent(L"dw_list2",L"DWV_ROWFOCUSCHANGED",OnRowChanged2);
- AttachEvent(L"dw_list1",L"DWV_ROWFOCUSCHANGED",OnRowChanged1);
- AttachEvent(L"cbx_1",L"CBN_SELCHANGE",OnSelectDdlb);
- AttachEvent(L"WM_COMMAND",OnCkbCLick);
- AttachEvent(L"dw_list",L"DWV_ASKSTYLE",OnItemAskStyle);
- AttachEvent(L"dw_pricelist",L"DWV_ROWFOCUSCHANGED",OnPriceListRowChanged);
- AttachEvent(L"tv_folder_pricebill", L"TVN_SELCHANGED",OnPriceBillTreeSelChanged); //鏍戦�夋嫨
- AttachEvent(L"tv_folder_pricebill", L"TVN_ITEMEXPANDING",OnPriceBillTreeExpanding);
+ AttachEvent(L"tv_folder", L"TVN_SELCHANGED",(FEvent)&Enquiry3list::OnTreeSelChanged); //鏍戦�夋嫨
+ AttachEvent(L"tv_folder", L"TVN_ITEMEXPANDING", (FEvent)&Enquiry3list::OnTreeExpanding); //鏍戝睍寮�
+ AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged);
+ AttachEvent(L"dw_list2",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged2);
+ AttachEvent(L"dw_list1",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged1);
+ AttachEvent(L"cbx_1",L"CBN_SELCHANGE", (FEvent)&Enquiry3list::OnSelectDdlb);
+ AttachEvent(L"WM_COMMAND", (FEvent)&Enquiry3list::OnCkbCLick);
+ AttachEvent(L"dw_list",L"DWV_ASKSTYLE", (FEvent)&Enquiry3list::OnItemAskStyle);
+ AttachEvent(L"dw_pricelist",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnPriceListRowChanged);
+ AttachEvent(L"tv_folder_pricebill", L"TVN_SELCHANGED", (FEvent)&Enquiry3list::OnPriceBillTreeSelChanged); //鏍戦�夋嫨
+ AttachEvent(L"tv_folder_pricebill", L"TVN_ITEMEXPANDING", (FEvent)&Enquiry3list::OnPriceBillTreeExpanding);
- AttachEvent(L"dw_pricelistex",L"DWV_DOUBLECLICKED",OnPriceListDoubleClicked);
- AttachEvent(L"dw_list2",L"DWV_DOUBLECLICKED",OnDoubleClicked);
+ AttachEvent(L"dw_pricelistex",L"DWV_DOUBLECLICKED", (FEvent)&Enquiry3list::OnPriceListDoubleClicked);
+ AttachEvent(L"dw_list2",L"DWV_DOUBLECLICKED", (FEvent)&Enquiry3list::OnDoubleClicked);
return 1;
}
@@ -1475,10 +1436,8 @@
int OnRetrieveItem(xstring EnquiryPriceListID)
{
- xml
- x.setNativePointer(xml::CreateInstance());
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xml x;
+ xaserverarg arg ;
arg.AddArg(L"EnquiryPriceListID",EnquiryPriceListID);
if (getUrl(L"/sale/data/Enquiry/fetch/PriceList/item",arg.GetString(),x)!=1)
{
@@ -1495,14 +1454,12 @@
int OnPriceBillRetrieve()
{
- int hItem = tv_folder_pricebill.GetSelectedItem();
- KXMLDOMElement e1 = cast(tv_folder_pricebill.GetItemData(hItem) as KXMLDOMElement);
+ HTREEITEM hItem = tv_folder_pricebill.GetSelectedItem();
+ KXMLDOMElement e1 = tv_folder_pricebill.GetItemData(hItem);
xstring no = e1.getAttribute(L"no");
- xml
- x.setNativePointer(xml::CreateInstance());
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xml x;
+ xaserverarg arg;
arg.AddArg(L"no",no);
if (getUrl(L"/sale/data/Enquiry/fetch/PriceList",arg.GetString(),x)!=1)
{
@@ -1525,14 +1482,12 @@
int OnProductPriceBillRetrieve()
{
- int hItem = tv_folder_pricebill.GetSelectedItem();
- KXMLDOMElement e1 = cast(tv_folder_pricebill.GetItemData(hItem) as KXMLDOMElement);
+ HTREEITEM hItem = tv_folder_pricebill.GetSelectedItem();
+ KXMLDOMElement e1 = tv_folder_pricebill.GetItemData(hItem);
xstring no = e1.getAttribute(L"no");
- xml
- x.setNativePointer(xml::CreateInstance());
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xml x;
+ xaserverarg arg ;
arg.AddArg(L"no",no);
if (getUrl(L"/sale/data/Enquiry/ProductPriceList/nobom",arg.GetString(),x)!=1)
{
@@ -1550,10 +1505,8 @@
int OnProductPriceShareRetrieve()
{
- xml
- x.setNativePointer(xml::CreateInstance());
- xaserverarg arg = new xaserverarg;
- arg.setNativePointer(arg.CreateInstance());
+ xml x;
+ xaserverarg arg ;
if (getUrl(L"/sale/data/Enquiry/ProductPriceList/share",arg.GetString(),x)!=1)
{
trace(x.text());
@@ -1669,7 +1622,7 @@
{
listwin::onloaded();
- AttachEvent();
+ AttachListon();
dw_list.SetColumnState(L"EnquiryID",false);
dw_list.SetColumnState(L"Days",false);
@@ -1683,7 +1636,7 @@
OnProductPriceShareRetrieve();
- int hItem = tv_folder.GetRootItem();
+ HTREEITEM hItem = tv_folder.GetRootItem();
tv_folder.ExpandItem(hItem);
tv_folder.ItemFocus(hItem);
@@ -1708,7 +1661,7 @@
int ProcessUsedArg(xaserverarg arg)
{
- int hItem = tv_folder.GetCaretItem();
+ HTREEITEM hItem = tv_folder.GetCaretItem();
arg.AddArg(L"sheetname",sheetname);
if(hItem > 0)
{
diff --git a/jrj/project/start.vframe.vbusiness.cpp b/jrj/project/start.vframe.vbusiness.cpp
index 9ac9f36..f43f0a7 100644
--- a/jrj/project/start.vframe.vbusiness.cpp
+++ b/jrj/project/start.vframe.vbusiness.cpp
@@ -4,111 +4,978 @@
#include "wobject/xstring.hpp"
#include "wobject/xurl.hpp"
#include "xcontrol/xshtml.hpp"
+#include "vbusiness/vframe/frame.vframe.vbusiness.hpp"
+#include "viewobject/view.base.hpp"
+#include "xcontrol/xshtml.hpp"
-class __declspec(dllexport) startvframevbusiness: public xwin
+using xml = Hxsoft::XFrame::KXMLDOMDocument;
+
+class __declspec(dllexport) startvframevbusiness : public xframe
{
public:
- xreport dw_list;
+ xreport dw_list;
public:
- startvframevbusiness(void* implPtr,HWND hWnd):xwin(implPtr,hWnd){}
+ startvframevbusiness(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
public:
- static startvframevbusiness * CreateInstance(void* implPtr,void* hWnd)
+ static startvframevbusiness* CreateInstance(void* implPtr, void* hWnd)
{
- return new startvframevbusiness(implPtr,(HWND)hWnd);
+ return new startvframevbusiness(implPtr, (HWND)hWnd);
}
-public:
- int OnCmdDispatch(const wchar_t* comd)
+
+ int init()
{
- //alert(comd);
- return 0;
- }
-
- int OnXCommand(TEvent* evt,int p)
- {
- return OnCmdDispatch(evt->xcommand.pStrID);
- }
+ xaserverarg arg;
+ KXMLDOMDocument doc;
+ if (xurl::get(GetServerUrl(), L"/sale/data/vpage/vstart/list", arg.GetString(), doc) != 1)
+ {
+ alert(((xstring)L"error:" + doc.xml()).c_str());
+ return 0;
+ }
+ if (!doc.xml()) return 0;
- int ShowDetail(int row)
- {
- if(row<0 || row>dw_list.GetRowCount()) return 1;
- if(!dw_list.GetRowElement(row)) return 1;
-
- Hxsoft::XFrame::KXMLDOMElement ele = dw_list. GetRowElement(row);
- //alert(ele.xml());
- dw_list.SetRow(row);
+ dw_list.Retrieve(doc);
+ dw_list.CreateTree((LPCWSTR)L"node()", 1, 15, 16);
- string EntityID=ele.getAttribute(L"EntityID");
-
- if(!EntityID || !EntityID[0]) return -1;
- //SetAgent("letter",GetEntityID(1));
-
- xaserverarg arg;
- arg.AddArg(L"content",ele.xml());
- Hxsoft::XFrame::KXMLDOMDocument doc;
- if(xurl::get(GetServerUrl(),L"/sale/data/vpage/vstart/task",arg.GetString(),doc)!=1)
- {
- alert(((xstring)L"error:"+doc.xml()).c_str());
- return 0;
- }
- //alert(doc.xml());
- xshtml ht(GetControl(L"taskinfo"));
- ht.SetContent(doc.xml());
- ht.Redraw();
-
- return 1;
- }
-
- //#include <tchar.h>
- int OnClicked(TEvent* evt,int p)
- {
- DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
- int row = hdr->row;
-
- if(row<1 || row>dw_list.GetRowCount()) return 1;
-
- ShowDetail(row);
- //SetAgent();
-
- return 1;
- }
-
- int init()
- {
- xaserverarg arg;
- KXMLDOMDocument doc;
- if(xurl::get(GetServerUrl(),L"/sale/data/vpage/vstart/list",arg.GetString(),doc)!=1)
- {
- alert(((xstring)L"error:"+doc.xml()).c_str());
- return 0;
- }
- if(!doc.xml()) return 0;
-
- dw_list.Retrieve(doc);
- dw_list.CreateTree((LPCWSTR)L"node()", 1, 15, 16);
-
- /*
- dw_list.Redraw();
- dw_list.SetReadOnly(true);
- */
- return 1;
- }
-
- int OnAttachListon()
- {
- AttachEvent(L"WM_XCOMMAND",(FEvent)&startvframevbusiness::OnXCommand,this);
- AttachEvent(L"tasklist",L"DWV_CLICKED",(FEvent)&startvframevbusiness::OnClicked,this);
- //AttachEvent("mdilayer", "LYSN_SELECTEDSHEET",OnSheetChanged);
- ////AttachEvent("mdilayer", "LYSN_CLOSESHEET",OnCloseSheet);
+ /*
+ dw_list.Redraw();
+ dw_list.SetReadOnly(true);
+ */
return 1;
}
-
+
+ xstring GetEntityIDName(LPARAM pr)
+ {
+ return L"@EntityID";
+ }
+
+ xstring GetEntityName(LPARAM pr)
+ {
+ int nRow = dw_list.GetRow();
+ if (nRow < 0) return L"";
+ KXMLDOMElement ele = dw_list.GetRowElement(nRow);
+ xstring x = ele.getAttribute(L"category");
+ return x;
+ }
+
+ xstring GetEntityID(LPARAM pr)
+ {
+ int row = dw_list.GetRow();
+ if (row<1 || row>dw_list.GetRowCount()) return 0;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ if (!ele) return L"";
+ xstring id = GetEntityIDName(pr);
+ if (!ele.selectSingleNode(id)) return L"";
+ xstring d = ele.selectSingleNode(id).text();
+ return d;
+ }
+
+ xstring GetTaskID()
+ {
+ int row = dw_list.GetRow();
+ if (row<1 || row>dw_list.GetRowCount()) return 0;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ if (!ele) return L"";
+ xstring taskid = ele.getAttribute(L"taskid");
+ return taskid;
+ }
+
+ xstring GetReason(LPARAM pr, xstring comd)
+ {
+ xaserverarg arg;
+
+ if (GetEntityName(pr) == L"DeliveryDelay")
+ {
+ xstring ls_cmdid = comd;//pr;
+ int row = dw_list.GetRow();
+ if (row < 1) return 1;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ xstring ls_status = ele.selectSingleNode(L"@status").text();
+ if (ls_status == L"货源部待确认" && ls_cmdid == L"action:bill.check.agree")
+ {
+ arg.AddArg(L"DDID", GetEntityID(2));
+ arg.AddArg(L"_ModuelPage", L"dev:xpage[DeliveryDelay.supmancheck.vx]");
+ OpenWindow(L"dev:xpage[vindexforold.vx]", arg);
+ //openUrl(L"/sale/view/DeliveryDelay/xpage/DeliveryDelay/supmancheck", arg);
+ if (arg.GetArgString(L"ret") == L"Sucess")
+ {
+ return L"Auto...";
+ }
+ return L"";
+ }
+ else
+ {
+ //return frame::GetReason(pr);
+ arg.AddArg(L"EntityID", GetEntityID(2));
+ arg.AddArg(L"_ModuelPage", L"dev:xpage[workflow.chkdlg.vx]");
+ OpenWindow(L"dev:xpage[vindexforold.vx]", arg);
+ //int newArg2 = arg.ptr_native_;
+ //openUrl(L"/sale/view/workflow.view/xpage/chkdlg_vd", newArg2);
+ xstring comdid = arg.GetArgString(L"comdid");
+ if (comdid == L"xmOK")
+ {
+ xstring value = arg.GetArgString(L"content") + L" ";
+ return value;
+ }
+ return L"";
+ }
+ }
+ else
+ {
+ //return frame::GetReason(pr);
+ arg.AddArg(L"EntityID", GetEntityID(2));
+ arg.AddArg(L"_ModuelPage", L"dev:xpage[workflow.chkdlg.vx]");
+ OpenWindow(L"dev:xpage[vindexforold.vx]", arg);
+ //openUrl(L"/sale/view/workflow.view/xpage/chkdlg", arg);
+ xstring comdid2 = arg.GetArgString(L"comdid");
+ if (comdid2 == L"xmOK")
+ {
+ xstring value2 = arg.GetArgString(L"content") + L" ";
+ return value2;
+ }
+ return L"";
+
+ }
+ }
+
+ int ViewUpdate(LPARAM pr, xstring updateItem, xaserverarg arg)
+ {
+ init();
+ return 1;
+ }
+
+ xstring GetEntityWorkNode(LPARAM pr, xstring what)
+ {
+ if (what == L"open")
+ {
+ int row = dw_list.GetRow();
+ if (row<0 || row>dw_list.GetRowCount()) return 0;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ xstring aurl = ele.selectSingleNode(L"@url").text();
+ return aurl;
+ }
+ return L"";
+ }
+
+
+ int SetAgent()
+ {
+ if (dw_list)
+ {
+ //init();
+ xstring id = GetEntityID(1);
+ if (id != L"") xframe::SetAgent((xstring)L"letter", id);
+ }
+ return 1;
+ }
+
+
+ int openUrl(xstring aurl, /*param */ LPARAM para)
+ {
+ //alert(aurl);
+ xml x;
+
+ xurl::get(aurl, L"", x);
+ KXMLDOMDocument doc = x;
+ KXMLDOMNode n = doc.selectSingleNode(L"//resource/@src");
+ //alert(x.xml());
+ if (n)
+ {
+ /*
+ xstring xq = n.text();
+ OpenWindow(xq, para);
+ return 1;
+ */
+
+ xstring xq = n.text();
+ if (doc.selectSingleNode(L"//resource/@argnative"))
+ {
+ OpenWindow(xq, para);
+ }
+
+ //alert(xq);
+ else if (xq.find(L"upplier", 0) > 0 and xq != L"dev:xpage[Maint.SupplierStatusModify.vx]" and xq != L"dev:xpage[Maint.SupplierSubmit.vx]")
+ OpenWindow(xq, para);
+ else
+ {
+ xq = xq.replace(L"dev:xpage[", L"");
+ xq = xq.replace(L"]", L"");
+ xaserverarg args;
+ args.AddArg(L"_ModuelPage", xq);
+ //alert(args.GetString());
+ OpenWindow(L"dev:xpage[vindexforold.vx]", args);
+ }
+ return 1;
+ }
+ else
+ {
+ xaserverarg arg;
+ n = doc.selectSingleNode(L"//resource[@vface!='' and @view!='']");
+ if (n)
+ {
+ xstring vface = n.selectSingleNode(L"@vface").text();
+ xstring view = n.selectSingleNode(L"@view").text();
+ xstring config = n.selectSingleNode(L"@config").text();
+ if (config != L"")
+ {
+ arg.AddArg(L"config", config, L"xs:xstring");
+ }
+ if (vface == L"." || vface == L"")
+ {
+ xstring v = n.selectSingleNode(L"@url").text();
+ xstring burl = aurl.mid(0, aurl.find(v, 0));
+ //alert(burl);
+ return openUrl(burl + view, arg);
+ }
+ else
+ return openUrl(vface + L"/" + view, arg);
+ }
+ }
+ return -1;
+ }
+
+ int SetTaskProcessed()
+ {
+ int row = dw_list.GetRow();
+ if (row<0 || row>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row)) return 1;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+
+ xaserverarg arg;
+
+ xstring taskid = ele.getAttribute(L"taskid");
+ arg.AddArg(L"TaskID", taskid);
+ xml x = ViewObject::RetrieveData(L"/sale/data/business/update/taskprocessed", L"TaskID", taskid);
+ if (x) alert(x.text());
+ dw_list.DeleteRow(row);
+
+ return 1;
+ }
+ int ProcessFlowAction(xstring comdid, LPARAM pr1)
+ {
+ if (comdid == L"__ModifyRows")
+ {
+ OnModifyRows();
+ return 1;
+ }
+
+ int pr = pr1;
+ xstring action = comdid.mid(comdid.find(L"action:", 0) + 7, 9999);
+ if (action == L"bill.delete" || action == L"bill.deleteEx")
+ {
+ if (MessageBox(GetHWND(), L"是否确定删除记录!", L"提示", 1) == 2)
+ return 1;
+ }
+
+ if (action == L"bill.processed")
+ {
+ if (MessageBox(GetHWND(), L"是否确定选中的任务转已处理?", L"提示", 1) == 2)
+ return 1;
+ return SetTaskProcessed();
+ }
+
+ xaserverarg arg;
+
+ arg.AddArg(L"Action", action, L"xs:xstring");
+ xml x;
+
+
+ xstring aurl = L"/workflow/query/actioninfo/" + action;
+
+ if (xurl::get(aurl, L"", x) != 1)
+ return -1;
+
+ int nlen;
+ int i = 0;
+ xstring name;
+ xstring worknode;
+ xstring how;
+ xstring state = L"";
+ xstring billstatus = L"";
+ KXMLDOMElement e;
+
+ arg.AddArg(L"EntityName", GetEntityName(pr), L"xs:xstring");
+ //参数要求
+ KXMLDOMNodeList nlist = x.selectNodes(L"//params/param");
+ nlen = nlist.length();
+
+ for (i = 0; i < nlen; i++)
+ {
+ e = nlist.item(i);
+ name = e.selectSingleNode(L"@name").text();
+ how = e.selectSingleNode(L"@how").text();
+
+ xstring content = L"";
+ if (how == L"Entity" || how == L"EntityData")
+ {
+ content = GetEntityData(pr);
+ }
+ if (e.selectSingleNode(L"@valid"))
+ {
+ if (content.find(L"update.modify", 0) > 0 || content.find(L"update.delete", 0) > 0) {}
+ else return 0;
+ if (CheckEntityValidity(pr) < 0) return -1;
+ }
+ if (how == L"EntityID")
+ arg.AddArg(name, GetEntityID(pr), L"xs:xstring");
+ else if (how == L"Entity" || how == L"EntityData")
+ arg.AddArg(name, content, L"xs:xstring");
+ else if (how == L"EntityRowData")
+ arg.AddArg(name, GetEntityRowData(pr), L"xs:xstring");
+ else if (how == L"Reason")
+ {
+ arg.AddArg(name, GetReason(1, L""), L"xs:xstring");
+ }
+ else if (how == L"EntityNo")
+ arg.AddArg(name, GetEntityNo(pr), L"xs:xstring");
+ else if (how == L"EntityTitle")
+ arg.AddArg(name, GetEntityTitle(pr), L"xs:xstring");
+ else if (how == L"GetParam")
+ arg.AddArg(name, GetParamValue(name), L"xs:xstring");
+ else if (how == L"UserID")
+ arg.AddArg(name, xaserver::GetUserId(), L"xs:xstring");
+ //"CHeckAskMsg"
+ //"CHeckMsg
+ if (how == L"Reason" && arg.GetArgString(name) == L"") return -1;
+ //if(how==L"EntityData" && arg.GetArgString(name)==L"") return -1;
+ if (e.selectSingleNode(L"@check"))
+ {
+
+ xstring doCheck = e.selectSingleNode(L"@check").text();
+ if (doCheck == L"Y")
+ {
+ xstring value = arg.GetArgString(name);
+ if (value == L"")
+ {
+ alert(name + L" 参数值不能为空,事件终止!");
+ return -1;
+ }
+ }
+ }
+ }
+
+ arg.AddArg(L"action.entity", GetEntityName(pr), L"xs:xstring");
+ ProcessUsedArg(arg);
+ //动作
+ KXMLDOMNode n = x.selectSingleNode(L"//view.action[1]");
+
+ bool execResult = true; //处理结果
+ if (n)
+ {
+ name = n.selectSingleNode(L"@name").text();
+ if (n.selectSingleNode(L"@worknode"))
+ worknode = n.selectSingleNode(L"@worknode").text();
+ else
+ worknode = GetEntityWorkNode(pr, name);
+ arg.AddArg(L"do", name, L"xs:xstring");
+ if (worknode != L"")
+ {
+ if (worknode.find(L"dev:xpage") == 0)
+ OpenWindow(worknode, arg);
+ else
+ openUrl(worknode, arg); //---openUrl(worknode,arg);
+ }
+ else
+ {
+ alert(L"Warn: Please configure worknode for action " + name + L".");
+ return -1;
+ }
+ }
+ else
+ {
+ //url::post(GetEntityName(pr)+L"/workflow/action",arg.GetString(),x);
+ xml x1;
+ int retxx = xurl::post(L"/workflow/action/" + GetEntityName(pr) + L"/" + action, arg.GetString(), x1);
+
+ //alert(L"/workflow/action/"+GetEntityName(pr)+L"/"+action+L"\r\n"+arg.GetString()+L"\r\n"+x1.xml());
+
+ if (retxx != 1) execResult = false;
+ if (x1.selectSingleNode(L"//process"))
+ {
+ KXMLDOMElement e1 = x1.selectSingleNode(L"//process");
+ xstring valid = e1.getAttribute(L"valid");
+ xstring finished = e1.getAttribute(L"finished");
+ xstring errInfo = L"";
+ if (valid == L"0")
+ {
+ errInfo = e1.getAttribute(L"errInfo");
+ alert(errInfo);
+ execResult = false;
+ }
+ else if (finished == L"0")
+ {
+ errInfo = e1.getAttribute(L"errInfo");
+ errInfo = L"处理失败!\r\n" + errInfo;
+ alert(errInfo);
+ execResult = false;
+ }
+ }
+ else if (x1.selectSingleNode(L"//process-check-list"))
+ {
+ KXMLDOMElement e2 = x1.selectSingleNode(L"//process-check-list");
+ xstring val = e2.getAttribute(L"process");
+ if (val == L"ok")
+ {
+ alert(L"处理成功");
+ PostMessage(GetHWND(), 0x401, (WPARAM)L"action:bill.refresh", 0);
+ }
+ else if (val == L"part")
+ {
+ alert(L"有部分数据处理未成功,提交成功的已处理。");
+ PostMessage(GetHWND(), 0x401, (WPARAM)L"action:bill.refresh", 0);
+ }
+ else
+ alert((xstring)L"数据处理不成功\r\n" + x1.xml());
+ return 1;
+ }
+ else if (x1.selectSingleNode(L"//msg"))
+ {
+ xstring aStr = x1.selectSingleNode(L"//msg[1]").text();
+ //if(aStr.find(L"理成功",0) < 0)
+ // alert(aStr);
+ if (aStr.find(L"失败", 0) >= 0)
+ execResult = false;
+ alert(aStr);
+ }
+ if (x1.selectSingleNode(L"//msg/@state"))
+ {
+ state = x1.selectSingleNode(L"//msg[1]/@state").text();
+ arg.AddArg(L"state", state, L"xs:xstring");
+ billstatus = x1.selectSingleNode(L"//msg[1]/@billstatus").text();
+ arg.AddArg(L"billstatus", billstatus, L"xs:xstring");
+ }
+ }
+ //更新要求
+ if (execResult)
+ {
+ nlist = x.selectNodes(L"//view/update");
+ nlen = nlist.length();
+ for (i = 0; i < nlen; i++)
+ {
+ e = nlist.item(i);
+ how = e.selectSingleNode(L"@do").text();
+ if (how == L"setstate")
+ {
+ if (state != L"")
+ {
+ arg.AddArg(L"state", state, L"xs:xstring");
+ arg.AddArg(L"billstatus", billstatus, L"xs:xstring");
+ ViewUpdate(pr, how, arg);
+
+ }
+ }
+ else
+ ViewUpdate(pr, how, arg);
+ }
+ }
+
+
+ return 1;
+ }
+
+
+ /*int ProcessFlowAction(xstring comdid, int pr1)
+ {
+ //trace(L"comdid---> %s\r\n", comdid);
+ if(comdid == L"__ModifyRows")
+ {
+ OnModifyRows();
+ return 1;
+ }
+
+ int pr = pr1;
+ xstring action = comdid.mid(comdid.find(L"action:",0)+7,9999);
+ if(action == L"bill.delete" || action == L"bill.deleteEx")
+ {
+ if (MessageBox(GetHWND(),L"是否确定删除记录!",L"提示1",1) == 2)
+ return 1;
+ }
+
+ xaserverarg arg = new xaserverarg ;
+
+ arg.AddArg(L"Action", action,L"xs:xstring");
+ xml x ;
+ x.setNativePointer(xml ::CreateInstance());
+
+ xstring aurl = L"/workflow/query/actioninfo/"+action;
+ //trace(L"abc---",aurl);
+
+ if(xurl::get(aurl, L"", x) != 1)
+ return -1;
+ //alert(x.xml());
+ int nlen ;
+ int i = 0;
+ xstring name;
+ xstring worknode;
+ xstring how;
+ xstring state;
+ KXMLDOMElement e;
+
+ arg.AddArg(L"EntityName", GetEntityName(pr),L"xs:xstring");
+ //参数要求
+ KXMLDOMNodeList nlist = x.selectNodes(L"//params/param");
+ nlen = nlist.length;
+
+ //trace(L"xxx");
+ for(i=0; i<nlen; i++)
+ {
+ //trace(L"yyy");
+ e = nlist.item(i);
+ //trace(e.xml);
+ name = e.selectSingleNode(L"@name").text();
+ how = e.selectSingleNode(L"@how").text();
+ //trace(how);
+ //trace(name);
+ xstring content = L"";
+ if(how==L"Entity" || how == L"EntityData")
+ content = GetEntityData(pr);
+ if(e.selectSingleNode(L"@valid"))
+ {
+ if(content.find(L"update.modify", 0) > 0 || content.find(L"update.delete",0) > 0) {} else return 0;
+ if(CheckEntityValidity(pr) < 0) return -1;
+ }
+ if(how==L"EntityID")
+ arg.AddArg(name, GetEntityID(pr),L"xs:xstring");
+ else if(how==L"Entity" || how == L"EntityData")
+ arg.AddArg(name, content,L"xs:xstring");
+ else if(how==L"EntityRowData")
+ arg.AddArg(name, GetEntityRowData(pr),L"xs:xstring");
+ else if(how==L"Reason")
+ arg.AddArg(name, GetReason(pr, comdid),L"xs:xstring");
+ else if(how==L"EntityNo")
+ arg.AddArg(name, GetEntityNo(pr),L"xs:xstring");
+ else if(how==L"EntityTitle")
+ arg.AddArg(name, GetEntityTitle(pr),L"xs:xstring");
+ else if(how==L"GetParam")
+ arg.AddArg(name, GetParamValue(name),L"xs:xstring");
+ else if(how==L"UserID")
+ arg.AddArg(name, xaserver::GetUserId(),L"xs:xstring");
+ //"CHeckAskMsg"
+ //"CHeckMsg
+ //trace(arg.GetString());
+ //trace(arg.GetArgString(name));
+ if(how==L"Reason" && arg.GetArgString(name)==L"") return -1;
+ //trace(L"cky1");
+ //if(how==L"EntityData" && arg.GetArgString(name)==L"") return -1;
+ if(e.selectSingleNode(L"@check"))
+ {
+
+ xstring doCheck = e.selectSingleNode(L"@check").text();
+ if(doCheck == L"Y")
+ {
+ xstring value = arg.GetArgString(name);
+ if(value == L"")
+ {
+ alert(name + L" 参数值不能为空,事件终止!");
+ return -1;
+ }
+ }
+ }
+ }
+
+ arg.AddArg(L"action.entity",GetEntityName(pr),L"xs:xstring");
+ //trace(L"zzz");
+ //trace(arg.GetString());
+ //动作
+ KXMLDOMNode n = x.selectSingleNode(L"//view.action[1]");
+ //trace(x.xml());
+ bool execResult = true; //处理结果
+
+ if(n)
+ {
+ name = n.selectSingleNode(L"@name").text();
+ if(n.selectSingleNode(L"@worknode"))
+ worknode = n.selectSingleNode(L"@worknode").text();
+ else
+ worknode = GetEntityWorkNode(pr,name);
+ arg.AddArg(L"do",name,L"xs:xstring");
+ if(worknode !=L"")
+ {
+ //trace(L"do:"+worknode);
+ int p = arg.ptr_native_;
+ openUrl(worknode,p); //---openUrl(worknode,arg);
+ }
+ else
+ {
+ alert(L"Warn: Please configure worknode for action "+ name +L".");
+ return -1;
+ }
+ }
+ else
+ {
+ //url::post(GetEntityName(pr)+L"/workflow/action",arg.GetString(),x);
+ //trace(L"/workflow/action/"+GetEntityName(pr)+L"/"+action);
+ //trace(L"=====L");
+ //trace(arg.GetString());
+ xml x1 ;
+ x1.setNativePointer(xml::CreateInstance());
+ int retxx = url::post(L"/workflow/action/"+GetEntityName(pr)+L"/"+action,arg.GetString(),x1);
+ if(retxx != 1) execResult = false;
+ //trace(x1.xml());
+ if(x1.selectSingleNode(L"//msg"))
+ {
+ xstring aStr = L""+x1.selectSingleNode(L"//msg[1]").text();
+ if(aStr.find(L"理成功",0) < 0)
+ alert(aStr);
+ if(aStr.find(L"失败",0) >= 0)
+ execResult = false;
+ trace(aStr);
+ }
+ if(x1.selectSingleNode(L"//msg/@state"))
+ {
+ state = x1.selectSingleNode(L"//msg[1]/@state").text();
+ arg.AddArg(L"state",state,L"xs:xstring");
+ }
+ }
+ //更新要求
+ if(execResult)
+ {
+ nlist = x.selectNodes(L"//view/update");
+ nlen = nlist.length;
+ for(i=0; i<nlen; i++)
+ {
+ e = nlist.item(i);
+ how = e.selectSingleNode(L"@do").text();
+ //trace(how+L"444"+state);
+ if(how==L"setstate")
+ {
+ if(state != L"")
+ {
+ arg.AddArg(L"state",state,L"xs:xstring");
+ ViewUpdate(pr,how,arg);
+
+ }
+ }
+ else
+ ViewUpdate(pr,how,arg);
+ }
+ }
+
+
+ return 1;
+ } */
+
+ int BillPurchor()
+ {
+ int row1 = dw_list.GetRow();
+ if (row1<0 || row1>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row1)) return 1;
+ KXMLDOMElement ele1 = dw_list.GetRowElement(row1);
+ xstring id1 = GetEntityIDName(1);
+ xstring d1 = ele1.selectSingleNode(id1).text();
+ xstring name1 = GetEntityName(row1);
+
+ xaserverarg arg1;
+ xstring templ = ele1.getAttribute(L"content2");
+ xstring taskid = ele1.getAttribute(L"taskid");
+ arg1.AddArg(L"template", templ);
+ arg1.AddArg(L"TaskID", taskid);
+ arg1.AddArg(L"EntityID", d1);
+ arg1.AddArg(L"bill.purchor", L"1");
+
+ OpenWindow(L"dev:xpage[QuoteFile.vx]", arg1);
+
+ return 1;
+ }
+
+ //命令发布函数
+ int OnCmdDispatch(xstring comdid)
+ {
+ //alert(comdid);
+ xstring userno = publiccode::GetUser().no;
+
+ if (comdid == L"action:bill.purchor") return BillPurchor();
+ if (comdid == L"action:bill.check.agree")
+ {
+ int row3 = dw_list.GetRow();
+ if (row3<0 || row3>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row3)) return 1;
+ KXMLDOMElement ele3 = dw_list.GetRowElement(row3);
+ xstring id3 = GetEntityIDName(1);
+ xstring d3 = ele3.selectSingleNode(id3).text();
+ xstring name3 = GetEntityName(row3);
+
+ if (name3 == L"SaleItem3")
+ {
+ xml x3;
+ xaserverarg arg3;
+ arg3.AddArg(L"SOLineID", d3);
+ if (getUrl(L"/sale/data/SaleOrder/UpdateSOLineTypeExS", arg3.GetString(), x3) != 1)
+ {
+ xstring error3 = x3.text();
+ alert(L"err:" + error3);
+ return 1;
+ }
+ ProcessFlowAction(L"action:bill.check.agree", 1);
+ return 1;
+ }
+ }
+ if (userno == L"00601" || userno == L"00701" || userno == L"admin")
+ {
+ if (comdid == L"SourceRemark")
+ {
+ OnSourceRemark();
+ return 1;
+ }
+ }
+ if (comdid == L"action:bill.check.agreeEx")
+ {
+ int row2 = dw_list.GetRow();
+ if (row2<0 || row2>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row2)) return 1;
+ KXMLDOMElement ele2 = dw_list.GetRowElement(row2);
+ xstring id2 = GetEntityIDName(1);
+ xstring d2 = ele2.selectSingleNode(id2).text();
+ xstring name2 = GetEntityName(row2);
+
+ if (name2 == L"SaleItem3")
+ {
+ if (MessageBox(GetHWND(), L"是否确认 工厂付款?", L"提示1", 1) == 2)
+ return 1;
+
+ xml x5;
+ xaserverarg arg5;
+ arg5.AddArg(L"SOLineID", d2);
+ if (getUrl(L"/sale/data/SaleOrder/UpdateSOLineTypeEx", arg5.GetString(), x5) != 1)
+ {
+ xstring error = x5.text();
+ alert(L"err:" + error);
+ return 1;
+ }
+ alert(x5.text());
+ ProcessFlowAction(L"action:bill.check.agree", 1);
+ return 1;
+ }
+ }
+
+ if (comdid && comdid.find(L"hand!", 0) == 0)
+ {
+ if (comdid == L"hand!toleft")
+ {
+ ProcessFlowAction(L"action:bill.check.unagree", 1);
+ return 1;
+ }
+ if (comdid == L"hand!toright")
+ {
+ ProcessFlowAction(L"action:bill.check.agree", 1);
+ return 1;
+ }
+ if (comdid == L"hand!toupright")
+ {
+ int row = dw_list.GetRow();
+ if (row<0 || row>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row)) return 1;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ xstring id = GetEntityIDName(1);
+ xstring d = ele.selectSingleNode(id).text();
+ if (d == L"") return 1;
+ ProcessFlowAction(L"action:bill.open", 1);
+ return 1;
+ }
+ if (comdid == L"hand!round")
+ {
+ ProcessFlowAction(L"action:bill.note", 1);
+ return 1;
+ }
+
+ }
+ if (comdid == L"xmIconNotifyClicked")
+ {
+ //OpenWindow(L"dev:xpage[/]",0);
+ init();
+ return 1;
+ }
+ if (comdid == L"xmRefresh" || comdid == L"xmRefreshTask")
+ {
+ init();
+ return 1;
+ }
+ if (ProcessFlowAction(comdid, 1) == 0) return 0;
+ if (comdid == L"action:bill.open")
+ {
+ int row1 = dw_list.GetRow();
+ if (row1<0 || row1>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row1)) return 1;
+ KXMLDOMElement ele1 = dw_list.GetRowElement(row1);
+ xstring id1 = GetEntityIDName(1);
+ xstring d1 = ele1.selectSingleNode(id1).text();
+ xstring name1 = GetEntityName(row1);
+
+ if (name1 == L"QuoteEnquiry")
+ {
+ xaserverarg arg1;
+ xstring templ = ele1.getAttribute(L"content2");
+ xstring taskid = ele1.getAttribute(L"taskid");
+ arg1.AddArg(L"template", templ);
+ arg1.AddArg(L"TaskID", taskid);
+ arg1.AddArg(L"EntityID", d1);
+
+ OpenWindow(L"dev:xpage[QuoteFile.vx]", arg1);
+ return 1;
+ }
+ if (name1 == L"SampleFee")
+ {
+ xaserverarg arg;
+
+ arg.AddArg(L"SampleFeeID", d1);
+ //arg.AddArg(L"HWND",GetHWND().toString());
+ OpenWindow(L"dev:xpage[maint.samplefee.vx]", arg);
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+ int OnSourceRemark()
+ {
+ xstring name = L"事务处理";
+ xml x = ViewObject::RetrieveData(L"/sale/data/TradeFinance3/GetSetUpRemarks", L"Type", name);
+ KXMLDOMNodeList items = x.selectNodes(L"data/Item");
+ KXMLDOMNode t = items.item(0);
+ xstring Content = L"";
+ if (t.selectSingleNode(L"Content"))
+ {
+ Content = t.selectSingleNode(L"Content").text();
+ }
+ xaserverarg arg1;
+ arg1.AddArg(L"value", Content);
+ OpenWindow(L"dev:xpage[memo.edit.new.vx]", arg1);
+
+ return 1;
+ }
+
+ int OnDoubleClicked(TEvent* evt, LPARAM p)
+ {
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+ int row = hdr.row;
+ if (row<0 || row>dw_list.GetRowCount()) return 1;
+ if (!dw_list.GetRowElement(row)) return 1;
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ xstring id = GetEntityIDName(1);
+ xstring d = ele.selectSingleNode(id).text();
+ if (d == L"") return 1;
+
+ xstring name1 = GetEntityName(1);
+ if (name1 == L"QuoteEnquiry")
+ {
+ xaserverarg arg1;
+ xstring templ = ele.getAttribute(L"content2");
+ xstring taskid = ele.getAttribute(L"taskid");
+ //trace(templ);
+ arg1.AddArg(L"template", templ);
+ arg1.AddArg(L"TaskID", taskid);
+ arg1.AddArg(L"EntityID", d);
+
+ OpenWindow(L"dev:xpage[QuoteFile.vx]", arg1);
+ return 1;
+ }
+
+ ProcessFlowAction(L"action:bill.open", 1);
+ return 1;
+ }
+
+ //焦点激活处理函数
+ int OnSetFocus(TEvent* evt, LPARAM param)
+ {
+ SetAgent();
+ //重置工具条
+ return 1;
+ }
+
+ //命令处理事件
+ int OnXCommand(TEvent* evt, LPARAM p)
+ {
+ return OnCmdDispatch(evt->xcommand.pStrID);
+ }
+
+ int ShowDetail(int row)
+ {
+
+ if (row<0 || row>dw_list.GetRowCount()) return 1;
+
+ if (!dw_list.GetRowElement(row)) return 1;
+
+
+
+ KXMLDOMElement ele = dw_list.GetRowElement(row);
+ trace((xstring)L"\r\n====113======L" + ele.xml());
+ dw_list.SetRow(row);
+ if (GetEntityID(1) == L"") return -1;
+ xframe::SetAgent((xstring)L"letter", GetEntityID(1));
+
+ //trace(ele.xml);
+ xaserverarg arg;
+
+ arg.AddArg(L"content", ele.xml());
+ xml doc;
+
+ if (getUrl(L"/sale/data/vpage/vstart/task", arg.GetString(), doc) != 1)
+ {
+ trace((xstring)L"error->:" + doc.xml());
+ return 0;
+ }
+ //trace(L"----1111----");
+ if (doc.xml() == L"")
+ return -1;
+
+ //trace(doc.xml());
+
+ xshtml ht = GetControl(L"taskinfo");
+ ht.SetContent(doc.xml());
+ ht.Redraw();
+ return 1;
+ }
+
+ int OnClicked(TEvent* evt, LPARAM p)
+ {
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+ int row = hdr.row;
+
+ trace(L"count:" + (xstring)dw_list.GetRowCount());
+ if (row<1 || row>dw_list.GetRowCount()) return 1;
+
+ trace(L"\r\n-------" + (xstring)row);
+
+ ShowDetail(row);
+ SetAgent();
+
+ return 1;
+ }
+
+ int OnRowChanged(TEvent* evt, LPARAM p)
+ {
+ DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+ int row = hdr.row;
+ if (row<0 || row>dw_list.GetRowCount()) return 0;
+ trace(L"\r\n-----222------");
+ ShowDetail(row);
+ SetAgent();
+
+ return 1;
+ }
+
int onload()
- {
- dw_list = GetControl(L"tasklist");
- init();
+ {
+ //alert(L"xxxxxxxxxxx");
+ //SetAgent();
+ AttachEvent(L"WM_SETFOCUS", (FEvent)&startvframevbusiness::OnSetFocus);
+ //绑定工具条点击事件
+ AttachEvent(L"WM_XCOMMAND", (FEvent)&startvframevbusiness::OnXCommand);
+ //AttachEvent(L"WM_TIMER",OnTimer);
+ AttachEvent(L"tasklist", L"DWV_ROWFOCUSCHANGED", (FEvent)&startvframevbusiness::OnRowChanged);
+ AttachEvent(L"tasklist", L"DWV_DOUBLECLICKED", (FEvent)&startvframevbusiness::OnDoubleClicked);
+ AttachEvent(L"tasklist", L"DWV_CLICKED", (FEvent)&startvframevbusiness::OnClicked);
- OnAttachListon();
+ dw_list = GetControl(L"tasklist");
+ init();
+
+ SetAgent();
+
+ return 1;
+ }
+
+ int onloaded()
+ {
return 1;
}
};
@@ -116,3 +983,4 @@
+
diff --git a/jrj/project/total3/ViewTotalWin.cpp b/jrj/project/total3/ViewTotalWin.cpp
index cfd1126..e8e4699 100644
--- a/jrj/project/total3/ViewTotalWin.cpp
+++ b/jrj/project/total3/ViewTotalWin.cpp
@@ -193,7 +193,7 @@
xstring colname = dw.GetColumnName(i);
if (str.find(L"!" + colname + L",L") >= 0)
{
- dw.SetColumnState(colname, false);
+ dw.SetColumnState((LPCTSTR)colname.c_str(), false);
}
}
return 1;
@@ -391,6 +391,8 @@
AttachEvent(L"dw_report", L"DWV_CLICKED", (FEvent)&ViewTotalWin::OnDWClick);
AttachEvent(L"dw_report", L"DWV_ROWFOCUSCHANGED", (FEvent)&ViewTotalWin::OnRowChanged);//绑定行更改触发事件OnRowChanged
AttachEvent(L"dw_report", xstring(0x400 + 81), (FEvent)&ViewTotalWin::OnRetrieveFinished);
+
+ return 1;
}
int OnRetrieve(xstring dataurl, xstring argstr)
diff --git a/jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp b/jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp
index e2d61f9..9b6f92d 100644
--- a/jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp
+++ b/jrj/xframe/vbusiness/vframe/frame.vframe.vbusiness.hpp
@@ -337,7 +337,7 @@
}
}
//更新要求
- if (execResult & 0xf)
+ if (execResult)
{
nlist = x.selectNodes(L"//view/update");
nlen = nlist.length();
@@ -384,7 +384,7 @@
return 1;
}
- virtual string GetTaskID()
+ virtual xstring GetTaskID()
{
return L"";
}
diff --git a/jrj/xframe/xcontrol/xcombobox.hpp b/jrj/xframe/xcontrol/xcombobox.hpp
index 4b7cafd..c831a1e 100644
--- a/jrj/xframe/xcontrol/xcombobox.hpp
+++ b/jrj/xframe/xcontrol/xcombobox.hpp
@@ -16,11 +16,6 @@
return *this;
}
public:
- static int GetCurSel(HWND hWnd)
- {
- int CB_GETCURSEL_ = 0x0147;
- return SendMessage(hWnd, CB_GETCURSEL_, 0, 0);
- }
int GetCurSel()
{
--
Gitblit v1.9.3