⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w_change_password.srw

📁 用pb(power builder)制作的医院管理系统 附有数据库脚本
💻 SRW
字号:
$PBExportHeader$w_pass.srw
forward
global type w_pass from window
end type
type sle_name from singlelineedit within w_pass
end type
type st_4 from statictext within w_pass
end type
type cb_cancel from commandbutton within w_pass
end type
type cb_yes from commandbutton within w_pass
end type
type sle_new_pass1 from singlelineedit within w_pass
end type
type st_3 from statictext within w_pass
end type
type sle_new_pass from singlelineedit within w_pass
end type
type sle_old_pass from singlelineedit within w_pass
end type
type st_2 from statictext within w_pass
end type
type st_1 from statictext within w_pass
end type
end forward

global type w_pass from window
integer width = 1765
integer height = 1488
boolean titlebar = true
string title = "密码修改"
boolean controlmenu = true
boolean minbox = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
sle_name sle_name
st_4 st_4
cb_cancel cb_cancel
cb_yes cb_yes
sle_new_pass1 sle_new_pass1
st_3 st_3
sle_new_pass sle_new_pass
sle_old_pass sle_old_pass
st_2 st_2
st_1 st_1
end type
global w_pass w_pass

on w_pass.create
this.sle_name=create sle_name
this.st_4=create st_4
this.cb_cancel=create cb_cancel
this.cb_yes=create cb_yes
this.sle_new_pass1=create sle_new_pass1
this.st_3=create st_3
this.sle_new_pass=create sle_new_pass
this.sle_old_pass=create sle_old_pass
this.st_2=create st_2
this.st_1=create st_1
this.Control[]={this.sle_name,&
this.st_4,&
this.cb_cancel,&
this.cb_yes,&
this.sle_new_pass1,&
this.st_3,&
this.sle_new_pass,&
this.sle_old_pass,&
this.st_2,&
this.st_1}
end on

on w_pass.destroy
destroy(this.sle_name)
destroy(this.st_4)
destroy(this.cb_cancel)
destroy(this.cb_yes)
destroy(this.sle_new_pass1)
destroy(this.st_3)
destroy(this.sle_new_pass)
destroy(this.sle_old_pass)
destroy(this.st_2)
destroy(this.st_1)
end on

type sle_name from singlelineedit within w_pass
integer x = 699
integer y = 48
integer width = 457
integer height = 128
integer taborder = 10
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type

type st_4 from statictext within w_pass
integer x = 347
integer y = 80
integer width = 325
integer height = 72
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "用户名:"
boolean focusrectangle = false
end type

type cb_cancel from commandbutton within w_pass
string tag = "4"
integer x = 983
integer y = 1016
integer width = 457
integer height = 128
integer taborder = 60
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "取消(&C)"
boolean cancel = true
end type

event clicked;int i
i=messagebox("退出","确实要退出吗?",question!,yesno!)
if i=1 then
	close(w_pass)
end if
end event

type cb_yes from commandbutton within w_pass
string tag = "3"
integer x = 361
integer y = 1016
integer width = 457
integer height = 128
integer taborder = 50
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "确定(&Y)"
boolean default = true
end type

event clicked;//定义两个变量
string mima,usename

//数据库连接参数
sqlca.dbms="odbc"
sqlca.autocommit=false
sqlca.dbparm="connectstring='dsn=bookdatabase'"

//连接数据库
connect;

//检索用户名和密码记录
select sys_user.user_name,
       sys_user.password
into :usename,
     :mima
from sys_user
where sys_user.user_name=:sle_name.text;

//判断用户输入的用户名是否正确
if sle_name.text="" or sle_old_pass.text="" or sle_new_pass.text="" or sle_new_pass1.text="" or sle_new_pass.text<> sle_new_pass1.text then
    messagebox("错误!","用户名或密码不能为空,并且新密码不能两次输入相同!",information!,ok!,2)
else 
	if usename=sle_name.text and mima=sle_old_pass.text then
		//修改用户的密码
		update "sys_user"
		set "password"=:sle_new_pass1.text
		where "sys_user"."user_name"=:sle_name.text;
		messagebox("密码修改成功!","请记住新密码,下次登录时请使用新密码!",information!,ok!,2)
				else
				    messagebox("错误!","用户名或密码错误,请重新输入!",exclamation!,ok!,2)
				end if
			end if 
close(w_pass)			
end event

type sle_new_pass1 from singlelineedit within w_pass
string tag = "2"
integer x = 695
integer y = 716
integer width = 457
integer height = 128
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean password = true
borderstyle borderstyle = stylelowered!
end type

type st_3 from statictext within w_pass
integer x = 206
integer y = 732
integer width = 462
integer height = 96
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "新密码确认:"
boolean focusrectangle = false
end type

type sle_new_pass from singlelineedit within w_pass
string tag = "1"
integer x = 699
integer y = 484
integer width = 457
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean password = true
borderstyle borderstyle = stylelowered!
end type

type sle_old_pass from singlelineedit within w_pass
string tag = "1"
integer x = 690
integer y = 244
integer width = 457
integer height = 132
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean password = true
borderstyle borderstyle = stylelowered!
end type

type st_2 from statictext within w_pass
integer x = 357
integer y = 516
integer width = 306
integer height = 72
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "新密码:"
boolean focusrectangle = false
end type

type st_1 from statictext within w_pass
integer x = 352
integer y = 276
integer width = 311
integer height = 72
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "原密码:"
boolean focusrectangle = false
end type

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -