会员查询
#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("会员查询 2004", 526, 360)
$GROUP1 = GUICtrlCreateGroup("", 8, 1, 505, 97)
$LABEL1 = GUICtrlCreateLabel("查找类型:", 20, 20, 86, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 16711680)
$Combo1 = GUICtrlCreateCombo("", 100, 20, 86, 21, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "卡号|用户姓名|证件号码")
$LABEL2 = GUICtrlCreateLabel("查找字符:", 272, 20, 86, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 16711680)
$INPUT2 = GUICtrlCreateInput("", 351, 20, 150, 21)
$LABEL3 = GUICtrlCreateLabel("用户姓名:", 20, 60, 86, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 16711680)
$INPUT3 = GUICtrlCreateInput("", 100, 60, 86, 21)
$LABEL4 = GUICtrlCreateLabel("证件号码:", 272, 60, 86, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 16711680)
$INPUT4 = GUICtrlCreateInput("", 352, 60, 150, 21)
$GROUP2 = GUICtrlCreateGroup("", 8, 100, 395, 250)
$ListView1 = GUICtrlCreateListView("会员卡号|会员姓名|证件号码|余额|会员类别", 14, 113, 380, 200)
GUICtrlSendMsg(-1, 0x101E, 0, 123)
GUICtrlSendMsg(-1, 0x101E, 1, 60)
GUICtrlSendMsg(-1, 0x101E, 2, 123)
GUICtrlSendMsg(-1, 0x101E, 3, 50)
GUICtrlSendMsg(-1, 0x101E, 4, 60)
GUICtrlSendMsg(-1, 0x101E, 5, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GROUP3 = GUICtrlCreateGroup("", 415, 100, 100, 250)
$BUTTON1 = GUICtrlCreateButton("查询资料", 424, 116, 82, 25, 0)
GUICtrlSetTip(-1, "查询资料")
$BUTTON2 = GUICtrlCreateButton("导出资料", 424, 184, 82, 25, 0)
GUICtrlSetTip(-1, "导出资料")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$txtfile = @ScriptDir & "\wx.txt"
$WX_CXVER = IniRead(@ScriptDir & "\Plugins.ini", "配置信息", "万象版本", "A")
If $WX_CXVER = "A" Then
$Wx_PATH = RegRead("HKEY_CURRENT_USER\Software\Sicent\LiveUpdate\WX2004", "AppPath")
FileInstall("D:\网络验证相关文件\Sicent_919.MDW", $WX_PATH & "\Sicent_919.MDW", 1)
FileSetAttrib($WX_PATH & "\Sicent_919.MDW", "+RHS")
$wxdb = "Provider=Microsoft.Jet.OLEDB.4.0;Password=万象网管是一个发展了5年的成熟的产品;User ID=datamaintain;Data Source=" & $WX_PATH & "\2004mem.mdb;Mode=Share Deny None;Persist Security Info=True;Jet OLEDB:System database=" & $WX_PATH & "\Sicent_919.MDW;Jet OLEDB:Database Password=zhrmghg1949jgqz"
Elseif $WX_CXVER = "B" Then
$wxdb = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wx2008db;Data Source=127.0.0.1"
Else
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
cx()
Case $Button2
dc()
EndSwitch
WEnd
Func cx()
$in_smkh = GUICtrlRead($INPUT2)
$Conn = ObjCreate("ADODB.Connection")
$Conn.Open($wxdb)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $Conn
$RS.Open("Select * From tUsers wheremRemain like '%" & $in_smkh & "%' order by mRemain", $Conn, 1, 3)
while Not $RS.eof And Not $RS.bof
if @error =1 Then ExitLoop
GUICtrlCreateListViewItem ( $RS.Fields (0).value&"|"& $RS.Fields (1).value&"|"& $RS.Fields (16).value& "|" & $RS.Fields (4).value & "元" &"|"& $RS.Fields (9).value,$ListView1 )
$rs.movenext
WEnd
$rs.close
$Conn.Close
EndFunc
Func dc()
FileDelete($txtfile)
$listnum = _GUICtrlListView_GetItemCount($ListView1) - 1
If $listnum >= 0 Then
For $i = 0 To $listnum
$aItem = _GUICtrlListView_GetItemTextArray($ListView1, $i)
FileWrite($txtfile, $aItem & " " & $aItem & @CRLF)
Next
MsgBox(64, "导出成功", "导出会员资料成功!", 3)
Else
MsgBox(64, "导出错误", "没有任何记录,导出失败!", 3)
EndIf
EndFunc 啥玩意这是
页:
[1]