xj qian
2024-07-17 961b8ca44057298551291ca4d14280a0ac7bc753
Merge branch 'master' of http://116.62.18.175:6699/r/mis-prj
已添加5个文件
已删除3个文件
已修改5个文件
3923 ■■■■■ 文件已修改
jrj/ext-jrj/ext-jrj.vcxproj 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/ext-jrj/ext-jrj.vcxproj.filters 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/AddUser.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/AddUserGroup.cpp 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/BugMaint.Developer.hxsoft.cpp 369 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/Buglist.Developer.hxsoft.cpp 333 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/Buglist.Developer.hxsoft_A.cpp 1576 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/Developer.Synch.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/Organization.cpp 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/OrganizationBase.cpp 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/Organization_A.cpp 513 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/ProcessManagement.cpp 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/SystemSettings/ProcessManagement_A.cpp 513 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/ext-jrj/ext-jrj.vcxproj
@@ -826,7 +826,10 @@
    <ClCompile Include="..\project\business\SystemSettings\BindComputer.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Buglist.Developer.hxsoft_A.cpp">
    <ClCompile Include="..\project\business\SystemSettings\Buglist.Developer.hxsoft.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\BugMaint.Developer.hxsoft.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Data.config.cpp">
@@ -844,9 +847,6 @@
    <ClCompile Include="..\project\business\SystemSettings\FlowTermSelect.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\GroupManagerList_A.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\level.Customer.v3.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
@@ -856,10 +856,11 @@
    <ClCompile Include="..\project\business\SystemSettings\maint.Level.Customer3.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Organization_A.cpp">
    <ClCompile Include="..\project\business\SystemSettings\Organization.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\ProcessManagement_A.cpp">
    <ClCompile Include="..\project\business\SystemSettings\OrganizationBase.cpp" />
    <ClCompile Include="..\project\business\SystemSettings\ProcessManagement.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Resource.select.data.config.cpp">
jrj/ext-jrj/ext-jrj.vcxproj.filters
@@ -1031,9 +1031,6 @@
    <ClCompile Include="..\project\business\SystemSettings\BindComputer.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Buglist.Developer.hxsoft_A.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Data.config.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
@@ -1049,9 +1046,6 @@
    <ClCompile Include="..\project\business\SystemSettings\FlowTermSelect.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\GroupManagerList_A.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\level.Customer.v3.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
@@ -1059,12 +1053,6 @@
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\maint.Level.Customer3.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Organization_A.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\ProcessManagement_A.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Resource.select.data.config.cpp">
@@ -1091,5 +1079,20 @@
    <ClCompile Include="..\project\business\SystemSettings\view.assignadjust.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Buglist.Developer.hxsoft.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\BugMaint.Developer.hxsoft.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\Organization.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\OrganizationBase.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
    <ClCompile Include="..\project\business\SystemSettings\ProcessManagement.cpp">
      <Filter>project\business\SystemSettings</Filter>
    </ClCompile>
  </ItemGroup>
</Project>
jrj/project/business/SystemSettings/AddUser.cpp
@@ -138,8 +138,7 @@
    int ClearItem(xstring item)
    {
        control xc = new control;
        xc.setNativePointer(GetControl(item));
        xcontrol xc =GetControl(item);
        xc.SetText(L"");
        return 1;
    }
@@ -191,8 +190,7 @@
    }
    int SetItem(xstring value, xstring item) {
        control xc = new control;
        xc.setNativePointer(GetControl(item));
        xcontrol xc = GetControl(item);
        xc.SetText(value);
        return 1;
    }
