forward
global type server_win from window
end type
type dw_1 from datawindow within server_win
end type
type dw_3 from datawindow within server_win
end type
type p_1 from picture within server_win
end type
end forward
global type server_win from window
integer x = 837
integer y = 564
integer width = 2034
integer height = 1120
boolean titlebar = true
string title = "XXX管理系统XX版"
long backcolor = 15793151
boolean controlmenu = true
windowtype windowtype = popup!
dw_1 dw_1
dw_3 dw_3
p_1 p_1
end type
global server_win server_win
type variables
public string l_sr
public string l_ws
public string cname
public string xszcqk
public string cchp = ""
public string ccchp = ""
public string c_sr
public string wbxs = "wb"
public string yxs
public string cbb[5]={"A版","B版","C版","D版","E版"} '指注册成哪一种版本
public integer xhp
public integer zjzds
public integer xhb
public integer xhbb
public integer chp
public long xcrh
public long gsm
public boolean ook = false
end variables
forward prototypes
public function integer f_csh (string xx1,string xx2)
public subroutine f_cz ()
public function string f_save (string s_name,string s_value)
public subroutine f_xs (string xx1)
public function string f_xxs (string xx1,string xx2)
end prototypes
public function integer f_csh (string xx1,string xx2);integer m
integer n
integer l
string xx3
string xx4
string str
string xx6
string xx7
string xs
string xxs
string xx8
dsqlca = create transaction
dsqlca.dbms = "MSS Microsoft SQL Server 6.x"
dsqlca.database = "master"
dsqlca.logpass = spa
dsqlca.servername = xx1
dsqlca.logid = sua
dsqlca.autocommit = false
dsqlca.dbparm = ""
xs = f_csq(xx1,0)
label_1:
connect using dsqlca;
str = dsqlca.sqlerrtext
if dsqlca.sqldbcode <> 0 then
disconnect using dsqlca;
if messagebox("系统提示!",str + "-" + spa + "-" + sua + "-" + xx1 + "-" + "系统服务器未连接,继续连接吗?",question!,yesno!,1) = 2 then '如果连不上SQL数据库就会提示这个
return -1
goto label_0
end if
goto label_1
end if
label_0:
if xs <> wsname and xs <> cwsname then
m = 0
select count ( userid ) from operatorh WHERE lx =' ' and dbname =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :m
1-> :dklx[2]
2-> :wsname
3-> :xs
*/
commit using dsqlca;
if m > 0 then
messagebox("提示!","本站点已经注册。") '注册成功后再用对注册码就提示这个
return 1
end if
xx8 = ""
SELECT password FROM operatorh WHERE dbname =' ' and lx =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :xx8
1-> :xs
2-> :dklx[2]
3-> :xs
*/
commit using dsqlca;
if ((xx8 = "") or (isnull(xx8))) then
messagebox("提示!","请先注册服务器。")
return -1
end if
xx2 = xx8
else
if xs = cwsname then
wsname = cwsname
end if
SELECT dbname , userid , password , xming FROM operatorh WHERE lx =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :xx3
1-> :xx4
2-> :xxs
3-> :xx6
4-> :dklx[3]
5-> :xs
*/
l = dsqlca.sqlcode
str = dsqlca.sqlerrtext
if l = -1 then
disconnect using dsqlca;
messagebox("操作提示!","系统正在运行初始化,请稍候。")
goto label_1
end if
m = 0
select count ( userid ) from operatorh WHERE lx =' ' and dbname =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :m
1-> :dklx[2]
2-> :wsname
3-> :xs
*/
commit using dsqlca;
if m > 0 and xxs = xx2 then
messagebox("提示!","服务器已经注册。")
return -1
end if
if ((l = 100) or (pos(f_csq(xx2,1),"zcblk1218j") = 0)) then
xx3 = string(zcomp,"00") + "csq1218"
xx3 = f_csq(xx3,0)
xx4 = string(0,"00") + "12020917"
xx4 = f_csq(xx4,0)
xx6 = f_csq(xszcqk,0)
xx7 = gong_si_ming
delete operatorh where lx =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :dklx[3]
1-> :xs
*/
insert operatorh ( userid , password , dbname , lx , srname , xming , dwming ) values ( ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ) using dsqlca;
/* SQL Parameters List
0-> :xx4
1-> :xx2
2-> :xx3
3-> :dklx[3]
4-> :xs
5-> :xx6
6-> :xx7
*/
else
update operatorh set password =' ' where lx =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :xx2
1-> :dklx[3]
2-> :xs
*/
xszcqk = ""
end if
delete operatorh where lx =' ' and srname =' ' and dbname =' ' using dsqlca;
/* SQL Parameters List
0-> :dklx[2]
1-> :xs
2-> :xs
*/
if xszcqk = "" then
xszcqk = f_csq(xx6,1)
end if
commit using dsqlca;
bbbz = long(left(f_csq(xx2,1),2))
end if
SELECT dbname FROM operatorh WHERE srname =' ' and lx =' ' using dsqlca;
/* SQL Parameters List
0-> :xx3
1-> :xs
2-> :dklx[3]
*/
if dsqlca.sqlcode = 0 then
xx3 = left(xx3,12)
zcomp = long(f_csq(xx3,1))
end if
SELECT count ( userid ) FROM operatorh WHERE lx =' ' and srname =' ' using dsqlca;
/* SQL Parameters List
0-> :zjzds
1-> :dklx[2]
2-> :xs
*/
commit using dsqlca;
if zcomp <= zjzds then
messagebox("提示!","分配站点数:" + string(zcomp) + ",已注册站点数:" + string(zjzds) + ",请先在服务器中增加分配站点数。")
return -1
end if
xxs = bbbh
m = pos(xxs,".")
do while m > 0
xxs = replace(xxs,m,1,"_")
m = pos(xxs,".")
loop
public subroutine f_cz ();string xs
string xx1
string xx2
string xx3
string xx7
string str
string xlx
string xxs
long m
long n
long l
long h
datetime xrq
string cxx12[64]={"w2c","wme","spz","298","qw3","da4","c5r","h6d","m78","s8r","d9a","wha","xgb","c68","wd4","te6","7f8","sh8","hks","pma","jdn","kwS","kcx","mrt","nfs","p68","acx","f56","ry7","8s6","ktc","uer","xhw","2w6","xqw","y66","m54","af6","bh1","cw6","dh9","e24","fwe","gcf","her","kbb","jhx","kwp","lwb","mis","neh","a56","p26","qe9","ran","s88","t4w","uka","das","w68","xk5","yku","sdn","mdw"}
if xhb = 0 then
messagebox("提示!","没有修改信息或修改的信息已经保存确认。")
return
end if
if (((xxs <> "zcblk1218j" and xxs <> f_xxs(xx1,xx2)) or (m = 0)) or (xrq < datetime(today()))) then
messagebox("提示!","注册码不对,请申请正确的注册码。联系电话" + right(blgsm,dhmcd)) '注册码的长度正确(长度为21位)且注册组合符合(指第一位必须是0第二位必须数字后面的随便)如果达到这个条件的话会弹出这个对话框,否则点注册没反映 如果注册码正确,直接注册成功没有任何提示
dw_1.setitem(1,3,"01mdwzcblk1218jmdwmdw")'这段像是注册码,可是注册不成功,也没有说注册码不正确
dw_1.setfocus()
dw_1.setcolumn("ming_cheng")
return
end if
if m = 1 then
srname = xx1
szcqk = xszcqk
szcdm = xs
f_save("server",f_csq(srname,0))
dw_1.setitem(1,"by_qk",szcqk)
if pos(f_csq(szcdm,1),"zcblk1218j") > 0 then
dw_1.setitem(1,3,f_csq(szcdm,1))
else
dw_1.setitem(1,3,left(f_csq(szcdm,1),2))
end if
end if
end subroutine
public function string f_save (string s_name,string s_value);string s_path
s_path = "HKEY_CURRENT_USER\Software\blypgsp" + crhzcb + "\"
ssrname = c_sr
registryset(s_path,s_name,regstring!,s_value)
registryset(s_path,"cserver",regstring!,f_csq(ssrname,0))
registryset(s_path,"spe",regstring!,spe)
registryset(s_path,"spa",regstring!,spa)
return ""
end function
public subroutine f_xs (string xx1);xhp = 0
ook = false
if ((xx1 = l_ws) or (xx1 = l_ws + "\blkj")) then
ook = true
xhp = 1
end if
dw_1.object.t1.visible = ook
dw_1.object.t2.visible = ook
dw_1.object.t3.visible = ook
dw_1.object.sjk.visible = ook
dw_1.object.gzz.visible = ook
dw_1.object.sjkt.visible = ook
dw_1.object.gzzt.visible = ook
dw_1.object.ming_cheng.visible = ook
dw_1.object.db.visible = ook
dw_1.object.by_qk.visible = ook
dw_1.object.bb.visible = not ook
dw_1.object.bb_t.visible = not ook
if not ook then
dw_1.settaborder("bb",30)
end if
end subroutine
public function string f_xxs (string xx1,string xx2);integer m
integer n
integer l
integer j
string xx3
string xx4
string xx5
if szcdm = "" then
xhb = 1
gsm = 0
dw_1.setitem(1,3,"01mdwzcblk1218jmdwmdw")
else
if pos(crhzcm,"产品") > 0 then
bbbz = 1
szcdm = f_csq(szcdm,1)
szcdm = "01" + right(szcdm,len(szcdm) - 2)
szcdm = f_csq(szcdm,0)
end if
if pos(f_csq(szcdm,1),"zcblk1218j") > 0 then
dw_1.setitem(1,3,f_csq(szcdm,1))
gsm = 0
else
dw_1.setitem(1,3,left(f_csq(szcdm,1),2))
gsm = 1
end if
end if
dw_1.setitem(1,4,f_crh(string(dkvalue),0))
dw_1.setitem(1,5,szcqk)
dw_1.setfocus()
dw_1.setcolumn(1)
return
end event
type dw_1 from datawindow within server_win
event enterkey pbm_dwnprocessenter
event mmv pbm_mousemove
integer width = 1705
integer height = 944
integer taborder = 20
string dataobject = "blsrlr_dw"
borderstyle borderstyle = styleraised!
boolean livescroll = true
end type
event enterkey;if parent.cchp <> parent.ccchp and parent.cchp <> "" then
if ((((long(left(parent.cchp,2)) < 1) or (long(left(parent.cchp,2)) > 5)) or (long(left(parent.ccchp,2)) < 1)) or (long(left(parent.ccchp,2)) > 5)) then
if parent.chp = 4 then
close(server_win)
end if
return
end if
if messagebox("操作提示!","注册版本由:“" + parent.cbb[long(left(parent.cchp,2))] + "” 修改为:“" + parent.cbb[long(left(parent.ccchp,2))] + "” ,确认保存吗?",question!,yesno!,2) = 2 then
setitem(1,3,parent.cchp)
parent.cchp = ""
parent.cchp = ""
else
parent.xhb = 1
parent.f_cz()
setitem(1,3,parent.ccchp)
parent.cchp = ""
parent.ccchp = ""
end if
end if
if getcolumn() = 2 and parent.xhp = 0 then
if not parent.ook then
setcolumn(6)
else
setcolumn(1)
end if
return
else
if getcolumn() = 6 then
setcolumn(1)
return
else
if getcolumn() = 3 then
setcolumn(1)
return
end if
end if
end if
setcolumn(getcolumn() + 1)
return
end event
event mmv;parent.chp = 0
if xpos >= long(object.sjk.x) and xpos <= long(object.sjk.x) + long(object.sjk.width) and ypos >= long(object.sjk.y) and ypos <= long(object.sjk.y) + long(object.sjk.height) then
parent.dw_1.object.sjk.filename = (ppath + "qrzc.bmp")
parent.chp = 1
else
parent.dw_1.object.sjk.filename = (ppath + "qr.bmp")
end if
if xpos >= long(object.gzz.x) and xpos <= long(object.gzz.x) + long(object.gzz.width) and ypos >= long(object.gzz.y) and ypos <= long(object.gzz.y) + long(object.gzz.height) then
parent.dw_1.object.gzz.filename = (ppath + "qrzc.bmp")
parent.chp = 2
else
parent.dw_1.object.gzz.filename = (ppath + "qr.bmp")
end if
if xpos >= long(object.qr.x) and xpos <= long(object.qr.x) + long(object.qr.width) and ypos >= long(object.qr.y) and ypos <= long(object.qr.y) + long(object.qr.height) then
parent.dw_1.object.qr.filename = (ppath + "qrzc.bmp")
parent.chp = 3
else
parent.dw_1.object.qr.filename = (ppath + "qr.bmp")
end if
if xpos >= long(object.qx.x) and xpos <= long(object.qx.x) + long(object.qx.width) and ypos >= long(object.qx.y) and ypos <= long(object.qx.y) + long(object.qx.height) then
parent.dw_1.object.qx.filename = (ppath + "qrzc.bmp")
parent.chp = 4
else
parent.dw_1.object.qx.filename = (ppath + "qr.bmp") '这些xx.bmp是程序运行后调用的一些图片
end if
return
end event
event clicked;double n
accepttext()
if parent.cchp <> parent.ccchp and parent.cchp <> "" then
if ((((long(left(parent.cchp,2)) < 1) or (long(left(parent.cchp,2)) > 5)) or (long(left(parent.ccchp,2)) < 1)) or (long(left(parent.ccchp,2)) > 5)) then
if parent.chp = 4 then
close(server_win)
end if
return
end if
if messagebox("操作提示!","注册版本由:“" + parent.cbb[long(left(parent.cchp,2))] + "” 修改为:“" + parent.cbb[long(left(parent.ccchp,2))] + "” ,确认保存吗?",question!,yesno!,2) = 2 then
setitem(1,3,parent.cchp)
parent.cchp = ""
parent.cchp = ""
else
parent.xhb = 1
parent.f_cz()
setitem(1,3,parent.ccchp)
parent.cchp = ""
parent.ccchp = ""
end if
end if
n = double(right(szcqk,len(szcqk) - 17))
if ((szcdm <> "" and pos(f_csq(szcdm,1),"zcblk1218j") > 0) or (szcdm = "")) and n = cshzs + 1 then
n = -100
end if
parent.dw_1.setcolumn(1)
if parent.chp = 1 and parent.xhp = 1 and n <> -100 then
crhwn[190] = "regdb_win"
mt[190] = "数据库维护"
openwithparm(crhwd[190],mt[190],crhwn[190])
return
end if
if parent.chp = 2 and parent.xhp = 1 then
open(register_win)
return
end if
if parent.chp = 3 then
if szcdm = "" then
if messagebox("操作提示!","注册版本已经录入,确认保存吗?",question!,yesno!,2) = 2 then
return
end if
else
parent.xhb = 0
return
end if
parent.f_cz()
return
end if
if parent.chp = 4 then
close(server_win)
return
end if
return
end event
event doubleclicked;return
return
end event
event editchanged;if getcolumn() = 1 then
if (((f_csq(wsname,1) <> parent.dw_1.getitemstring(1,2)) or (bbbz = 5)) or (parent.gsm = 1)) then
setitem(1,1,getitemstring(1,1))
return
else
parent.xhbb = 1
end if
else
if getcolumn() = 2 then
parent.l_sr = lower(gettext())
parent.f_xs(parent.l_sr)
if not parent.ook then
setitem(1,6,parent.l_sr)
parent.c_sr = parent.l_sr
end if
else
if getcolumn() = 6 then
parent.c_sr = lower(gettext())
else
if getcolumn() = 3 then
if szcdm <> "" and pos(f_csq(szcdm,1),"zcblk1218j") = 0 then
setitem(1,3,getitemstring(1,3))
return
end if
end if
end if
end if
end if
parent.xhb = 1
return
end event
event itemchanged;if getcolumn() = 1 and parent.xhbb = 1 then
if messagebox("操作提示!","公司名已经修改,确认保存吗?",question!,yesno!,2) = 2 then
setitem(1,1,getitemstring(1,1))
return 2
end if
parent.xhb = 1
parent.f_cz()
else
if getcolumn() = 3 then
if pos(crhzcm,"产品") > 0 and left(data,2) <> "01" then
setitem(1,3,getitemstring(1,3))
return 2
end if
if ((szcdm <> "" and pos(f_csq(szcdm,1),"zcblk1218j") = 0) or (long(right(szcqk,2)) = cshzs)) then
setitem(1,3,getitemstring(1,3))
return 2
end if
if parent.cchp = "" then
parent.cchp = getitemstring(1,3)
end if
parent.ccchp = gettext()
else
parent.xhb = 1
end if
end if
return
end event
event itemerror;return 2
return
end event
type dw_3 from datawindow within server_win
event enterkey pbm_dwnprocessenter
integer x = 1504
integer y = 232
integer width = 1778
integer height = 880
integer taborder = 30
boolean visible = false
string dataobject = "blzdlr_dw"
borderstyle borderstyle = stylelowered!
boolean hscrollbar = true
boolean vscrollbar = true
boolean hsplitscroll = true
boolean livescroll = true
end type
event doubleclicked;return
return
end event
type p_1 from picture within server_win
integer width = 1545
integer height = 836
integer taborder = 10
boolean visible = false
string picturename = "c:\xxx\1.bmp"
boolean border = true
borderstyle borderstyle = stylelowered!
boolean focusrectangle = false
end type