From 46bf65da8237cb34a62bbe0d6d4b8ba2bb2dc7b1 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 25 六月 2024 17:22:52 +0800
Subject: [PATCH] update product

---
 jrj/project/business/Product.list.cpp |   50 +++++++---------
 jrj/project/business/Quote3.maint.cpp |    0 
 jrj/xframe/xcontrol/xdwgrid.hpp       |   67 ++++------------------
 jrj/project/viewobject/view.base.hpp  |    6 +-
 4 files changed, 38 insertions(+), 85 deletions(-)

diff --git a/jrj/project/business/Product.list.cpp b/jrj/project/business/Product.list.cpp
index 89e9de7..e8c86e3 100644
--- a/jrj/project/business/Product.list.cpp
+++ b/jrj/project/business/Product.list.cpp
@@ -514,7 +514,7 @@
 	xstring Up(xstring name) {
 		xstring str = name.mid(0, 2);
 		str = str.toUpper();
-		return xaserver::UploadFile(L"product" + str, name + L".jpg", this.GetHWND(), L"", false);
+		return xaserver::UploadFile(L"product" + str, name + L".jpg", GetHWND(), L"", false);
 	}
 
 	int OnAddImage() {
@@ -542,9 +542,8 @@
 			ext = L"jpg";
 
 		// 图片名加入数据库
-		xml x = new xml;
-		x.setNativePointer(xml::CreateInstance());
-		x.LoadXml(L"<Item update.new='1' update.modify='1' guid='" + id + L"'>" +
+		xml x ;
+		x.loadXML(L"<Item update.new='1' update.modify='1' guid='" + id + L"'>" +
 			"<ProductPictureID>" + id + L"</ProductPictureID>" +
 			"<OriginFile>" + originfile + L"</OriginFile>" +
 			"<FileExt>" + ext + L"</FileExt>" +
@@ -554,12 +553,11 @@
 			"</Item>"
 		);
 
-		xaserverarg arg = new xaserverarg;
-		arg.setNativePointer(arg.CreateInstance());
-		arg.AddArg(L"content", x.GetXml());
-		if (url::get(L"/sale/data/ProductLibrary/image/update", arg.GetString(), x) != 1)
+		xaserverarg arg;
+		arg.AddArg(L"content", x.xml());
+		if (xurl::get(L"/sale/data/ProductLibrary/image/update", arg.GetString(), x) != 1)
 		{
-			alert(x.text);
+			alert(x.text());
 			return -1;
 		}
 		dw_list.SetItemString(row, L"pic", L"*");
@@ -595,26 +593,24 @@
 			ext = L"jpg";
 
 		// 图片名加入数据库
-		xml x = new xml;
-		x.setNativePointer(xml::CreateInstance());
-		x.LoadXml(L"<Item update.new='1' update.modify='1' guid='" + id + L"'>" +
-			"<ProductPictureID>" + id + L"</ProductPictureID>" +
-			"<OriginFile>" + originfile + L"</OriginFile>" +
-			"<FileExt>" + ext + L"</FileExt>" +
-			"<SKUID>" + skuid + L"</SKUID>" +
-			"<CustomerItemNo>" + CustomerItemNo + L"</CustomerItemNo>" +
-			"<CustomerID>" + CustomerID + L"</CustomerID>" +
-			"<Name>[" + SKUNo.trim() + L"]</Name>" +
-			"<FileName>" + id + L".jpg</FileName>" +
-			"</Item>"
+		xml x;
+		x.loadXML(L"<Item update.new='1' update.modify='1' guid='" + id + L"'>" +
+			L"<ProductPictureID>" + id + L"</ProductPictureID>" +
+			L"<OriginFile>" + originfile + L"</OriginFile>" +
+			L"<FileExt>" + ext + L"</FileExt>" +
+			L"<SKUID>" + skuid + L"</SKUID>" +
+			L"<CustomerItemNo>" + CustomerItemNo + L"</CustomerItemNo>" +
+			L"<CustomerID>" + CustomerID + L"</CustomerID>" +
+			L"<Name>[" + SKUNo.trim() + L"]</Name>" +
+			L"<FileName>" + id + L".jpg</FileName>" +
+			L"</Item>"
 		);
 
-		xaserverarg arg = new xaserverarg;
-		arg.setNativePointer(arg.CreateInstance());
-		arg.AddArg(L"content", x.GetXml());
-		if (url::get(L"/sale/data/ProductLibrary/image/update", arg.GetString(), x) != 1)
+		xaserverarg arg;
+		arg.AddArg(L"content", x.xml());
+		if (xurl::get(L"/sale/data/ProductLibrary/image/update", arg.GetString(), x) != 1)
 		{
-			alert(x.text);
+			alert(x.text());
 			return -1;
 		}
 		dwc_list.SetItemString(row, L"pic", L"*");
@@ -637,7 +633,7 @@
 		if (count < 1) return 1;
 
 		KXMLDOMNodeList images = imageElement.selectNodes(L"image");
-		int length = images.length;
+		int length = images.length();
 		if (length < index) return 1;
 
 		int MB_OKCANCEL = 0x00000001;
diff --git a/jrj/project/business/Quote3.maint.cpp b/jrj/project/business/Quote3.maint.cpp
index 6224c43..49f28d5 100644
--- a/jrj/project/business/Quote3.maint.cpp
+++ b/jrj/project/business/Quote3.maint.cpp
Binary files differ
diff --git a/jrj/project/viewobject/view.base.hpp b/jrj/project/viewobject/view.base.hpp
index 86e0944..b93cc53 100644
--- a/jrj/project/viewobject/view.base.hpp
+++ b/jrj/project/viewobject/view.base.hpp
@@ -41,13 +41,13 @@
 		return arg;
 	}
 
-	string GetGuid()
+	static string GetGuid()
 	{
 		return publiccode::GetGuid();
 	}
 
 	//获取行元素的值		
-	xstring GetElementString(KXMLDOMElement e, xstring name)
+	static xstring GetElementString(KXMLDOMElement e, xstring name)
 	{
 		if (name == L"") return L"";
 		if (e.selectSingleNode(name))
@@ -56,7 +56,7 @@
 			return L"";
 	}
 
-	string GetElementString(KXMLDOMElement e, xstring name, bool isdisplay)
+	static string GetElementString(KXMLDOMElement e, xstring name, bool isdisplay)
 	{
 		if (isdisplay) name += L"/@_displaystring";
 		return GetElementString(e, name);
diff --git a/jrj/xframe/xcontrol/xdwgrid.hpp b/jrj/xframe/xcontrol/xdwgrid.hpp
index 8b423d2..8f4a517 100644
--- a/jrj/xframe/xcontrol/xdwgrid.hpp
+++ b/jrj/xframe/xcontrol/xdwgrid.hpp
@@ -334,14 +334,16 @@
 		return getKReport()->AddRepeats(colName);
 	}
 public:
-	LPTSTR GetColumnProp(int nCol, LPCTSTR pItem)
+	LPCTSTR GetColumnProp(int nCol, LPCTSTR pItem)
 	{
-		return getKReport()->GetColumnProp(nCol, pItem);
+		return L"";
+		//return getKReport()->GetColumnProp(nCol, pItem);
 	}
 
-	LPTSTR GetColumnProp(LPCTSTR pColName, LPCTSTR pItem)
+	LPCTSTR GetColumnProp(LPCTSTR pColName, LPCTSTR pItem)
 	{
-		return getKReport()->GetColumnProp(pColName, pItem);
+		return L"";
+		//return getKReport()->GetColumnProp(pColName, pItem);
 	}
 
 	int GetItemInt(int row, int col)
@@ -350,9 +352,9 @@
 		return str.toInt();
 	}
 
-	int GetItemInt(int row, string col)
+	int GetItemInt(int row, xstring col)
 	{
-		xstring str = GetItemString(row, col);
+		xstring str = GetItemString(row, col.c_str());
 		return str.toInt();
 	}
 
@@ -373,9 +375,9 @@
 		return SetItemString(row, col, xstring(str));
 	}
 