jrj/project/business/SystemSettings/AddUserGroup.cpp
@@ -41,8 +41,7 @@
    }
    int AppendItem(xml x, KXMLDOMElement r, xstring item) {
        var e = x.createElement(item);
        control xc = new control;
        xc.setNativePointer(GetControl(item));
        xcontrol xc = GetControl(item);
        e.text() = xc.GetText();
        r.appendChild(e);
        return 1;
@@ -50,8 +49,7 @@
    int AppendAttrib(xml x, KXMLDOMElement r, xstring item) {
        var e = x.createElement(item);
        //xcontrol xc = GetControl(item);
        control xc = new control;
        xc.setNativePointer(GetControl(item));
        xcontrol xc= GetControl(item);
        e.text() = xc.GetText();
        r.setAttribute(item, xc.GetText());
        return 1;
@@ -136,8 +134,7 @@
    }
    int SetItem(xstring value, xstring item) {
        control xc = new control;
        xc.setNativePointer(GetControl(item));
        xcontrol xc = GetControl(item);
        xc.SetText(value);
        return 1;
    }
jrj/project/business/SystemSettings/BugMaint.Developer.hxsoft.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,369 @@
#include <wobject/xstring.hpp>
#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"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) BugMaintWin :  public xframe
    {
    public:
        xdwtable dw_base;
        xnode    m_agentNode;    //Agent Condition
        xstring m_EntityID;
        xstring m_EntityType;
        xstring m_EntityConnect;
        xstring m_ConnectID;
        xcontrol m_Edit;
        htmlctrl m_Html;
        xcombobox m_cb;
    public:
        BugMaintWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static BugMaintWin* CreateInstance(void* implPtr, void* hWnd)
        {
            BugMaintWin* pWin = new BugMaintWin(implPtr, (HWND)hWnd);
            return pWin;
        }
        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;
        }
        int OnSave()
        {
            xaserverarg arg ;
            xml xbase ;
            dw_base.AcceptText();
            dw_base.DwUpdateAllTo(xbase);
            arg.AddArg(L"content",xbase.xml());
            if(getUrl(L"/workflow/action/BugList/bill.update",arg.GetString(),xbase) == 1)
            {
                dw_base.ResetUpdateStatus();
                alert(L"保存成功!");
                m_EntityID = dw_base.GetGuid(1);
                return 1;
            }
            else
            {
                alert(L"添加失败!");
                return -1;
            }
            return 1;
        }
        int AppendItem(xml x,KXMLDOMElement r,xstring name, xstring value)
        {
            KXMLDOMElement e = x.createElement(name);
            e.text() = value;
            r.appendChild(e);
            return 1;
        }
        int Init()
        {
            if(m_EntityID == L"") return -1;
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"EntityID",m_EntityID);
            arg.AddArg(L"EntityType",m_EntityType);
            arg.AddArg(L"EntityConnect",m_EntityConnect);
            if(xurl::get(L"/sale/data/Commentary/entity/notelist",arg.GetString(),x) == 1)
            {
                m_Html.SetContent(x.xml());
                m_Html.Redraw();
            }
            return 1;
        }
        int showAtt()
        {
            xnode anode =GetAgentNode(L"att");
            int s = m_cb.GetCount();
            xml x ;
            x.loadXML(L"<vbox/>");
            KXMLDOMElement ele = x.documentElement();
            int i=0;
            for(i=0; i<s; i++)
            {
                xstring tmp = m_cb.GetLBText(i);
                KXMLDOMElement e = x.createElement(L"hbox");
                e.setAttribute(L"height", L"20");
                KXMLDOMElement l = x.createElement(L"xlabel");
                l.setAttribute(L"caption", L""+tmp);
                KXMLDOMElement b = x.createElement(L"xtoolbutton");
                b.setAttribute(L"width", L"18");
                b.setAttribute(L"name", L"att_"+i.toString());
                b.setAttribute(L"image", L"1,5");
                e.appendChild(l);
                e.appendChild(b);
                ele.appendChild(e);
                KXMLDOMElement g = x.createElement(L"xlabel");
                g.setAttribute(L"height", L"2");
                g.setAttribute(L"style", L"background-color:#000000");
                ele.appendChild(g);
            }
            SetAgentNode (anode,ele.xml());
            anode.SetWidthHeight(-1, i * 20 + 1);
            return 1;
        }
        int addAtt()
        {
            xstring guid = publiccode::GetGuid();
            xstring str = guid.left(2);
            xstring ret = xaserver::UploadFile(L"attachment"+str, guid+L".jpg".GetHWND(),L"",false);
            int nIndex = m_cb.AddItem(ret, guid+L".jpg");
            showAtt();
            return 1;
        }
        int delAtt(xstring no)
        {
            int nIndex = no.toInt();
            m_cb.DeleteItem(nIndex);
            showAtt();
            return 1;
        }
        KXMLDOMElement getAtt()
        {
            int s = m_cb.GetCount();
            xml x ;
            x.loadXML(L"<Attachment/>");
            KXMLDOMElement ele = x.documentElement();
            int i=0;
            for(i=0; i<s; i++)
            {
                xstring tmp = m_cb.GetLBText( i);
                xstring tmp2 = m_cb.GetItemData(i);
                KXMLDOMElement e = x.createElement(L"item");
                e.setAttribute(L"name", L""+tmp);
                e.setAttribute(L"file", L""+tmp2);
                ele.appendChild(e);
            }
            return ele;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            if(comdid==L"xmOK")
            {
                if(m_EntityID == L"") return 1;
              //trace(L"id:"+m_EntityID);
                xml x ;
                xaserverarg arg ;
                xstring value = m_Edit.GetText();
                if(value == L"")
                {
                    alert(L"请填写批注!");
                    return 1;
                }
                x.loadXML(L"<Commentary update.new='1' update.modify='1'/>");
                KXMLDOMElement ele = x.documentElement();
                AppendItem(x, ele, L"CommentaryID",  publiccode::GetGuid());
                AppendItem(x, ele, L"EntityID", m_EntityID);
                AppendItem(x, ele, L"EntityType", m_EntityType);
                AppendItem(x, ele, L"Remark", value);
                AppendItem(x, ele, L"ParentConnect", m_EntityConnect);
                AppendItem(x, ele, L"ParentCommentaryID", m_ConnectID);
                AppendItem(x, ele, L"CreatorID", xaserver::GetUserId());
                ele.appendChild(getAtt());
                arg.AddArg(L"content", L"<root>"+(xstring)ele.xml()+L"</root>");
                if(getUrl(L"/workflow/action/Commentary/bill.update",arg.GetString(),x) == 1)
                {
                    m_Edit.SetText(L"");
                    m_cb.ResetContent();
                    Init();
                    showAtt();
                    return 1;
                }
                else
                {
                    alert(L"添加失败!");
                    return -1;
                }
            }
            else if(comdid==L"xmAtt")
            {
                addAtt();
            }
            else if(comdid.left(4)==L"att_")
            {
                delAtt(comdid.right(comdid.length() - 4));
            }
            else if(comdid==L"xmClose")
            {
                CloseWindow();
                return 1;
            }
            else if(comdid==L"xmSave")
            {
                return  OnSave();
            }
            return 0;
        }
        int OnHtmlClick(TEvent* evt, int p)
        {
            ref  HTMLNMHDR p = evt.pnmh;
            const xstring d = m_Html.GetData(p.object);
            if(d == L"") return -1;
            xstring file = d.mid(0, d.find(L"|##@@|",0));
            xstring name = d.mid(d.find(L"|##@@|",0)+6, d.length());
            xaserver::CreateDirectory(L"C:/Temp");
            xstring str = file.left(2);
            xstring ext = L"";
            if(name.find(L".")>=0) ext = name.mid(name.find(L"."),name.length());
            xstring sfile = file.left(file.length() - 4);
            //trace(L"--"+ext +L" " + L"/business/attachment/"+str+L"/"+ file);
            //int openRet = xaserver::DownLoadFile(GetServerUrl(),L"/business/attachment/"+str+L"/"+ file,name,L"C:/Temp/"+name);
            int openRet = xaserver::DownLoadFile(GetServerUrl(),L"/business/attachment/"+str+L"/"+ file,L"",L"C:/Temp/"+sfile+ext);
            if(openRet < 0)
            {
                alert(L"文件打开失败1!");
                return -1;
            }
            //openRet = ShellExecute(0,L"open",L"C:/Temp/"+name,L"",L"",5);
            openRet = ShellExecute(0,L"open",L"C:/Temp/"+sfile+ext,L"",L"",5);
            if(openRet < 32)
            {
                alert(L"文件打开失败2!");
                return -1;
            }
            return -1;
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&BugMaintWin::OnXCommand);
            AttachEvent(L"note",L"HTC_OBJECTCLICKED", (FEvent)&BugMaintWin::OnHtmlClick);
            return 1;
        }
        /*
        int  OnRetrieve()
        {
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"xxx",L"xxx");
            if (getUrl(L"",arg.GetString(),x)!=1)
            {
                trace(x.text());
                return -1;
            }else
            {
                //dw_list.Retrieve(x);
                //dw_list.Redraw();
            }
            return 1;
        }
        */
        int onload()
        {
            SetArg();
            dw_base = GetControl(L"dw_base");
            dw_base.openUrl(L"/sale/view/Developer/bug/maint");
            dw_base.SetColHeaderHeight(0);
            dw_base.SetRowSelectorWidth(0);
            dw_base.SetHScrollState(false);
            dw_base.SetVScrollState(false);
            OnAttachEvent();
            m_Edit = GetControl(L"Txt");
            m_Html = GetControl(L"note");
            m_cb = GetControl(L"attlist");
            m_EntityID = L"";
            m_EntityType = L"BugList";
            m_EntityConnect = L"";
            m_ConnectID = L"";
            xstring Reciever = publiccode::GetUser().name;
            dw_base.SetItemString(1,L"Reciever",Reciever);
            if(GetWinParam())
            {
                xaserverarg arg=GetArg() ;
                m_EntityID = arg.GetArgString(L"EntityID");
                m_EntityType = arg.GetArgString(L"m_EntityType");
                m_EntityConnect = arg.GetArgString(L"m_EntityConnect");
            }
            Init();
            return 1;
        }
        int onloaded()
        {
            //SetAgent();
            return 1;
        }
    };
