From f22bb7edb66856f3d1b6e44d6f6b170848a48dd7 Mon Sep 17 00:00:00 2001
From: xj qian <qianxj15@sina.com>
Date: 星期二, 16 七月 2024 08:37:26 +0800
Subject: [PATCH] updte

---
 jrj/project/business/Company/CompanyMaint.cpp  |   30 -
 jrj/project/business/Company/HrPersonMaint.cpp |    4 
 jrj/project/business/Company/HrOrgType.cpp     |    4 
 jrj/project/business/Company/HrJob.cpp         |    7 
 jrj/project/business/Company/HrEmployee.hpp    |   13 
 jrj/project/business/Company/HrOrgMaint.cpp    |    4 
 jrj/project/business/Company/HrPersonAdd.cpp   |    6 
 jrj/project/business/Company/HrPosition.hpp    |    9 
 jrj/ext-jrj/ext-jrj.vcxproj.filters            |    6 
 jrj/project/business/Company/HrEmployeex.hpp   |   22 
 jrj/project/business/Company/HRPerson.cpp      |    3 
 jrj/project/business/Company/CompanyList.cpp   |  366 ++++++++++++------------
 jrj/project/business/Company/HrPositionAdd.cpp |   34 +-
 jrj/project/business/Company/HrOrg.cpp         |   10 
 jrj/xframe/wobject/xwin.hpp                    |   35 ++
 jrj/project/business/Company/HrEmployeeAdd.cpp |  265 ++++++++---------
 jrj/ext-jrj/ext-jrj.vcxproj                    |   36 +-
 jrj/project/business/Company/HrPersonSel.cpp   |    6 
 18 files changed, 437 insertions(+), 423 deletions(-)

diff --git a/jrj/ext-jrj/ext-jrj.vcxproj b/jrj/ext-jrj/ext-jrj.vcxproj
index 3cbb7d3..551ba31 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj
+++ b/jrj/ext-jrj/ext-jrj.vcxproj
@@ -291,52 +291,52 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\CompanyMaint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrEmployee.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+    <ClCompile Include="..\project\business\Company\HrEmployee.hpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrEmployeeAdd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrEmployeex.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+    <ClCompile Include="..\project\business\Company\HrEmployeex.hpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrJob.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrOrg.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrOrgChart.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrOrgMaint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrOrgType.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HRPerson.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrPersonAdd.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrPersonMaint.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrPersonSel.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrPosition.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+    <ClCompile Include="..\project\business\Company\HrPosition.hpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrPositionAdd.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HR_Address.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>
diff --git a/jrj/ext-jrj/ext-jrj.vcxproj.filters b/jrj/ext-jrj/ext-jrj.vcxproj.filters
index ed3be24..edac3b9 100644
--- a/jrj/ext-jrj/ext-jrj.vcxproj.filters
+++ b/jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -863,13 +863,13 @@
     <ClCompile Include="..\project\business\Company\HR_Address.cpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrEmployee.cpp">
+    <ClCompile Include="..\project\business\Company\HrEmployee.hpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrEmployeeAdd.cpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrEmployeex.cpp">
+    <ClCompile Include="..\project\business\Company\HrEmployeex.hpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrJob.cpp">
@@ -899,7 +899,7 @@
     <ClCompile Include="..\project\business\Company\HrPersonSel.cpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
-    <ClCompile Include="..\project\business\Company\HrPosition.cpp">
+    <ClCompile Include="..\project\business\Company\HrPosition.hpp">
       <Filter>project\business\Company</Filter>
     </ClCompile>
     <ClCompile Include="..\project\business\Company\HrPositionAdd.cpp">
diff --git a/jrj/project/business/Company/CompanyList.cpp b/jrj/project/business/Company/CompanyList.cpp
index 9e85432..215bcab 100644
--- a/jrj/project/business/Company/CompanyList.cpp
+++ b/jrj/project/business/Company/CompanyList.cpp
@@ -7,211 +7,211 @@
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
 