-	bool SetItemInt(int row, string col, int str)
+	bool SetItemInt(int row, xstring col, int str)
 	{
-		return SetItemString(row, col, xstring(str));
+		return SetItemString(row, col.c_str(), xstring(str));
 	}
 
 	bool SetItemDouble(int row, int col, double str)
@@ -383,9 +385,9 @@
 		return SetItemString(row, col, xstring(str));
 	}
 
-	bool SetItemDouble(int row, string col, double str)
+	bool SetItemDouble(int row, xstring col, double str)
 	{
-		return SetItemString(row, col, xstring(str));
+		return SetItemString(row, col.c_str(), xstring(str));
 	}
 
 public:
@@ -459,51 +461,6 @@
 	}
 
 public:
-#if 0
-	int GetItemInt(int row, int col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toInt();
-	}
-
-	double GetItemDouble(int row, int col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toDouble();
-	}
-
-	int GetItemInt(int row, string col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toInt();
-	}
-
-	double GetItemDouble(int row, string col)
-	{
-		xstring str = GetItemString(row, col);
-		return str.toDouble();
-	}
-
-	bool SetItemInt(int row, int col, int str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemDouble(int row, int col, double str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemInt(int row, string col, int str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-
-	bool SetItemDouble(int row, string col, double str)
-	{
-		return SetItemString(row, col, xstring(str));
-	}
-#endif
 
 	int DwRetrieve(string ServerUrl, string src, string argstr)
 	{

--
Gitblit v1.9.3