jrj/project/business/SystemSettings/Buglist.Developer.hxsoft.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,333 @@
#include <wobject/xstring.hpp>
#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"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) BugListWin : public xframe
    {
    public:
        xdwgrid    dw_list;
        xnode    m_agentNode;    //Agent Condition
        xstring m_EntityID;
        xstring m_EntityType;
        htmlctrl m_Html;
        xcontrol m_Edit;
        xcombobox m_cb;
    public:
        BugListWin(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static BugListWin* CreateInstance(void* implPtr, void* hWnd)
        {
            BugListWin* pWin = new BugListWin(implPtr, (HWND)hWnd);
            return pWin;
        }
        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 OnRowChanged(TEvent* evt, int p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            int row = hdr.row;
            m_EntityID = dw_list.GetGuid(row);
            RetrieveNote(row);
            return 1;
        }
        static stdcall int GetModuleFileName(int hModule, xstring lpFileName, int nSize) native from "kernel32.dll" alias "GetModuleFileNameW";
        static stdcall int PathRemoveFileSpec(xstring lpFileName) native from "shlwapi.dll" alias "PathRemoveFileSpecW";
        xstring GetModulePath()
        {
            xstring str = L"";
            str = str.space(255);
            GetModuleFileName(0, str, 250);
            PathRemoveFileSpec(str);
            return str;
        }
        xstring GetModuleTmpPath()
        {
            xstring str = L"";
            str = str.space(255);
            GetModuleFileName(0, str, 250);
            PathRemoveFileSpec(str);
            xstring tmp = str + L"\\Temp";
            xaserver::CreateDirectory(tmp);
            return tmp;
        }
        int RetrieveNote(int row)
        {
            if (row == 0)    row = dw_list.GetRow();
            if (row < 1) return 1;
            xstring EntityID = dw_list.GetGuid(row);
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"EntityID", EntityID);
            if (xurl::get(L"/sale/data/Commentary/entity/notelist", arg.GetString(), x) == 1)
            {
                m_Html.SetContent(x.xml());
                m_Html.Redraw();
            }
            return 1;
        }
        //焦点激活处理函数
        int OnSetFocus(TEvent* evt, LPARAM param)
        {
            //重置工具条
            SetAgent();
            return 1;
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmAdd")
            {
                OpenWindow(L"dev:xpage[BugMaint.Developer.hxsoft.vx]", 0);
                return 1;
            }
            else if (comdid == L"xmRetrieve")
            {
                OnRetrieve();
                return 1;
            }
            else if (comdid == L"xmAtt")
            {
                addAtt();
            }
            else if (comdid == L"xmMsg")
            {
                OnAddItem();
                return 1;
            }
            else if (comdid == L"xmDelete")
            {
                OnDelete();
                return 1;
            }
            return 0;
        }
        int OnDelete()
        {
            int row = dw_list.GetRow();
            if (row < 1)
                return 1;
            KXMLDOMElement ele = dw_list.GetRowElement(row);
            xstring BugListID = ele.selectSingleNode(L"BugListID").text();
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"BugListID", BugListID);
            if (getUrl(L"/sale/data/BugList/delete/buglist", arg.GetString(), x) != 1)
            {
                xstring error = x.text();
                alert(L"err:" + error);
                return 1;
            }
            alert(x.text());
            OnRetrieve();
            return 1;
        }
        int addAtt()
        {
            xstring guid = publiccode::GetGuid();
            xstring str = guid.left(2);
            xstring ret = xaserver::UploadFile(L"attachment" + str, guid + L".jpg", GetHWND(), L"", false);
            OnAddItem(ret, guid + L".jpg");
            return 1;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&BugListWin::OnXCommand);
            //获取焦点事件,用于重置工具条/sale/data/buglist/list/buglist"
            AttachEvent(L"WM_SETFOCUS", (FEvent)&BugListWin::OnSetFocus);
            AttachEvent(L"dw_list", L"DWV_ROWFOCUSCHANGED", (FEvent)&BugListWin::OnRowChanged);//绑定行更改触发事件OnRowChanged
            AttachEvent(L"note", L"HTC_OBJECTCLICKED", (FEvent)&BugListWin::OnHtmlClick);
            return 1;
        }
        int OnHtmlClick(TEvent* evt, int p)
        {
            ref  HTMLNMHDR p = evt.pnmh;
            const xstring d = m_Html.GetData(p.object);
            if (d == L"") return -1;
            xstring file = d.mid(0, d.find(L"|##@@|", 0));
            xstring name = d.mid(d.find(L"|##@@|", 0) + 6, d.length());
            xstring str = file.left(2);
            xstring ext = L"";
            if (name.find(L".") >= 0) ext = name.mid(name.find(L"."), name.length());
            xstring sfile = file.left(file.length() - 4);
            int openRet = xaserver::DownLoadFile(GetServerUrl(), L"/business/attachment/" + str + L"/" + file, L"", GetModuleTmpPath() + L"\\" + sfile + ext);
            if (openRet < 0)
            {
                alert(L"文件打开失败1!");
                return -1;
            }
            openRet = ShellExecute(0, L"open", GetModuleTmpPath() + L"\\" + sfile + ext, L"", L"", 5);
            if (openRet < 32)
            {
                alert(L"文件打开失败2!");
                return -1;
            }
            return -1;
        }
        int AppendItem(xml x, KXMLDOMElement r, xstring name, xstring value)
        {
            KXMLDOMElement e = x.createElement(name);
            e.text() = value;
            r.appendChild(e);
            return 1;
        }
        KXMLDOMElement getAtt(xstring source = L"", xstring file = L"")
        {
            xml x ;
            x.loadXML(L"<Attachment/>");
            KXMLDOMElement ele = x.documentElement();
            KXMLDOMElement e = x.createElement(L"item");
            e.setAttribute(L"name", source);
            e.setAttribute(L"file", file);
            ele.appendChild(e);
            return ele;
        }
        int OnAddItem(xstring source = L"", xstring file = L"")
        {
            xml x ;
            xaserverarg arg ;
            xstring value = m_Edit.GetText();
            if (value == L"")
            {
                if (source == L"")
                {
                    alert(L"请填写批注!");
                    return 1;
                }
            }
            x.loadXML(L"<Commentary update.new='1' update.modify='1'/>");
            KXMLDOMElement ele = x.documentElement();
            AppendItem(x, ele, L"CommentaryID", publiccode::GetGuid());
            AppendItem(x, ele, L"EntityID", m_EntityID);
            AppendItem(x, ele, L"EntityType", m_EntityType);
            AppendItem(x, ele, L"Remark", value);
            //AppendItem(x, ele, L"ParentConnect", m_EntityConnect);
            //AppendItem(x, ele, L"ParentCommentaryID", m_ConnectID);
            AppendItem(x, ele, L"CreatorID", xaserver::GetUserId());
            ele.appendChild(getAtt(source, file));
            arg.AddArg(L"content", L"<root>" + (xstring)ele.xml() + L"</root>");
            if (getUrl(L"/workflow/action/Commentary/bill.update", arg.GetString(), x) == 1)
            {
                m_Edit.SetText(L"");
                RetrieveNote(0);
                return 1;
            }
            else
            {
                alert(L"添加失败!");
                return -1;
            }
        }
        int  OnRetrieve()
        {
            xml x ;
            xaserverarg arg ;
            if (getUrl(L"/sale/data/BugList/list/buglist", arg.GetString(), x) != 1)
            {
                trace(x.text());
                return -1;
            }
            else
            {
                dw_list.Retrieve(x);
                dw_list.SetReadOnly(true);
                dw_list.Redraw();
                RetrieveNote(0);
            }
            return 1;
        }
        int onload()
        {
            dw_list = GetControl(L"dw_list");
            dw_list.openUrl(L"/sale/view/Developer/bug/list");
            m_Html = GetControl(L"note");
            m_Edit = GetControl(L"Txt");
            m_EntityID = L"";
            m_EntityType = L"BugList";
            dw_list.SetColumnState(L"BugListID", false);
            OnRetrieve();
            OnAttachEvent();
            return 1;
        }
        int onloaded()
        {
            SetAgent();
            return 1;
        }
    };
