$PBExportHeader$w_login.srw forward global type w_login from window end type type p_2 from picture within w_login end type type p_1 from picture within w_login end type type cb_2 from commandbutton within w_login end type type cb_1 from commandbutton within w_login end type type st_2 from statictext within w_login end type type st_1 from statictext within w_login end type type sle_2 from singlelineedit within w_login end type type sle_1 from singlelineedit within w_login end type end forward global type w_login from window integer width = 1838 integer height = 1148 boolean titlebar = true string title = "用户登录" windowtype windowtype = response! long backcolor = 16777215 string icon = "AppIcon!" boolean center = true p_2 p_2 p_1 p_1 cb_2 cb_2 cb_1 cb_1 st_2 st_2 st_1 st_1 sle_2 sle_2 sle_1 sle_1 end type global w_login w_login type variables long ins_rslt/////////// end variables on w_login.create this.p_2=create p_2 this.p_1=create p_1 this.cb_2=create cb_2 this.cb_1=create cb_1 this.st_2=create st_2 this.st_1=create st_1 this.sle_2=create sle_2 this.sle_1=create sle_1 this.Control[]={this.p_2,& this.p_1,& this.cb_2,& this.cb_1,& this.st_2,& this.st_1,& this.sle_2,& this.sle_1} end on on w_login.destroy destroy(this.p_2) destroy(this.p_1) destroy(this.cb_2) destroy(this.cb_1) destroy(this.st_2) destroy(this.st_1) destroy(this.sle_2) destroy(this.sle_1) end on event open;ins_rslt = 0 end event event close;closewithreturn(this, ins_rslt) end event type p_2 from picture within w_login integer x = 1454 integer y = 552 integer width = 73 integer height = 64 string pointer = "HyperLink!" boolean originalsize = true string picturename = "HELP.BMP" boolean focusrectangle = false end type event clicked;open(w_about) end event type p_1 from picture within w_login integer width = 1829 integer height = 504 boolean originalsize = true string picturename = "login_logo.bmp" boolean focusrectangle = false end type type cb_2 from commandbutton within w_login integer x = 1138 integer y = 860 integer width = 302 integer height = 120 integer taborder = 40 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "退出" end type event clicked;close(parent) end event type cb_1 from commandbutton within w_login integer x = 517 integer y = 860 integer width = 302 integer height = 120 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "登录" end type event clicked;Int rslt = 1 String arg_Msg = '' IF sle_1.Text = '' THEN rslt = 0 arg_Msg = '请输入用户名' sle_1.SetFocus() GOTO ext END IF IF app_token = '' THEN app_token = AppCom.GetToken() IF app_token = '' THEN rslt = 0 arg_Msg = '与服务器建立会话失败' GOTO ext END IF END IF oleobject lo_dict, lo_rslt lo_dict = AppCom.CreatePbDictionary() lo_dict.SetString('token', app_token) lo_dict.SetString('usercode', sle_1.Text) lo_dict.SetString('psw', sle_2.Text) lo_rslt = AppCom.Login(lo_dict, Ref arg_Msg) IF arg_Msg <> '' THEN rslt = 0 arg_Msg = '登录失败,' + arg_Msg GOTO ext END IF app_cusid = lo_rslt.GetInt('cusid') app_cuscode = lo_rslt.GetString('cuscode') app_cusname = lo_rslt.GetString('cusname') app_username = lo_rslt.GetString('username') app_custype = lo_rslt.GetString('custype') app_tele = lo_rslt.GetString('tele') app_address = lo_rslt.GetString('address') app_freight = lo_rslt.GetString('freight') app_freight_tele = lo_rslt.GetString('freight_tele') ext: IF rslt = 1 THEN ins_rslt = 1 app_login = true Close(Parent) ELSE MessageBox('ERROR', arg_Msg) END IF end event type st_2 from statictext within w_login integer x = 288 integer y = 728 integer width = 206 integer height = 48 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 string text = "密码" alignment alignment = right! boolean focusrectangle = false end type type st_1 from statictext within w_login integer x = 288 integer y = 560 integer width = 206 integer height = 48 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 string text = "用户名" alignment alignment = right! boolean focusrectangle = false end type type sle_2 from singlelineedit within w_login event ue_dwnkey pbm_keydown integer x = 512 integer y = 712 integer width = 919 integer height = 84 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean password = true borderstyle borderstyle = stylelowered! end type event ue_dwnkey;if keydown(keyenter!) then cb_1.TriggerEvent(clicked!) end if end event type sle_1 from singlelineedit within w_login event ue_dwnkey pbm_keydown integer x = 512 integer y = 544 integer width = 919 integer height = 84 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type event ue_dwnkey;if keydown(keyenter!) then sle_2.SetFocus() end if end event