xj qian
2024-07-17 b1d01ea6fa62ce12c2e592b3315186f6b3c8359d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <wobject/xstring.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <wobject/xdouble.hpp>
#include <xcontrol/xlayersheet.hpp>
#include <xcontrol/xdatetimepick.hpp>
 
 
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
 
using xml = KXMLDOMDocument;
    class __declspec(dllexport)  SysLoginRecord : public xframe
    {
    public:
        xdwgrid  dw_logrecord;        
        xdwtable dw_arg;
    public:
        SysLoginRecord(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
    public:
        static SysLoginRecord* CreateInstance(void* implPtr, void* hWnd)
        {
            SysLoginRecord* pWin = new SysLoginRecord(implPtr, (HWND)hWnd);
            return pWin;
        }
        int OnRetrieve()
            {
                xcontrol xc_text =GetControl(L"QueryTxt");                
                xcontrol xc_cbx = GetControl(L"cbx_type");                
                xstring ls_querytxt;
                xstring ls_querytype;
                ls_querytxt =   xc_text.GetText();
                ls_querytype = xc_cbx.GetText();
                xml x ;
                xaserverarg arg ;
                arg.AddArg(L"sType",ls_querytype);
                arg.AddArg(L"QueryText",ls_querytxt);
                arg.AddArg(L"QueryArg",GetQueryArg());
                //alert(ls_querytxt);
                if (xurl::get(L"/sale/data/Total3/total/GDNTotal/Item/GetSysLoginLog",arg.GetString(),x) == 1)
                {
                    //trace(x.xml());
                    dw_logrecord.Retrieve(x);
                    dw_logrecord.Redraw();
                    dw_logrecord.SetSelectionMode(1);
                }
                else
                    alert(L"²é²»µ½");                
                return 1;
            }
            //ÃüÁî·¢²¼º¯Êý
            int OnCmdDispatch(xstring comdid)
            {
                HCURSOR hCursor = xutil::SetCursorWait();
                if(comdid==L"ContSearch")
                    OnRetrieve();
                return 0;
            }
            
            //ÃüÁî´¦Àíʼþ
            int OnXCommand(TEvent* evt, LPARAM param)
            {
                return OnCmdDispatch(evt->xcommand.pStrID);
            }
                
                xstring GetQueryArg()
        {
            dw_arg.AcceptText();
            xml x ;
            
            dw_arg.DwUpdateAllTo(x);
            return x.xml();
        }    
                        
                        
            int OnAttachEvent()
            {
                AttachEvent(L"WM_XCOMMAND", (FEvent)&SysLoginRecord::OnXCommand);
                return 1;
            }
        
        int onload()
        {
            dw_logrecord = GetControl(L"dw_logrecord");
            dw_logrecord.openUrl(L"/sale/view/SysUser/template/SysLoginRecord");
            dw_arg = GetControl(L"dw_arg");
            dw_arg.openUrl(L"/sale/view/AR/template/queryarg");
            dw_arg.SetColHeaderHeight(0);
            dw_arg.SetRowSelectorWidth(0);
            dw_arg.SetHScrollState(false);
            dw_arg.SetVScrollState(false);
            return 0;
        }
        int onloaded()
        {
                //alert(L"xxx");
                OnAttachEvent();
                //OnRetrieve();
                return 1;
            }            
    };