jrj/project/business/SystemSettings/Buglist.Developer.hxsoft_A.cpp
ÎļþÒÑɾ³ý
jrj/project/business/SystemSettings/Developer.Synch.cpp
@@ -93,13 +93,13 @@
                
                int hP2Item = 0;
                int hDomainItem = 0;
                if(xtreeview::GetParentItem(tv_gs.GetId(), hItem)<=0)
                if(tv_gs.GetParentItem(hItem)<=0)
                {
                    hDomainItem = hItem;
                }else
                {
                    hP2Item = GetP2Item(hItem);
                    hDomainItem =tv_gs.GetParentItem(tv_gs.GetId(), hP2Item);
                    hDomainItem =tv_gs.GetParentItem(hP2Item);
                }    
                //find project folder
jrj/project/business/SystemSettings/Organization.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,187 @@
#include <wobject/xstring.hpp>
#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"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) Organization : public xframe
    {
    public:
        xdwgrid    dw_list;
        xnode    m_agentNode;    //Agent Condition
    public:
        Organization(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static Organization* CreateInstance(void* implPtr, void* hWnd)
        {
            Organization* pWin = new Organization(implPtr, (HWND)hWnd);
            return pWin;
        }
        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;
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            xstring s = publiccode::GetUser().deptname;
            int hCursor = 0;
            xstring  userno = publiccode::GetUser().no;
            if (comdid == L"xmAdd")
            {
                xaserverarg arg ;
                arg.AddArg(L"HWND", xstring((__int64)GetHWND()));
                OpenWindow(L"dev:xpage[OrganizationBase.vx]", arg);
            }
            else if (comdid == L"xmDelete")
            {
                xstring CIDs = dw_list.GetGuid(dw_list.GetRow());
                int MB_OKCANCEL = 1;
                int IDOK = 1;
                int ret = MessageBox(GetHWND(), L"确认删除?", L"提示", MB_OKCANCEL);
                if (ret == IDOK)
                {
                    ViewObject::RetrieveData(L"/sale/data/business/delete/Organization", L"EntityID", CIDs);
                    OnRetrieve();
                }
            }
            if (comdid == L"xmEdit")
            {
                xaserverarg arg ;
                xstring ID = dw_list.GetGuid(dw_list.GetRow());
                arg.AddArg(L"ID", ID);
                arg.AddArg(L"HWND", xstring((__int64)GetHWND()));
                OpenWindow(L"dev:xpage[OrganizationBase.vx]", arg);
            }
            else if (comdid == L"xmRefresh")
            {
                OnRetrieve();
            }
            return 0;
        }
        //触发鼠标离开后tran事件,通过查找某个参数得到对应的列
        int OnBaseItemChanged(TEvent* evt, int p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            xstring colname = hdr.colname;
            xstring value = hdr.data;
            xstring dwname = L"dw_list";
            if (value != L"")
            {
                KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='" + dwname + L"']/trans[@for='" + colname + L"']");
                ViewObject::TransData(nlist, dw_list, hdr.row, colname, value);
            }
            return 1;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        int OnDoubleClicked(TEvent* evt, int p)
        {
            HCURSOR hCursor = xutil::SetCursorWait();
            OnCmdDispatch(L"xmEdit");
            xutil::RestoreCursor(hCursor);
            return 1;
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&Organization::OnXCommand);
            //获取焦点事件,用于重置工具条
            AttachEvent(L"WM_SETFOCUS", (FEvent)&Organization::OnSetFocus);
            AttachEvent(L"dw_list", L"DWV_ITEMCHANGED", (FEvent)&Organization::OnBaseItemChanged);
            AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&Organization::OnDoubleClicked);//行双击
            return 1;
        }
        int  OnRetrieve()
        {
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"QueryTxt",xcontrol(GetControl(L"search")).GetText());
            if (getUrl(L"/sale/data/business/OrganizationList", arg.GetString(), x) != 1)
            {
                trace(x.text());
                return -1;
            }
            else
            {
                dw_list.Retrieve(x);
                dw_list.Redraw();
                dw_list.SetReadOnly(true);
                dw_list.SetSelectionMode(1);
            }
            return 1;
        }
        int onload()
        {
            dw_list = GetControl(L"dw_list");
            dw_list.openUrl(L"/sale/view/Business3/template/OrganizationList");
            OnRetrieve();
            OnAttachEvent();
            return 1;
        }
        int onloaded()
        {
            SetAgent();
            return 1;
        }
    };