-		using xml = KXMLDOMDocument;
-		class __declspec(dllexport) CompanyList : public xwin
+using xml = KXMLDOMDocument;
+class __declspec(dllexport) CompanyList : public xwin
+{
+public:
+	xdwgrid	dw_list;
+	xstring	m_agentCond;	//Agent Node
+	xnode	m_agentNode;
+public:
+	CompanyList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
+public:
+	static CompanyList* CreateInstance(void* implPtr, void* hWnd)
+	{
+		CompanyList* pWin = new CompanyList(implPtr, (HWND)hWnd);
+		return pWin;
+	}
+	int SetAgent()
+	{
+		xstring xfNodeAgentArea = L"agentarea";
+		xnode anode = GetAgentNode(xfNodeAgentArea);
+		if (m_agentNode)
 		{
-		public:
-			xdwgrid	dw_list;
-			xstring	m_agentCond;	//Agent Node
-			xnode	m_agentNode;
-		public:
-			CompanyList(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd) {}
-		public:
-			static CompanyList* CreateInstance(void* implPtr, void* hWnd)
+			SetAgentNode(anode, m_agentNode);
+		}
+		else
+		{
+			KXMLDOMElement xframeElement = GetElement();
+			KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
+			if (agent)
 			{
-				CompanyList* pWin = new CompanyList(implPtr, (HWND)hWnd);
-				return pWin;
+				xstring s = agent.xml();
+				m_agentNode = SetAgentNode(anode, s);
 			}
-			int SetAgent()
-			{
-				xstring xfNodeAgentArea = L"agentarea";
-				xnode anode = GetAgentNode(xfNodeAgentArea);
-				if (m_agentNode)
-				{
-					SetAgentNode(anode, m_agentNode);
-				}
-				else
-				{
-					KXMLDOMElement xframeElement = GetElement();
-					KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/" + xfNodeAgentArea + L"[1]/*");
-					if (agent)
-					{
-						xstring s = agent.xml();
-						m_agentNode = SetAgentNode(anode, s);
-					}
-				}
-				return 1;
-			}
-			//焦点激活处理函数
-			int OnSetFocus(TEvent* evt, LPARAM param)
-			{
-				//重置工具条
-				SetAgent();
-				return 1;
-			}
+		}
+		return 1;
+	}
+	//焦点激活处理函数
+	int OnSetFocus(TEvent* evt, LPARAM param)
+	{
+		//重置工具条
+		SetAgent();
+		return 1;
+	}
 
-			int  OnRetrieve()
+	int  OnRetrieve()
+	{
+		xml x;
+
+		xaserverarg arg;
+
+		//arg.AddArg(L"sType",c_type);
+		if (xurl::get(L"OrganizationStruct/list.CompanyInfo", arg.GetString(), x) != 1)
+		{
+			trace(x.text());
+			return -1;
+		}
+		else
+		{
+			//trace(x.GetXml());
+			dw_list.Retrieve(x);
+			dw_list.Redraw();
+		}
+		dw_list.SetReadOnly(true);
+		return 1;
+	}
+
+	//xgridex双击
+	int OnDoubleClicked(TEvent* evt, LPARAM p)
+	{
+		DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
+		int row = hdr.row;
+		if (row < 1 || row > dw_list.GetRowCount())
+			return 1;
+		KXMLDOMElement e = dw_list.GetRowElement(row);
+		xstring sguid = e.selectSingleNode(L"@guid").text();
+
+		xaserverarg& arg = *new xaserverarg;
+		arg.AddArg(L"operate", L"modify");
+		arg.AddArg(L"guid", sguid);
+		//trace(sguid);
+		//trace(row.toString());
+		//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
+		openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
+		return 1;
+	}
+
+	//命令发布函数
+	int OnCmdDispatch(xstring comdid)
+	{
+		xaserverarg& arg = *new xaserverarg;
+
+		KXMLDOMElement e;
+		xstring sguid;
+		xstring sName;
+
+		if (comdid == L"AddRow")
+		{
+			arg.AddArg(L"operate", L"new0");
+			arg.AddArg(L"guid", L"");
+			//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
+			openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
+		}
+		else if (comdid == L"ModifyRow")
+		{
+			int row = dw_list.GetNextSelectRow(1);
+			if (row < 1)
 			{
-				xml x;
-
-				xaserverarg arg;
-
-				//arg.AddArg(L"sType",c_type);
-				if (xurl::get(L"OrganizationStruct/list.CompanyInfo", arg.GetString(), x) != 1)
+				row = dw_list.GetRow();
+				if (row < 1)
 				{
-					trace(x.text());
+					MessageBox(GetHWND(), L"请选中要修改的公司行!", L"提示", 0);
 					return -1;
 				}
-				else
+			}
+			e = dw_list.GetRowElement(row);
+			sguid = e.selectSingleNode(L"@guid").text();
+			arg.AddArg(L"operate", L"modify");
+			arg.AddArg(L"guid", sguid);
+			//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
+			openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
+		}
+		else if (comdid == L"DeleteRow")
+		{
+			int row = dw_list.GetNextSelectRow(1);
+			if (row < 1)
+			{
+				row = dw_list.GetRow();
+				if (row < 1)
 				{
-					//trace(x.GetXml());
-					dw_list.Retrieve(x);
-					dw_list.Redraw();
+					MessageBox(GetHWND(), L"请选中要删除的公司行!", L"提示", 0);
+					return -1;
 				}
-				dw_list.SetReadOnly(true);
-				return 1;
 			}
+			e = dw_list.GetRowElement(row);
 
-			//xgridex双击
-			int OnDoubleClicked(TEvent* evt, LPARAM p)
+			sguid = e.selectSingleNode(L"@guid").text();
+			sName = e.selectSingleNode(L"Name").text();
+
+			sName += L"";
+			int  MB_YESNO = 0x00000004;
+			int  IDYES = 6;
+			if (MessageBox(GetHWND(), L"确认要删除公司 " + sName + L" 的信息吗?", L"提示", MB_YESNO) != IDYES) return 1;
+			arg.AddArg(L"guid", sguid);
+			trace(sguid);
+			xml x1;
+
+			if (xurl::post(L"OrganizationStruct/delete.CompanyInfo", arg.GetString(), x1) != 1)
 			{
-				DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
-				int row = hdr.row;
-				if (row < 1 || row > dw_list.GetRowCount())
-					return 1;
-				KXMLDOMElement e = dw_list.GetRowElement(row);
-				xstring sguid = e.selectSingleNode(L"@guid").text();
-
-				xaserverarg& arg = *new xaserverarg;
-				arg.AddArg(L"operate", L"modify");
-				arg.AddArg(L"guid", sguid);
-				//trace(sguid);
-				//trace(row.toString());
-				//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
-				openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
-				return 1;
+				xstring error = x1.text();
+				trace(error);
 			}
-
-			//命令发布函数
-			int OnCmdDispatch(xstring comdid)
+			else
 			{
-				xaserverarg& arg = *new xaserverarg;
-
-				KXMLDOMElement e;
-				xstring sguid;
-				xstring sName;
-
-				if (comdid == L"AddRow")
-				{
-					arg.AddArg(L"operate", L"new0");
-					arg.AddArg(L"guid", L"");
-					//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
-					openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
-				}
-				else if (comdid == L"ModifyRow")
-				{
-					int row = dw_list.GetNextSelectRow(1);
-					if (row < 1)
-					{
-						row = dw_list.GetRow();
-						if (row < 1)
-						{
-							MessageBox(GetHWND(), L"请选中要修改的公司行!", L"提示", 0);
-							return -1;
-						}
-					}
-					e = dw_list.GetRowElement(row);
-					sguid = e.selectSingleNode(L"@guid").text();
-					arg.AddArg(L"operate", L"modify");
-					arg.AddArg(L"guid", sguid);
-					//win::OpenWindow(L"dev:xpage[CompanyMaint.vx]",arg);
-					openUrl(L"组织架构.vface/xpage/CompanyInfo/maint", &arg);
-				}
-				else if (comdid == L"DeleteRow")
-				{
-					int row = dw_list.GetNextSelectRow(1);
-					if (row < 1)
-					{
-						row = dw_list.GetRow();
-						if (row < 1)
-						{
-							MessageBox(GetHWND(), L"请选中要删除的公司行!", L"提示", 0);
-							return -1;
-						}
-					}
-					e = dw_list.GetRowElement(row);
-
-					sguid = e.selectSingleNode(L"@guid").text();
-					sName = e.selectSingleNode(L"Name").text();
-
-					sName += L"";
-					int  MB_YESNO = 0x00000004;
-					int  IDYES = 6;
-					if (MessageBox(GetHWND(), L"确认要删除公司 " + sName + L" 的信息吗?", L"提示", MB_YESNO) != IDYES) return 1;
-					arg.AddArg(L"guid", sguid);
-					trace(sguid);
-					xml x1;
-
-					if (xurl::post(L"OrganizationStruct/delete.CompanyInfo", arg.GetString(), x1) != 1)
-					{
-						xstring error = x1.text();
-						trace(error);
-					}
-					else
-					{
-						MessageBox(GetHWND(), L"删除成功!", L"提示", 0);
-						dw_list.DeleteRow(row);
-					}
-
-				}
-				else if (comdid == L"Refresh")
-				{
-					OnRetrieve();
-				}
-				return 0;
+				MessageBox(GetHWND(), L"删除成功!", L"提示", 0);
+				dw_list.DeleteRow(row);
 			}
 
-			//命令处理事件
-			int OnXCommand(TEvent* evt, LPARAM param)
-			{
-				return OnCmdDispatch(evt->xcommand.pStrID);
-			}
+		}
+		else if (comdid == L"Refresh")
+		{
+			OnRetrieve();
+		}
+		return 0;
+	}
 
-			int OnAttachEvent()
-			{
-				//绑定工具条点击事件
-				AttachEvent(L"WM_XCOMMAND", (FEvent)&CompanyList::OnXCommand);
-				//获取焦点事件,用于重置工具条
-				AttachEvent(L"WM_SETFOCUS", (FEvent)&CompanyList::OnSetFocus);
-				//双击
-				AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&CompanyList::OnDoubleClicked);
-				return 1;
-			}
+	//命令处理事件
+	int OnXCommand(TEvent* evt, LPARAM param)
+	{
+		return OnCmdDispatch(evt->xcommand.pStrID);
+	}
 
-			int OnInitial()
-			{
-				SetAgent();
-				OnAttachEvent();
+	int OnAttachEvent()
+	{
+		//绑定工具条点击事件
+		AttachEvent(L"WM_XCOMMAND", (FEvent)&CompanyList::OnXCommand);
+		//获取焦点事件,用于重置工具条
+		AttachEvent(L"WM_SETFOCUS", (FEvent)&CompanyList::OnSetFocus);
+		//双击
+		AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&CompanyList::OnDoubleClicked);
+		return 1;
+	}
 
-				return 1;
-			}
+	int OnInitial()
+	{
+		SetAgent();
+		OnAttachEvent();
 
-			int onload()
-			{
-				dw_list = new xdwgrid;
-				dw_list.setNativePointer(GetControl(L"dw_list"));
+		return 1;
+	}
 
-				//xaserverarg args;
-				//args.setNativePointer(args.CreateInstance());		
-				//args.AddArg(L"type",L"CompanyList");
-				//dw_list.SetDataObject(GetServerUrl(),pref::getPref(L"HumanResource/GetHrObject",args.GetString()));
-				dw_list.openUrl(L"组织架构.vface/template/company/list");
-				dw_list.SetSelectionMode(1);
-				dw_list.SetReadOnly(true);
+	int onload()
+	{
+		dw_list = new xdwgrid;
+		dw_list.setNativePointer(GetControl(L"dw_list"));
 
-				OnInitial();
-				OnRetrieve();
+		//xaserverarg args;
+		//args.setNativePointer(args.CreateInstance());		
+		//args.AddArg(L"type",L"CompanyList");
+		//dw_list.SetDataObject(GetServerUrl(),pref::getPref(L"HumanResource/GetHrObject",args.GetString()));
+		dw_list.openUrl(L"组织架构.vface/template/company/list");
+		dw_list.SetSelectionMode(1);
+		dw_list.SetReadOnly(true);
 
-				return 1;
-			}
+		OnInitial();
+		OnRetrieve();
+
+		return 1;
+	}
 };
\ No newline at end of file
diff --git a/jrj/project/business/Company/CompanyMaint.cpp b/jrj/project/business/Company/CompanyMaint.cpp
index c94f48a..518d0ae 100644
--- a/jrj/project/business/Company/CompanyMaint.cpp
+++ b/jrj/project/business/Company/CompanyMaint.cpp
@@ -3,6 +3,7 @@
 #include <xcontrol/xdwgrid.hpp>
 #include <wobject/xdouble.hpp>
 #include <xcontrol/xlayersheet.hpp>
+#include <xcontrol/xdwpages.hpp>
 
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
@@ -11,7 +12,7 @@
 class __declspec(dllexport) CompanyMaint : public xframe
 {
 public:
-	pagecontrol m_layer;
+	xlayersheet m_layer;
 	xdwtable	dw_detail;
 	xdwtable	dw_bank;
 	xstring		m_operate;
@@ -150,11 +151,11 @@
 		xstring val, val2;
 		xml x;
 
-		var xdoc = x;
+		auto xdoc = x;
 		dw_detail.DwUpdateAllTo(xdoc);
 		//val = xdoc.xml ;
 		dw_bank.DwUpdateAllTo(xdoc);
-		val = xdoc.xml;
+		val = xdoc.xml();
 		trace(val);
 		xaserverarg args;
 		args.setNativePointer(args.CreateInstance());
@@ -182,9 +183,8 @@
 		xutil::RestoreCursor(hIcon);
 		dw_detail.ResetUpdateStatus();
 		dw_bank.ResetUpdateStatus();
-		var xdoc2 = x;
-		dw_detail.DwUpdateAllTo(xdoc2);
-		val = xdoc.xml;
+		dw_detail.DwUpdateAllTo(x);
+		val = x.xml();
 		trace(val);
 		return 1;
 	}
@@ -358,16 +358,13 @@
 
 	int onload()
 	{
-		m_layer = new pagecontrol;
-		m_layer.setNativePointer(GetControl(L"cTab"));
+		m_layer = GetControl(L"cTab");
 
-		dw_detail = new xdwtable;
-		dw_detail.setNativePointer(GetControl(L"dw_detail"));
+		dw_detail = GetControl(L"dw_detail");
 		dw_detail.openUrl(L"组织架构.vface/template/company/detail");
 		dw_detail.SetColHeaderHeight(0);
 		dw_detail.SetRowSelectorWidth(0);
-		dw_bank = new xdwtable;
-		dw_bank.setNativePointer(GetControl(L"dw_bank"));
+		dw_bank = GetControl(L"dw_bank");
 		dw_bank.openUrl(L"组织架构.vface/template/company/bank");
 
 		OnInitial();
@@ -375,8 +372,7 @@
 			OnRetrieve();
 		}
 		else {
-			xdwtable dw = new xdwtable;
-			dw.setNativePointer(dw_detail.FindDwTable(L"CompanyInfo", 0));
+			xdwtable dw = dw_detail.FindDwTable(L"CompanyInfo", 0);
 			dw.SetItemString(1, L"Status", L"1");
 			dw.SetItemString(1, L"InternalFlag", L"Y");
 			dw.SetItemString(1, L"Type", L"0");
@@ -387,14 +383,14 @@
 			dw.SetItemDisplayString(1,L"CreatorID",susername);
 			dw.SetItemString(1,L"CreateDate",sdate);*/
 
-			dw.setNativePointer(dw_detail.FindDwTable(L"address", 0));
+			dw = dw_detail.FindDwTable(L"address", 0);
 			dw.SetItemString(1, L"IdentifyAddressFlag", L"Y");
 			dw.SetItemString(1, L"Status", L"1");
-			dw.setNativePointer(dw_detail.FindDwTable(L"Regist", 0));
+			dw = dw_detail.FindDwTable(L"Regist", 0);
 			dw.SetItemString(1, L"IdentifyAddressFlag", L"N");
 			dw.SetItemString(1, L"Status", L"1");
 
-			dw.setNativePointer(dw_bank.FindDwTable(L"item", 0));
+			dw = dw_bank.FindDwTable(L"item", 0);
 			if (dw) {
 				//KXMLDOMElement ele = dw.GetElement();
 				//trace(ele.xml);
diff --git a/jrj/project/business/Company/HRPerson.cpp b/jrj/project/business/Company/HRPerson.cpp
index 4e9eee8..1d3883f 100644
--- a/jrj/project/business/Company/HRPerson.cpp
+++ b/jrj/project/business/Company/HRPerson.cpp
@@ -126,8 +126,7 @@
 
 	int OnSearch()
 	{
-		control xc = new control;
-		xc.setNativePointer(GetControl(L"QueryTxt"));
+		xcontrol xc = GetControl(L"QueryTxt");
 		m_sTxt = xc.GetText();
 		OnRetrieve();
 		return 1;
diff --git a/jrj/project/business/Company/HrEmployee.cpp b/jrj/project/business/Company/HrEmployee.hpp
similarity index 97%
rename from jrj/project/business/Company/HrEmployee.cpp
rename to jrj/project/business/Company/HrEmployee.hpp
index 196ff85..8b0d117 100644
--- a/jrj/project/business/Company/HrEmployee.cpp
+++ b/jrj/project/business/Company/HrEmployee.hpp
@@ -1,3 +1,5 @@
+#pragma once
+
 #include <wobject/xstring.hpp>
 #include <xcontrol/xtreeview.hpp>
 #include <xcontrol/xdwgrid.hpp>
@@ -100,7 +102,7 @@
 						dw_emp.ResetUpdateStatus();
 						alert(L"保存成功");
 					}
-					trace(x.GetXml());
+					trace(x.xml());
 					xutil::RestoreCursor(hIcon);
 					return 1;
 				}
@@ -120,8 +122,8 @@
 						return -1;
 					}
 					//trace(x.GetXml());
-					var list = x.selectNodes(L"//item");
-					int i = 0, s = list.length;
+					auto list = x.selectNodes(L"//item");
+					int i = 0, s = list.length();
 					KXMLDOMElement xitem;
 					xstring sName;
 					xstring sguid;
@@ -244,7 +246,7 @@
 						}
 					}
 
-					OpenWindow(L"dev:xpage[HrEmployeeAdd.vx]", this);
+					OpenWindow(L"dev:xpage[HrEmployeeAdd.vx]", (LPARAM)this);
 					//openUrl(L"组织架构.vface/xpage/Hr/HrEmployeeAdd", this);
 					return 1;
 				}
@@ -379,8 +381,7 @@
 
 				int onload()
 				{
-					tv_org = new treeview;
-					tv_org.setNativePointer(GetControl(L"tv_org"));
+					tv_org = GetControl(L"tv_org");
 					dw_emp = new xdwgrid;
 					dw_emp.setNativePointer(GetControl(L"dw_emp"));
 					dw_emp.openUrl(L"组织架构.vface/template/HrEmployee/list");
diff --git a/jrj/project/business/Company/HrEmployeeAdd.cpp b/jrj/project/business/Company/HrEmployeeAdd.cpp
index 904dfff..4de852c 100644
--- a/jrj/project/business/Company/HrEmployeeAdd.cpp
+++ b/jrj/project/business/Company/HrEmployeeAdd.cpp
@@ -6,17 +6,18 @@
 
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
+#include "hremployee.hpp"
 
 using xml = KXMLDOMDocument;
 class __declspec(dllexport) HrEmployeeAdd : public xframe
 {
 public:
-				HrEmployee lw_obj;
-				xdwgrid	dw_list;
+	HrEmployee* lw_obj;
+	xdwgrid	dw_list;
 
-				xnode	m_agentNode;	//Agent Condition
-				xstring	m_agentCond;	//Agent Node
-				xstring	m_sTxt;
+	xnode	m_agentNode;	//Agent Condition
+	xstring	m_agentCond;	//Agent Node
+	xstring	m_sTxt;
 public:
 	HrEmployeeAdd(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
 public:
@@ -46,151 +47,143 @@
 		return 1;
 	}
 
-				//焦点激活处理函数
-				int OnSetFocus(TEvent* evt, LPARAM param)
-				{
-					SetAgent();
-					//重置工具条
-					return 1;
-				}
+	//焦点激活处理函数
+	int OnSetFocus(TEvent* evt, LPARAM param)
+	{
+		SetAgent();
+		//重置工具条
+		return 1;
+	}
 
-				int  OnRetrieve()
-				{
-					control xc = new control;
-					xc.setNativePointer(GetControl(L"QueryTxt"));
-					m_sTxt = xc.GetText() + L"";
-					xml x ;
-					
-					xaserverarg arg;
-					
-					arg.AddArg(L"sTxt", m_sTxt);
-					if (xurl::post(L"OrganizationStruct/select.Employee", arg.GetString(), x) != 1)
-					{
-						trace(x.text());
-						return -1;
-					}
-					else
-					{
-						dw_list.Retrieve(x);
-						dw_list.Redraw();
-						dw_list.SetReadOnly(true);
-					}
-					return 1;
-				}
+	int  OnRetrieve()
+	{
+		xcontrol xc = GetControl(L"QueryTxt");
+		m_sTxt = xc.GetText() + L"";
+		xml x;
 
-				int OnOK()
-				{
-					if (GetParam())
-					{
-						lw_obj = new HrEmployee;
-						lw_obj.setNativePointer(GetParam());
-						lw_obj = GetParam();
-					}
-					else
-						return 0;
+		xaserverarg arg;
 
-					int row = dw_list.GetNextSelectRow(1);
-					if (row < 1)
-					{
-						alert(L"请选择人员!");
-						return 1;
-					}
+		arg.AddArg(L"sTxt", m_sTxt);
+		if (xurl::post(L"OrganizationStruct/select.Employee", arg.GetString(), x) != 1)
+		{
+			trace(x.text());
+			return -1;
+		}
+		else
+		{
+			dw_list.Retrieve(x);
+			dw_list.Redraw();
+			dw_list.SetReadOnly(true);
+		}
+		return 1;
+	}
 
-					xstring sPositionID, sPositionName;
-					xstring sOrgID, sOrgName;
-					xstring sJobID, sJobName;
-					int wid = lw_obj.tv_org.GetId();
-					int hitem = treeview::GetSelectedItem(wid);
-					KXMLDOMElement ele = treeview::GetItemData(wid, hitem);
-					if (ele)
-					{
-						sPositionID = ele.selectSingleNode(L"id").text();
-						sPositionName = ele.selectSingleNode(L"name").text();
-						sOrgID = ele.selectSingleNode(L"OrgID").text();
-						sOrgName = ele.selectSingleNode(L"OrgName").text();
-						sJobID = ele.selectSingleNode(L"JobID").text();
-						sJobName = ele.selectSingleNode(L"JobName").text();
-					}
+	int OnOK()
+	{
+		if (GetWinParam())
+		{
+			lw_obj = (HrEmployee*)GetWinParam();
+		}
+		else
+			return 0;
 
-					while (row > 0)
-					{
-						KXMLDOMElement e = dw_list.GetRowElement(row);
-						xstring sEmployeeNo = e.selectSingleNode(L"EmployeeNo").text + L"";
-						xstring sPersonID = e.selectSingleNode(L"PersonID").text + L"";
-						xstring sPersonName = e.selectSingleNode(L"Name").text + L"";
+		int row = dw_list.GetNextSelectRow(1);
+		if (row < 1)
+		{
+			alert(L"请选择人员!");
+			return 1;
+		}
 
-						int nRow = lw_obj.dw_emp.InsertRow(0);
-						lw_obj.dw_emp.SetItemString(nRow, L"EmployeeNo", sEmployeeNo);
-						lw_obj.dw_emp.SetItemString(nRow, L"PersonID", sPersonID);
-						lw_obj.dw_emp.SetItemDisplayString(nRow, L"PersonID", sPersonName);
+		xstring sPositionID, sPositionName;
+		xstring sOrgID, sOrgName;
+		xstring sJobID, sJobName;
+		KXMLDOMElement ele = lw_obj->tv_org.GetItemData(lw_obj->tv_org.GetSelectedItem());
+		if (ele)
+		{
+			sPositionID = ele.selectSingleNode(L"id").text();
+			sPositionName = ele.selectSingleNode(L"name").text();
+			sOrgID = ele.selectSingleNode(L"OrgID").text();
+			sOrgName = ele.selectSingleNode(L"OrgName").text();
+			sJobID = ele.selectSingleNode(L"JobID").text();
+			sJobName = ele.selectSingleNode(L"JobName").text();
+		}
 
-						lw_obj.dw_emp.SetItemString(nRow, L"PositionID", sPositionID);
-						lw_obj.dw_emp.SetItemDisplayString(nRow, L"PositionID", sPositionName);
-						lw_obj.dw_emp.SetItemString(nRow, L"OrgID", sOrgID);
-						lw_obj.dw_emp.SetItemDisplayString(nRow, L"OrgID", sOrgName);
-						lw_obj.dw_emp.SetItemString(nRow, L"JobID", sJobID);
-						lw_obj.dw_emp.SetItemDisplayString(nRow, L"JobID", sJobName);
+		while (row > 0)
+		{
+			KXMLDOMElement e = dw_list.GetRowElement(row);
+			xstring sEmployeeNo = e.selectSingleNode(L"EmployeeNo").text();
+			xstring sPersonID = e.selectSingleNode(L"PersonID").text();
+			xstring sPersonName = e.selectSingleNode(L"Name").text();
 
-						lw_obj.dw_emp.SetItemString(nRow, L"Status", L"Y");
-						lw_obj.dw_emp.SetItemDisplayString(nRow, L"Status", L"有效");
-						xstring sdate = publiccode::GetCurDate() + L"";
-						lw_obj.dw_emp.SetItemString(nRow, L"StartDate", sdate + L"");
-						lw_obj.dw_emp.SetItemString(nRow, L"EndDate", L"2050-12-31");
+			int nRow = lw_obj->dw_emp.InsertRow(0);
+			lw_obj->dw_emp.SetItemString(nRow, L"EmployeeNo", sEmployeeNo);
+			lw_obj->dw_emp.SetItemString(nRow, L"PersonID", sPersonID);
+			lw_obj->dw_emp.SetItemDisplayString(nRow, L"PersonID", sPersonName);
 
-						row = dw_list.GetNextSelectRow(row + 1);
-					}
-					CloseWindow();
-					return 1;
-				}
+			lw_obj->dw_emp.SetItemString(nRow, L"PositionID", sPositionID);
+			lw_obj->dw_emp.SetItemDisplayString(nRow, L"PositionID", sPositionName);
+			lw_obj->dw_emp.SetItemString(nRow, L"OrgID", sOrgID);
+			lw_obj->dw_emp.SetItemDisplayString(nRow, L"OrgID", sOrgName);
+			lw_obj->dw_emp.SetItemString(nRow, L"JobID", sJobID);
+			lw_obj->dw_emp.SetItemDisplayString(nRow, L"JobID", sJobName);
 
-				//命令发布函数
-				int OnCmdDispatch(xstring comdid)
-				{
-					if (comdid == L"xmOk")
-						OnOK();
-					else if (comdid == L"query")
-						OnRetrieve();
-					else if (comdid == L"xmCancel")
-						CloseWindow();
-					return 0;
-				}
+			lw_obj->dw_emp.SetItemString(nRow, L"Status", L"Y");
+			lw_obj->dw_emp.SetItemDisplayString(nRow, L"Status", L"有效");
+			xstring sdate = publiccode::GetCurrentDate();
+			lw_obj->dw_emp.SetItemString(nRow, L"StartDate", sdate);
+			lw_obj->dw_emp.SetItemString(nRow, L"EndDate", L"2050-12-31");
 
-				//命令处理事件
-				int OnXCommand(TEvent* evt, LPARAM param)
-				{
-					return OnCmdDispatch(evt->xcommand.pStrID);
-				}
+			row = dw_list.GetNextSelectRow(row + 1);
+		}
+		CloseWindow();
+		return 1;
+	}
 
-				int OnAttachEvent()
-				{
-					//绑定工具条点击事件
-					AttachEvent(L"WM_XCOMMAND", (FEvent)&HrEmployeeAdd::OnXCommand);
-					//获取焦点事件,用于重置工具条
-					AttachEvent(L"WM_SETFOCUS", (FEvent)&HrEmployeeAdd::OnSetFocus);
-					return 1;
-				}
+	//命令发布函数
+	int OnCmdDispatch(xstring comdid)
+	{
+		if (comdid == L"xmOk")
+			OnOK();
+		else if (comdid == L"query")
+			OnRetrieve();
+		else if (comdid == L"xmCancel")
+			CloseWindow();
+		return 0;
+	}
 
-				int OnInitial()
-				{
-					SetAgent();
-					OnAttachEvent();
-					return 1;
-				}
+	//命令处理事件
+	int OnXCommand(TEvent* evt, LPARAM param)
+	{
+		return OnCmdDispatch(evt->xcommand.pStrID);
+	}
 
-				int onload()
-				{
-					dw_list = new xdwgrid;
-					dw_list.setNativePointer(GetControl(L"dw_list"));
-					dw_list.openUrl(L"组织架构.vface/template/HrEmployee/PersonSel");
-					dw_list.SetSelectionMode(3); //3
-					dw_list.SetReadOnly(true);
+	int OnAttachEvent()
+	{
+		//绑定工具条点击事件
+		AttachEvent(L"WM_XCOMMAND", (FEvent)&HrEmployeeAdd::OnXCommand);
+		//获取焦点事件,用于重置工具条
+		AttachEvent(L"WM_SETFOCUS", (FEvent)&HrEmployeeAdd::OnSetFocus);
+		return 1;
+	}
 
-					OnInitial();
-					OnRetrieve();
+	int OnInitial()
+	{
+		SetAgent();
+		OnAttachEvent();
+		return 1;
+	}
 
-					return 1;
-				}
-			]
+	int onload()
+	{
+		dw_list = new xdwgrid;
+		dw_list.setNativePointer(GetControl(L"dw_list"));
+		dw_list.openUrl(L"组织架构.vface/template/HrEmployee/PersonSel");
+		dw_list.SetSelectionMode(3); //3
+		dw_list.SetReadOnly(true);
 
-		]
-]
\ No newline at end of file
+		OnInitial();
+		OnRetrieve();
+
+		return 1;
+	}
+};
\ No newline at end of file
diff --git a/jrj/project/business/Company/HrEmployeex.cpp b/jrj/project/business/Company/HrEmployeex.hpp
similarity index 94%
rename from jrj/project/business/Company/HrEmployeex.cpp
rename to jrj/project/business/Company/HrEmployeex.hpp
index 38feb04..c1a8617 100644
--- a/jrj/project/business/Company/HrEmployeex.cpp
+++ b/jrj/project/business/Company/HrEmployeex.hpp
@@ -1,3 +1,5 @@
+#pragma once
+
 #include <wobject/xstring.hpp>
 #include <xcontrol/xtreeview.hpp>
 #include <xcontrol/xdwgrid.hpp>
