From 61f1fc38bb7c290ccace616b7df4609a8b82a73b Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期五, 06 九月 2024 13:52:36 +0800
Subject: [PATCH] update viewupdate

---
 jrj/project/business/SO3.maint.cpp |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/jrj/project/business/SO3.maint.cpp b/jrj/project/business/SO3.maint.cpp
index 5bb3ca6..3132a61 100644
--- a/jrj/project/business/SO3.maint.cpp
+++ b/jrj/project/business/SO3.maint.cpp
@@ -9,6 +9,11 @@
 #include "viewobject/saleorder.view.hpp"
 #include "viewobject/quote.view.hpp"
 
+#include "jstring.hpp"
+#include "JFactory.hpp"
+#include "jobjectsvr.hpp"
+#include <memory>
+#include "JPtr.hpp"
 class __declspec(dllexport) BaseMaintSOWin : public maint
 {
 	xdwtable dw_props;
@@ -223,17 +228,34 @@
 		xstring colname = hdr->colname;
 		if (value == L"支付条款")
 		{
-			//int  p1 = vc.xdoc.getNativePointer();
-			//openUrl(L"/sale/view/SaleOrder/xpage/payment", p1);
+			xaserverarg arg;
+			xml x;
+			dw_base.DwUpdateAllTo(x);
+			arg.SetArg(L"content", x.xml());
+			openUrl(L"/sale/view/SaleOrder/xpage/payment", (LPARAM)arg);
+			if (arg.GetArgString(L"process") == L"ok")
+			{
+				x.loadXML(arg.GetArgString(L"content"));
+				dw_base.Retrieve(x);
+			}
 			dw_base.AcceptText();
+			dw_base.Redraw();
 			return 1;
 		}
 
 		//交货期维护
 		if (value == L"交货期")
 		{
-			//int p2 = vc.xdoc.getNativePointer();
-			//openUrl(L"/sale/view/SaleOrder/xpage/delivery1", p2);
+			xaserverarg arg;
+			xml x;
+			dw_base.DwUpdateAllTo(x);
+			arg.SetArg(L"content", x.xml());
+			openUrl(L"/sale/view/SaleOrder/xpage/delivery1", (LPARAM)arg);
+			if (arg.GetArgString(L"process") == L"ok")
+			{
+				x.loadXML(arg.GetArgString(L"content"));
+				dw_base.Retrieve(x);
+			}
 			dw_base.AcceptText();
 			dw_base.Redraw();
 			return 1;
@@ -939,8 +961,16 @@
 		return 1;
 	}
 
+
 	int onload()
 	{
+		/*
+		using JFString = JFactory<JString>;
+		JPtr<JFString> jfString(JObjectSvr::CreateInstance<JFString>(L"JFactoryString"));
+		//auto jfString = JObjectSvr::CreateInstance<JFString>(L"JFactoryString");
+		JPtr<JString> pStr(jfString->make());
+		*/
+
 		dw_props = GetControl(L"dw_props");
 		/*KXMLDOMDocument x = SaleOrderView::GetMaintFormForBase();
 		dw_props.SetDataObject(x);
@@ -1010,12 +1040,14 @@
 		if (SONo != L"")
 		{
 			KXMLDOMDocument x = SaleOrderView::GetMaintDataForBase(SONo);
+			BSTR str = (BSTR)x.xml();
 			dw_base.Retrieve(x);
 			dw_item.Retrieve(x);
 		}
 		else
 		{
 			KXMLDOMDocument x = ViewObject::RetrieveData(GetServerUrl(),L"/sale/data/SaleOrder/newinitial");
+			BSTR str = (BSTR)x.xml(); 
 			dw_base.Retrieve(x);
 
 			xstring sdate = publiccode::GetCurrentDate();

--
Gitblit v1.9.3