jrj/project/business/SystemSettings/OrganizationBase.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,189 @@
#include <wobject/xstring.hpp>
#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"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) OrganizationBase :  public xframe
    {
    public:
        HWND hObject = 0;
        xdwtable    dw_base;
        xnode    m_agentNode;    //Agent Condition
        bool updated;
    public:
        OrganizationBase(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static OrganizationBase* CreateInstance(void* implPtr, void* hWnd)
        {
            OrganizationBase* pWin = new OrganizationBase(implPtr, (HWND)hWnd);
            return pWin;
        }
        int SetAgent()
        {
            return 1;
            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;
        }
        int OnSave()
        {
            xml x ;
            xaserverarg arg ;
            dw_base.AcceptText();
            dw_base.DwUpdateAllTo(x);
            xstring error = L"";
            arg.AddArg(L"content", x.xml() );
            if(xurl::get(L"/sale/data/business/Update/Organization", arg.GetString(),x)!=1)
            {
                error = x.text();
                //alert(error);
            }else
            {
                xstring str = x.documentElement().getAttribute(L"text");
                if(str == L"true")
                {
                    dw_base.ResetUpdateStatus();
                    alert(L"保存成功!");
                    SendMessage(hObject,0x401,(LPARAM)L"xmRefresh",0);
                    CloseWindow();
                }else
                {
                    alert(L"保存失败!");
                }
                //alert(str);
            }
            return 1;
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            if(comdid==L"xmSave")
            {
                OnSave();
                return 1;
            }
            else if(comdid==L"xmClose")
            {
                if(updated)
                    SendMessage(hObject,0x401,(LPARAM)L"xmRefresh",0);
                CloseWindow();
                return 1;
            }
            return 0;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        int OnItemChanged(TEvent* evt, int p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            xstring colname=hdr.colname;
            xstring value = hdr.data;
            xstring dwname = L"dw_base";
            return 1;
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&OrganizationBase::OnXCommand);
            //获取焦点事件,用于重置工具条
            AttachEvent(L"WM_SETFOCUS", (FEvent)&OrganizationBase::OnSetFocus);
            AttachEvent(L"dw_base",L"DWV_ITEMCHANGED", (FEvent)&OrganizationBase::OnItemChanged);
            return 1;
        }
        int  OnRetrieve(xstring ID)
        {
            xml x ;
            xaserverarg arg ;
            arg.AddArg(L"ID",ID);
            if (getUrl(L"/sale/data/business/GetOrganizationByID",arg.GetString(),x)!=1)
            {
                trace(x.text());
                return -1;
            }else
            {
                dw_base.Retrieve(x);
                dw_base.Redraw();
            }
            return 1;
        }
        int onload()
        {
            SetArg();
            dw_base = GetControl(L"dw_base");
            dw_base.openUrl(L"/sale/view/Business3/template/OrganizationMaint");
            dw_base.SetColHeaderHeight(0);
            dw_base.SetRowSelectorWidth(0);
            dw_base.SetHScrollState(false);
            dw_base.SetVScrollState(false);
            xstring ID = L"";
            hObject = 0;
            if(GetWinParam())
            {
                xaserverarg arg =GetArg() ;
                ID = arg.GetArgString(L"ID");
                hObject = (HWND)arg.GetArgString(L"HWND").toInt();
            }
            if(ID != L"")
            {
                OnRetrieve(ID);
            }
            OnAttachEvent();
            updated = false;
            return 1;
        }
        int onloaded()
        {
            //SetAgent();
            return 1;
        }
    };
jrj/project/business/SystemSettings/Organization_A.cpp
ÎļþÒÑɾ³ý
jrj/project/business/SystemSettings/ProcessManagement.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,184 @@
#include <wobject/xstring.hpp>
#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"
using xml = KXMLDOMDocument;
    class __declspec(dllexport) ProcessManagement : public xframe
    {
    public:
        xdwgrid    dw_list;
        xnode    m_agentNode;    //Agent Condition
    public:
        ProcessManagement(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static ProcessManagement* CreateInstance(void* implPtr, void* hWnd)
        {
            ProcessManagement* pWin = new ProcessManagement(implPtr, (HWND)hWnd);
            return pWin;
        }
        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;
        }
        //命令发布函数
        int OnCmdDispatch(xstring comdid)
        {
            if (comdid == L"xmDelete")
            {
                int MB_OKCANCEL = 1;
                int IDOK = 1;
                int ret = MessageBox(GetHWND(), L"确认删除流程?", L"提示", MB_OKCANCEL);
                if (ret == IDOK)
                {
                    int row = dw_list.GetRow();
                    xstring TaskID = dw_list.GetItemString(row, L"TaskID");
                    xml x = ViewObject::RetrieveData(L"/sale/data/business/DelProcessManagement", L"TaskID", TaskID);
                    xstring status = x.xml();
                    if (status.find(L"ok") == 1)
                    {
                        alert(L"删除成功");
                        dw_list.DeleteRow(row);
                    }
                    else
                    {
                        alert(L"删除失败");
                    }
                }
                return 1;
            }
            else if (comdid == L"xmRefresh")
            {
                OnRetrieve();
            }
            else if (comdid == L"AA")
            {
                AA();
            }
            return 0;
        }
        int AA()
        {
            //xstring FobUnitPriceEx=dw_cell.GetItemString(row,colFOBPrice);
            xstring FobUnitPriceEx = L"$123.0";
            if (FobUnitPriceEx == L"$") FobUnitPriceEx = L"123";
            //alert(FobUnitPriceEx.find(L"$").toString());
            if (FobUnitPriceEx.find(L"$") >= 0) FobUnitPriceEx = FobUnitPriceEx.right(FobUnitPriceEx.length() - 1);
            trace(FobUnitPriceEx);
        }
        //触发鼠标离开后tran事件,通过查找某个参数得到对应的列
        int OnBaseItemChanged(TEvent* evt, int p)
        {
            DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
            xstring colname = hdr.colname;
            xstring value = hdr.data;
            xstring dwname = L"dw_list";
            if (value != L"")
            {
                KXMLDOMNodeList nlist = GetElement().selectNodes(L"//*[@name='" + dwname + L"']/trans[@for='" + colname + L"']");
                ViewObject::TransData(nlist, dw_list, hdr.row, colname, value);
            }
            return 1;
        }
        //命令处理事件
        int OnXCommand(TEvent* evt, LPARAM param)
        {
            return OnCmdDispatch(evt->xcommand.pStrID);
        }
        int OnAttachEvent()
        {
            //绑定工具条点击事件
            AttachEvent(L"WM_XCOMMAND", (FEvent)&ProcessManagement::OnXCommand);
            //获取焦点事件,用于重置工具条
            AttachEvent(L"WM_SETFOCUS", (FEvent)&ProcessManagement::OnSetFocus);
            AttachEvent(L"dw_list", L"DWV_ITEMCHANGED", (FEvent)&ProcessManagement::OnBaseItemChanged);
            return 1;
        }
        int  OnRetrieve()
        {
            xml x ;
            xaserverarg arg ;
            if (getUrl(L"/sale/data/business/ProcessManagement", arg.GetString(), x) != 1)
            {
                trace(x.text());
                return -1;
            }
            else
            {
                dw_list.Retrieve(x);
                dw_list.Redraw();
                dw_list.SetReadOnly(true);
                dw_list.SetSelectionMode(1);
            }
            return 1;
        }
        int onload()
        {
            dw_list = GetControl(L"dw_list");
            dw_list.openUrl(L"/sale/view/Business3/template/ProcessManagement");
            dw_list.SetColumnState(L"TaskID", false);
            OnRetrieve();
            OnAttachEvent();
            return 1;
        }
        int onloaded()
        {
            SetAgent();
            return 1;
        }
    };
jrj/project/business/SystemSettings/ProcessManagement_A.cpp
ÎļþÒÑɾ³ý