From a4d2315ee4ca3f6177b4fb2526bed2feff3d89be Mon Sep 17 00:00:00 2001
From: lifan <2308045698@qq.com>
Date: 星期三, 22 十月 2025 16:52:58 +0800
Subject: [PATCH] update
---
jrj/project/business/SystemSettings/UserImport.cpp | 54 +++++++++++++++++++++++++++++-------------------------
1 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/jrj/project/business/SystemSettings/UserImport.cpp b/jrj/project/business/SystemSettings/UserImport.cpp
index 2180585..572beb0 100644
--- a/jrj/project/business/SystemSettings/UserImport.cpp
+++ b/jrj/project/business/SystemSettings/UserImport.cpp
@@ -15,7 +15,7 @@
public:
- SysUser lw_obj;
+ SysUser* lw_obj;
xdwgrid dw_list;
xtreeview tv_org;
xnode m_agentNode; //Agent Condition
@@ -23,7 +23,7 @@
xstring m_sTxt;
xstring is_orgid;
public:
- UserImport(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
+ UserImport(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd), lw_obj(nullptr) {}
public:
static UserImport* CreateInstance(void* implPtr, void* hWnd)
{
@@ -82,9 +82,7 @@
{
if (GetWinParam())
{
- lw_obj = new SysUser;
- lw_obj.setNativePointer(GetParam());
- lw_obj = GetParam();
+ lw_obj = (SysUser*)GetWinParam();
}
else
return 0;
@@ -102,7 +100,7 @@
xstring sJobID, sJobName;
//int wid = lw_obj.tv_usergroup.GetId();
HTREEITEM hitem = tv_org.GetSelectedItem();
- KXMLDOMElement ele = tv_org.GetItemData(hitem);
+ //KXMLDOMElement ele = tv_org.GetItemData(hitem);
while (row > 0)
@@ -132,15 +130,15 @@
}
}*/
- int nRow = lw_obj.dw_user.InsertRow(0);
- lw_obj.dw_user.SetItemString(nRow, L"EmployeeNo", sEmployeeNo);
- lw_obj.dw_user.SetItemString(nRow, L"UserName", sOldEmpNo);
- lw_obj.dw_user.SetItemString(nRow, L"PassWord", sPassWord);
- lw_obj.dw_user.SetItemString(nRow, L"PersonID", sPersonID);
- lw_obj.dw_user.SetItemDisplayString(nRow, L"PersonID", sPersonName);
- lw_obj.dw_user.SetItemString(nRow, L"Status", L"Y");
- lw_obj.dw_user.SetItemDisplayString(nRow, L"Status", L"有效");
- lw_obj.dw_user.SetItemString(nRow, L"OldEmpNo", sOldEmpNo);
+ int nRow = lw_obj->dw_user.InsertRow(0);
+ lw_obj->dw_user.SetItemString(nRow, L"EmployeeNo", sEmployeeNo);
+ lw_obj->dw_user.SetItemString(nRow, L"UserName", sOldEmpNo);
+ lw_obj->dw_user.SetItemString(nRow, L"PassWord", sPassWord);
+ lw_obj->dw_user.SetItemString(nRow, L"PersonID", sPersonID);
+ lw_obj->dw_user.SetItemDisplayString(nRow, L"PersonID", sPersonName);
+ lw_obj->dw_user.SetItemString(nRow, L"Status", L"Y");
+ lw_obj->dw_user.SetItemDisplayString(nRow, L"Status", L"有效");
+ lw_obj->dw_user.SetItemString(nRow, L"OldEmpNo", sOldEmpNo);
/*
lw_obj.dw_user.SetItemString(nRow,L"PositionID",sPositionID);
lw_obj.dw_user.SetItemDisplayString(nRow,L"PositionID",sPositionName);
@@ -164,11 +162,11 @@
int OnSubTree(xstring id, HTREEITEM parentitem)
{
//int wid = tv_org.GetId();
- if (tv_org.GetChildItem( parentitem) > 0) return 1;
+ if (tv_org.GetChildItem( parentitem)) return 1;
xml x;
xaserverarg arg;
- arg.setNativePointer(arg.CreateInstance());
+
arg.AddArg(L"sguid", id);
if (xurl::post(L"/sale/data/OrganizationStruct/tree.child.OrgChart", arg.GetString(), x) != 1)
{
@@ -176,8 +174,8 @@
return -1;
}
//trace(x.xml());
- 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;
@@ -191,15 +189,15 @@
sguid = xitem.selectSingleNode(L"id").text();
stype = xitem.selectSingleNode(L"typ").text();
//int curItem = tv_org.InsertChildItemEx(wid,parentitem,sName,xitem,15,4);
- int curItem = 0;
+ HTREEITEM curItem = 0;
if (stype == L"Org")
{
- curItem = tv_org.InsertChildItemEx(wid, parentitem, sName, xitem, 15, 4);
- tv_org.SetItemChild1(wid, curItem, 1);
+ curItem = tv_org.InsertChildItemEx( parentitem, sName, xitem, 15, 4);
+ tv_org.SetItemChild1(curItem, 1);
}
else
{
- curItem = tv_org.InsertChildItemEx(wid, parentitem, sName, xitem, 21, 21);
+ curItem = tv_org.InsertChildItemEx(parentitem, sName, xitem, 21, 21);
}
//OnSubTree(sguid,curItem);
}
@@ -214,12 +212,12 @@
//int wid = tv_org.GetId();
xml x;
- x.loadXML(L"<item><id>" + id + L"</id><no/><name>凤凰集团</name><typ>Org</typ></item>");
+ x.loadXML(L"<item><id>" + id + L"</id><no/><name>组织结构</name><typ>Org</typ></item>");
//KXMLDOMDocument root = x;
//KXMLDOMElement RDoc = x.documentElement();
//KXMLDOMElement ele = RDoc.SelectSingleNode(L"//Org");
KXMLDOMElement ele = x.selectSingleNode(L"//item");
- HTREEITEM hItem = tv_org.InsertChildItem( 0, L"凤凰集团", ele, 15, 4);
+ HTREEITEM hItem = tv_org.InsertChildItemEx( (HTREEITEM)0, L"组织结构", ele, 15, 4);
tv_org.SetItemChild1(hItem, 1);
return 1;
@@ -284,9 +282,15 @@
int OnCmdDispatch(xstring comdid)
{
if (comdid == L"cb_import")
+ {
OnOK();
+ return 1;
+ }
else if (comdid == L"cb_close")
+ {
CloseWindow();
+ return 1;
+ }
return 0;
}
--
Gitblit v1.9.3