LiFan
2024-07-17 bf115a00a40d3af1fae7521d38b9b2ca70fcc161
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
use "xcontrol.vframe.vbusiness.vd"
use "xbase.vframe.vbusiness.vd"
use "base.view.vd"
 
unit vbusiness
[
    class SysLoginRecord : public frame
    {
        xdwgrid  dw_logrecord;        
        xdwtable dw_arg;
        int OnRetrieve()
            {
                xcontrol xc_text =GetControl("QueryTxt");                
                xcontrol xc_cbx = GetControl("cbx_type");                
                string ls_querytxt;
                string ls_querytype;
                ls_querytxt =   xc_text.GetText();
                ls_querytype = xc_cbx.GetText();
                xml x = new xml;
                x.setNativePointer(x.CreateInstance());
                xaserverarg arg = new xaserverarg;
                arg.setNativePointer(arg.CreateInstance());
                arg.AddArg("sType",ls_querytype);
                arg.AddArg("QueryText",ls_querytxt);
                arg.AddArg("QueryArg",GetQueryArg());
                //alert(ls_querytxt);
                if (url::get("/sale/data/Total3/total/GDNTotal/Item/GetSysLoginLog",arg.GetString(),x) == 1)
                {
                    //trace(x.GetXml());
                    dw_logrecord.Retrieve(x);
                    dw_logrecord.Redraw();
                    dw_logrecord.SetSelectionMode(1);
                }
                else
                    alert("²é²»µ½");                
                return 1;
            }
            //ÃüÁî·¢²¼º¯Êý
            int OnCmdDispatch(string comdid)
            {
                int hCursor = xutil::SetCursorWait();
                if(comdid=="ContSearch")
                    OnRetrieve();
                return 0;
            }
            
            //ÃüÁî´¦Àíʼþ
            int OnXCommand(ref TXCommandEvent evt,int p)
            {
                return OnCmdDispatch(evt.pStrID);
            }
                
                string GetQueryArg()
        {
            dw_arg.AcceptText();
            xml x = new xml;
            x.setNativePointer(xml::CreateInstance());
            dw_arg.DwUpdateAllTo(x.GetXmlDoc());
            return x.GetXml();
        }    
                        
                        
            int OnAttachEvent()
            {
                AttachEvent("WM_XCOMMAND",OnXCommand);
                return 1;
            }
        
        int onload()
        {
            dw_logrecord = GetControl("dw_logrecord");
            dw_logrecord.openUrl("/sale/view/SysUser/template/SysLoginRecord");
            dw_arg = GetControl("dw_arg");
            dw_arg.openUrl("/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("xxx");
                OnAttachEvent();
                //OnRetrieve();
                return 1;
            }            
    };
]