@@ -61,21 +63,14 @@
 
 					xstring val;
 					xml x;
-
-					var xdoc = x;
 					dw_1.AcceptText();
-					dw_1.DwUpdateAllTo(xdoc);
-					val = xdoc.xml;
-					//trace(val);
-					//return 1;
+					dw_1.DwUpdateAllTo(x);
 					xaserverarg args;
 					
-					args.AddArg(L"content", val);
-					xml x1;
-					
-					if (xurl::post(L"OrganizationStruct/update.Employee", args.GetString(), x1) != 1)
+					args.AddArg(L"content", x.xml());
+					if (xurl::post(L"OrganizationStruct/update.Employee", args.GetString(), x) != 1)
 					{
-						xstring error = x1.text();
+						xstring error = x.text();
 						trace(error);
 					}
 					else
@@ -234,7 +229,7 @@
 
 				int OnImportData()
 				{
-					openUrl(L"组织架构.vface/xpage/Hr/HrPersonSel", this);
+					openUrl(L"组织架构.vface/xpage/Hr/HrPersonSel", (LPARAM)this);
 					return 1;
 				}
 				//命令发布函数
@@ -278,8 +273,7 @@
 
 				int onload()
 				{
-					tv_org = new treeview;
-					tv_org.setNativePointer(GetControl(L"tv_org"));
+					tv_org = GetControl(L"tv_org");
 					dw_1 = new xdwtable;
 					dw_1.setNativePointer(GetControl(L"dw_1"));
 					dw_1.openUrl(L"组织架构.vface/template/HrEmployee/detail");
diff --git a/jrj/project/business/Company/HrJob.cpp b/jrj/project/business/Company/HrJob.cpp
index 08597ef..bdb4723 100644
--- a/jrj/project/business/Company/HrJob.cpp
+++ b/jrj/project/business/Company/HrJob.cpp
@@ -114,8 +114,8 @@
 						return -1;
 					}
 					//trace(x.GetXml());
-					var list = x.selectNodes(L"//Type");
-					int i = 0, s = list.length;
+					auto list = x.selectNodes(L"//Type");
+					int i = 0, s = list.length();
 					KXMLDOMElement e;
 					xstring sname;
 					if (s > 0)
@@ -269,8 +269,7 @@
 				int onload()
 				{
 					m_type = L"all";
-					tv_1 = new treeview;
-					tv_1.setNativePointer(GetControl(L"tv_1"));
+					tv_1 = GetControl(L"tv_1");
 					dw_list = new xdwgrid;
 					dw_list.setNativePointer(GetControl(L"dw_list"));
 					dw_list.openUrl(L"组织架构.vface/template/HrJob/list");
diff --git a/jrj/project/business/Company/HrOrg.cpp b/jrj/project/business/Company/HrOrg.cpp
index 4c8234d..46d9dc0 100644
--- a/jrj/project/business/Company/HrOrg.cpp
+++ b/jrj/project/business/Company/HrOrg.cpp
@@ -96,8 +96,8 @@
 			return -1;
 		}
 		//trace(x.GetXml());
-		var list = x.selectNodes(L"//Org");
-		int i = 0, s = list.length;
+		auto list = x.selectNodes(L"//Org");
+		int i = 0, s = list.length();
 		KXMLDOMElement xitem;
 		xstring sname;
 		xstring sguid;
@@ -389,8 +389,7 @@
 		xnode anode = new xnode;
 		anode.setNativePointer(GetAgentNode(xfNodeAgentArea));
 		SetAgentNode(anode, str);
-		tv_org = new treeview;
-		tv_org.setNativePointer(GetControl(L"tv_org"));
+		tv_org = GetControl(L"tv_org");
 		AttachEvent(L"tv_org", L"TVN_SELCHANGED", (FEvent)&HrOrg::OnTreeSelecded);
 		HTREEITEM root = tv_org.GetRootItem();
 		if (root > 0)
@@ -458,8 +457,7 @@
 
 	int onload()
 	{
-		tv_org = new treeview;
-		tv_org.setNativePointer(GetControl(L"tv_org"));
+		tv_org = GetControl(L"tv_org");
 		dw_list = new xdwgrid;
 		dw_list.setNativePointer(GetControl(L"dw_list"));
 		dw_list.openUrl(L"组织架构.vface/template/HrOrg/list");
diff --git a/jrj/project/business/Company/HrOrgMaint.cpp b/jrj/project/business/Company/HrOrgMaint.cpp
index 9f23955..f228299 100644
--- a/jrj/project/business/Company/HrOrgMaint.cpp
+++ b/jrj/project/business/Company/HrOrgMaint.cpp
@@ -88,9 +88,9 @@
 		xstring val;
 		xml x;
 
-		var xdoc = x;
+		auto xdoc = x;
 		dw_detail.DwUpdateAllTo(xdoc);
-		val = xdoc.xml;
+		val = xdoc.xml();
 		//trace(val);
 		//return 1;
 		xaserverarg args;
diff --git a/jrj/project/business/Company/HrOrgType.cpp b/jrj/project/business/Company/HrOrgType.cpp
index da2986e..5179465 100644
--- a/jrj/project/business/Company/HrOrgType.cpp
+++ b/jrj/project/business/Company/HrOrgType.cpp
@@ -59,11 +59,11 @@
 
 		xml x;
 
-		var xdoc = x;
+		auto xdoc = x;
 		dw_list.AcceptText();
 		dw_list.DwUpdateAllTo(xdoc);//dw_list.DwUpdateAllTo(xdoc); //dw_list.DwUpdateTo(xdoc);
 
-		xstring val = xdoc.xml;
+		xstring val = xdoc.xml();
 		xaserverarg args;
 		args.setNativePointer(args.CreateInstance());
 		args.AddArg(L"content", val);
diff --git a/jrj/project/business/Company/HrPersonAdd.cpp b/jrj/project/business/Company/HrPersonAdd.cpp
index 595a32f..412d29c 100644
--- a/jrj/project/business/Company/HrPersonAdd.cpp
+++ b/jrj/project/business/Company/HrPersonAdd.cpp
@@ -6,12 +6,13 @@
 
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
+//#include "HrEmployee.cpp"
 
 using xml = KXMLDOMDocument;
 class __declspec(dllexport) HrPersonAdd : public xframe
 {
 public:
-	HrEmployee lw_obj;
+	//HrEmployee* lw_obj;
 	xdwgrid	dw_list;
 
 	xnode	m_agentNode;	//Agent Condition
@@ -56,8 +57,7 @@
 
 	int  OnRetrieve()
 	{
-		control xc = new control;
-		xc.setNativePointer(GetControl(L"QueryTxt"));
+		xcontrol xc = GetControl(L"QueryTxt");
 		m_sTxt = xc.GetText() + L"";
 		xml x;
 
diff --git a/jrj/project/business/Company/HrPersonMaint.cpp b/jrj/project/business/Company/HrPersonMaint.cpp
index 5a84680..326a178 100644
--- a/jrj/project/business/Company/HrPersonMaint.cpp
+++ b/jrj/project/business/Company/HrPersonMaint.cpp
@@ -62,10 +62,10 @@
 		xstring val;
 		xml x;
 
-		var xdoc = x;
+		auto xdoc = x;
 		dw_1.AcceptText();
 		dw_1.DwUpdateAllTo(xdoc);
-		val = xdoc.xml;
+		val = xdoc.xml();
 		//trace(val);
 		xaserverarg args;
 		args.setNativePointer(args.CreateInstance());
diff --git a/jrj/project/business/Company/HrPersonSel.cpp b/jrj/project/business/Company/HrPersonSel.cpp
index 6be1bc1..f1c0a4b 100644
--- a/jrj/project/business/Company/HrPersonSel.cpp
+++ b/jrj/project/business/Company/HrPersonSel.cpp
@@ -6,12 +6,13 @@
 
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
+#include "HrEmployeex.hpp"
 
 using xml = KXMLDOMDocument;
 class __declspec(dllexport) HrPersonSel : public xframe
 {
 public:
-	HrEmployeex lw_obj;
+	HrEmployeex* lw_obj;
 	xdwgrid	dw_list;
 
 	xnode	m_agentNode;	//Agent Condition
@@ -56,8 +57,7 @@
 
 				int  OnRetrieve()
 				{
-					control xc = new control;
-					xc.setNativePointer(GetControl(L"QueryTxt"));
+					xcontrol xc = GetControl(L"QueryTxt");
 					m_sTxt = xc.GetText() + L"";
 					xstring query = L"[MSSqlHrJob.xq]";
 					xml x;
diff --git a/jrj/project/business/Company/HrPosition.cpp b/jrj/project/business/Company/HrPosition.hpp
similarity index 97%
rename from jrj/project/business/Company/HrPosition.cpp
rename to jrj/project/business/Company/HrPosition.hpp
index de946c5..88e854d 100644
--- a/jrj/project/business/Company/HrPosition.cpp
+++ b/jrj/project/business/Company/HrPosition.hpp
@@ -1,3 +1,5 @@
+#pragma once
+
 #include <wobject/xstring.hpp>
 #include <xcontrol/xtreeview.hpp>
 #include <xcontrol/xdwgrid.hpp>
@@ -131,7 +133,7 @@
 						return 0;
 					}
 					//openUrl(L"组织架构.vface/xpage/Hr/HrPositionAdd", this);
-					OpenWindow(L"dev:xpage[HrPositionAdd.vx]", this);
+					OpenWindow(L"dev:xpage[HrPositionAdd.vx]", (LPARAM)this);
 					return 1;
 				}
 
@@ -165,7 +167,7 @@
 							trace(x.xml());
 							return 0;
 						}
-						var doc = x;
+						auto doc = x;
 						xstring cnt = doc.text();
 						int ll_cnt = cnt.toInt();
 						if (ll_cnt == 0)	//判断HrEmploee里面是否存在该岗位
@@ -256,8 +258,7 @@
 
 				int onload()
 				{
-					tv_org = new treeview;
-					tv_org.setNativePointer(GetControl(L"tv_org"));
+					tv_org = GetControl(L"tv_org");
 					dw_list = new xdwgrid;
 					dw_list.setNativePointer(GetControl(L"dw_list"));
 					dw_list.openUrl(L"组织架构.vface/template/HrPosition/list");
diff --git a/jrj/project/business/Company/HrPositionAdd.cpp b/jrj/project/business/Company/HrPositionAdd.cpp
index 8173dc8..9336e7e 100644
--- a/jrj/project/business/Company/HrPositionAdd.cpp
+++ b/jrj/project/business/Company/HrPositionAdd.cpp
@@ -6,13 +6,14 @@
 
 #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
 #include "viewobject/view.base.hpp"
+#include "HrPosition.hpp"
 
 using xml = KXMLDOMDocument;
 class __declspec(dllexport) HrPositionAdd : public xframe
 {
 public:
 
-	HrPosition lw_obj;
+	HrPosition* lw_obj;
 	xdwgrid	dw_list;
 	xtreeview		tv_1;
 	xstring 	m_type;
@@ -116,8 +117,8 @@
 						return -1;
 					}
 					//trace(x.GetXml());
-					var list = x.selectNodes(L"//Type");
-					int i = 0, s = list.length;
+					auto list = x.selectNodes(L"//Type");
+					int i = 0, s = list.length();
 					KXMLDOMElement e;
 					xstring sname;
 					if (s > 0)
@@ -136,9 +137,7 @@
 				{
 					if (GetWinParam())
 					{
-						lw_obj = new HrPosition;
-						lw_obj.setNativePointer(GetParam());
-						lw_obj = GetParam();
+						lw_obj = (HrPosition*)GetWinParam();
 					}
 					else
 						return 0;
@@ -150,8 +149,8 @@
 						return 1;
 					}
 					//treeview    tv_org   =  new treeview;
-					//tv_org.setNativePointer(lw_obj.tv_org);
-					HTREEITEM wid = lw_obj.tv_org.GetId();
+					//tv_org.setNativePointer(lw_obj->tv_org);
+					HTREEITEM wid = lw_obj->tv_org.GetId();
 					HTREEITEM hitem = tv_1.GetSelectedItem();
 					KXMLDOMElement ele = tv_1.GetItemData( hitem);
 					xstring sOrgID = ele.selectSingleNode(L"@guid").text();
@@ -162,14 +161,14 @@
 						xstring sJobID = e.selectSingleNode(L"@guid").text() + (xstring)L"";
 						xstring sJobName = e.selectSingleNode(L"JobName").text() + (xstring)L"";
 
-						int nRow = lw_obj.dw_list.InsertRow(0);
-						lw_obj.dw_list.SetItemString(nRow, L"JobID", sJobID);
-						lw_obj.dw_list.SetItemDisplayString(nRow, L"JobID", sJobName);
-						lw_obj.dw_list.SetItemString(nRow, L"Status", L"Y");
-						lw_obj.dw_list.SetItemDisplayString(nRow, L"Status", L"有效");
-						lw_obj.dw_list.SetItemString(nRow, L"OrgID", sOrgID);
-						lw_obj.dw_list.SetItemDisplayString(nRow, L"OrgID", sOrgName);
-						lw_obj.dw_list.SetItemString(nRow, L"PositionName", sOrgName + sJobName);
+						int nRow = lw_obj->dw_list.InsertRow(0);
+						lw_obj->dw_list.SetItemString(nRow, L"JobID", sJobID);
+						lw_obj->dw_list.SetItemDisplayString(nRow, L"JobID", sJobName);
+						lw_obj->dw_list.SetItemString(nRow, L"Status", L"Y");
+						lw_obj->dw_list.SetItemDisplayString(nRow, L"Status", L"有效");
+						lw_obj->dw_list.SetItemString(nRow, L"OrgID", sOrgID);
+						lw_obj->dw_list.SetItemDisplayString(nRow, L"OrgID", sOrgName);
+						lw_obj->dw_list.SetItemString(nRow, L"PositionName", sOrgName + sJobName);
 						row = dw_list.GetNextSelectRow(row + 1);
 					}
 					CloseWindow();
@@ -214,8 +213,7 @@
 				{
 					SetArg();
 					m_type = L"all";
-					tv_1 = new treeview;
-					tv_1.setNativePointer(GetControl(L"tv_1"));
+					tv_1 = GetControl(L"tv_1");
 					dw_list = new xdwgrid;
 					dw_list.setNativePointer(GetControl(L"dw_list"));
 					dw_list.openUrl(L"组织架构.vface/template/HrJob/list");
diff --git a/jrj/xframe/wobject/xwin.hpp b/jrj/xframe/wobject/xwin.hpp
index 3a21359..15de5fc 100644
--- a/jrj/xframe/wobject/xwin.hpp
+++ b/jrj/xframe/wobject/xwin.hpp
@@ -185,6 +185,41 @@
 		return -1;
 	}
 
+	int openUrl(xstring aurl, LPARAM para)
+	{
+		KXMLDOMDocument x;
+
+		xurl::get(GetServerUrl(), aurl, L"", x);
+		KXMLDOMNode n = x.selectSingleNode(L"//resource/@src");
+		if (n)
+		{
+			string xq = n.text();
+			OpenWindow(xq, (LPARAM)para);
+			return 1;
+		}
+		else
+		{
+			n = x.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 (vface == L"." || vface == L"")
+				{
+					string v = n.selectSingleNode(L"@url").text();
+					xstring burl = xstring(aurl).mid(0, xstring(aurl).find(v, 0));
+					return openUrl(burl + view, para);
+				}
+				else
+					return openUrl(vface + L"/" + view, para);
+			}
+		}
+		return -1;
+	}
+
+
 	int CloseWindow()
 	{
 		return getKWin()->CloseWindow();

--
Gitblit v1.9.3