$PBExportHeader$w_ljfieb_cominfo.srw forward global type w_ljfieb_cominfo from w_publ_base end type type cb_save from uo_imflatbutton within w_ljfieb_cominfo end type type dw_1 from datawindow within w_ljfieb_cominfo end type type cb_reflash from uo_imflatbutton within w_ljfieb_cominfo end type end forward global type w_ljfieb_cominfo from w_publ_base integer width = 1650 integer height = 1692 string title = "" boolean minbox = false boolean center = true event ue_modpsw ( ) event ue_address ( ) cb_save cb_save dw_1 dw_1 cb_reflash cb_reflash end type global w_ljfieb_cominfo w_ljfieb_cominfo type variables s_ljfieb_cominfo s_org_info end variables forward prototypes public function integer wf_fromdw (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg) public function integer wf_fromdb (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg) public function integer wf_save (ref string arg_msg) end prototypes event ue_modpsw();OpenWithParm(w_ljfieb_modpsw, dw_1.Object.psw[dw_1.GetRow()]) s_ljfieb_modpsw s_rslt s_rslt = Message.PowerObjectParm IF s_rslt.ifok = 1 THEN dw_1.Object.newpsw[dw_1.GetRow()] = s_rslt.newpsw END IF end event event ue_address();s_view_dscrp s_view,s_return String ls_dscrp dw_1.AcceptText() ls_dscrp = dw_1.Object.Address[dw_1.GetRow()] s_view.Title = '地址' s_view.dscrp = ls_dscrp s_view.editmode = True OpenWithParm(w_view_dscrp,s_view) s_return = Message.PowerObjectParm dw_1.Object.Address[dw_1.GetRow()] = s_return.dscrp end event public function integer wf_fromdw (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg);Int rslt = 1 Long row row = dw_1.GetRow() IF row <= 0 THEN rslt = 0 arg_msg = '没有数据内容' GOTO ext END IF arg_cominfo.cusid = dw_1.Object.cusid[row] arg_cominfo.username = dw_1.Object.username[row] arg_cominfo.psw = dw_1.Object.psw[row] arg_cominfo.tele = dw_1.Object.tele[row] arg_cominfo.phone = dw_1.Object.phone[row] arg_cominfo.address = dw_1.Object.address[row] arg_cominfo.comcode = dw_1.Object.comcode[row] arg_cominfo.userid = dw_1.Object.userid[row] arg_cominfo.usercode = dw_1.Object.usercode[row] arg_cominfo.uploading = dw_1.Object.uploading[row] arg_cominfo.auditflag = dw_1.Object.auditflag[row] arg_cominfo.newpsw = dw_1.Object.newpsw[row] arg_cominfo.errmsg = dw_1.Object.errmsg[row] ext: RETURN rslt end function public function integer wf_fromdb (ref s_ljfieb_cominfo arg_cominfo, ref string arg_msg);Int rslt = 1 SELECT cusid, username, psw, tele, phone, address, comcode, userid, usercode, uploading, auditflag, newpsw, errmsg INTO :arg_cominfo.cusid, :arg_cominfo.username, :arg_cominfo.psw, :arg_cominfo.tele, :arg_cominfo.phone, :arg_cominfo.address, :arg_cominfo.comcode, :arg_cominfo.userid, :arg_cominfo.usercode, :arg_cominfo.uploading, :arg_cominfo.auditflag, :arg_cominfo.newpsw, :arg_cominfo.errmsg FROM LJFIEB_ComInfo Using sys_email_sqlca; IF sys_email_sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '查询企业注册信息失败,' + sys_email_sqlca.SQLErrText GOTO ext END IF ext: RETURN rslt end function public function integer wf_save (ref string arg_msg);Int rslt = 1 s_ljfieb_cominfo s_curinfo s_ljfieb_cominfo s_curdb dw_1.AcceptText() IF wf_fromdw(s_curinfo, arg_msg) <> 1 THEN rslt = 0 GOTO ext END IF IF wf_fromdb(s_curdb, arg_msg) <> 1 THEN rslt = 0 GOTO ext END IF IF s_curinfo.UserID = 0 THEN if s_curdb <> s_org_info then if s_curdb.UserID > 0 then rslt = 0 arg_msg = '' goto ext else end if end if ELSE END IF ext: IF rslt = 1 THEN COMMIT Using sys_email_sqlca; ELSE ROLLBACK Using sys_email_sqlca; END IF RETURN rslt end function on w_ljfieb_cominfo.create int iCurrent call super::create this.cb_save=create cb_save this.dw_1=create dw_1 this.cb_reflash=create cb_reflash iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_save this.Control[iCurrent+2]=this.dw_1 this.Control[iCurrent+3]=this.cb_reflash end on on w_ljfieb_cominfo.destroy call super::destroy destroy(this.cb_save) destroy(this.dw_1) destroy(this.cb_reflash) end on event open;call super::open;Int rslt = 1 String arg_msg = '' Long ll_cnt IF sys_email_sqlca.DBHandle() = 0 THEN rslt = 0 arg_msg = '未设置邮件数据库' GOTO ext END IF dw_1.SetTransObject(sys_email_sqlca) ll_cnt = dw_1.Retrieve() IF ll_cnt = 0 THEN rslt = 0 arg_msg = '通信后台服务未初始化,不能使用' GOTO ext END IF IF wf_fromdw(s_org_info, arg_msg) <> 1 THEN rslt = 0 GOTO ext END IF IF ll_cnt > 1 THEN rslt = 0 arg_msg = '注册信息异常,LJFIEB_ComInfo出现多条记录' GOTO ext END IF ext: IF rslt = 0 THEN MessageBox('ERROR', arg_msg) cb_exit.PostEvent(Clicked!) END IF end event type cb_func from w_publ_base`cb_func within w_ljfieb_cominfo boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_ljfieb_cominfo integer x = 1294 integer y = 1496 end type type cb_save from uo_imflatbutton within w_ljfieb_cominfo integer x = 969 integer y = 1496 integer width = 311 integer height = 96 integer taborder = 30 boolean bringtotop = true end type event clicked;call super::clicked;s_ljfieb_cominfo s_curinfo s_ljfieb_cominfo s_curdb dw_1.AcceptText() String arg_msg Int rslt = 1 IF wf_fromdw(s_curinfo, arg_msg) <> 1 THEN MessageBox('ERROR', arg_msg) RETURN END IF IF s_curinfo.username = '' THEN MessageBox('ERROR', '请输入企业名称') dw_1.SetColumn('username') dw_1.SetFocus() RETURN END IF IF s_curinfo.tele = '' THEN MessageBox('ERROR', '请输入固定电话') dw_1.SetColumn('tele') dw_1.SetFocus() RETURN END IF IF s_curinfo.phone = '' THEN MessageBox('ERROR', '请输入手机号码') dw_1.SetColumn('phone') dw_1.SetFocus() RETURN END IF IF s_curinfo.Address = '' THEN MessageBox('ERROR', '请输入地址') dw_1.SetColumn('address') dw_1.SetFocus() RETURN END IF IF s_curinfo.comcode = '' THEN MessageBox('ERROR', '请输入机构代码') dw_1.SetColumn('comcode') dw_1.SetFocus() RETURN END IF IF wf_fromdb(s_curdb, arg_msg) <> 1 THEN MessageBox('ERROR', arg_msg) RETURN END IF IF s_curdb <> s_org_info THEN MessageBox('ERROR', '注册信息已经发生改变,请刷新后再修改') RETURN END IF IF s_curdb.uploading = 2 THEN MessageBox('ERROR', '注册信息正在处理不能保存,请刷新后再修改') RETURN END IF IF s_curdb.UserID = 0 THEN IF s_curinfo.psw = '' THEN MessageBox('ERROR', '请输入密码') dw_1.SetColumn('psw') dw_1.SetFocus() RETURN END IF IF s_curinfo.newpsw <> s_curinfo.psw THEN MessageBox('ERROR', '确认密码与原密码不相符') dw_1.SetColumn('newpsw') dw_1.SetFocus() RETURN END IF UPDATE LJFIEB_ComInfo SET username = :s_curinfo.username, psw = :s_curinfo.psw, newpsw = :s_curinfo.newpsw, tele = :s_curinfo.tele, phone = :s_curinfo.phone, address = :s_curinfo.address, comcode = :s_curinfo.comcode, uploading = 1, auditflag = 0, errmsg = '' WHERE cusid = :s_org_info.cusid AND username = :s_org_info.username AND psw = :s_org_info.psw AND tele = :s_org_info.tele AND phone = :s_org_info.phone AND address = :s_org_info.address AND comcode = :s_org_info.comcode AND userid = :s_org_info.userid AND usercode = :s_org_info.usercode AND uploading = :s_org_info.uploading AND auditflag = :s_org_info.auditflag AND newpsw = :s_org_info.newpsw Using sys_email_sqlca; IF sys_email_sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '更新注册信息失败,' + sys_email_sqlca.SQLErrText GOTO ext END IF IF sys_email_sqlca.SQLNRows <> 1 THEN rslt = 0 arg_msg = '2.注册信息已经发生改变,请刷新后再修改' GOTO ext END IF ELSE UPDATE LJFIEB_ComInfo SET username = :s_curinfo.username, newpsw = :s_curinfo.newpsw, tele = :s_curinfo.tele, phone = :s_curinfo.phone, address = :s_curinfo.address, comcode = :s_curinfo.comcode, uploading = 1, auditflag = 0, errmsg = '' WHERE cusid = :s_org_info.cusid AND username = :s_org_info.username AND psw = :s_org_info.psw AND tele = :s_org_info.tele AND phone = :s_org_info.phone AND address = :s_org_info.address AND comcode = :s_org_info.comcode AND userid = :s_org_info.userid AND usercode = :s_org_info.usercode AND uploading = :s_org_info.uploading AND auditflag = :s_org_info.auditflag AND newpsw = :s_org_info.newpsw Using sys_email_sqlca; IF sys_email_sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '更新注册信息失败,' + sys_email_sqlca.SQLErrText GOTO ext END IF IF sys_email_sqlca.SQLNRows <> 1 THEN rslt = 0 arg_msg = '2.注册信息已经发生改变,请刷新后再修改' GOTO ext END IF END IF ext: IF rslt = 1 THEN COMMIT Using sys_email_sqlca; MessageBox('OK', '保存成功') Close(Parent) ELSE ROLLBACK Using sys_email_sqlca; MessageBox('ERROR', arg_msg) END IF end event type dw_1 from datawindow within w_ljfieb_cominfo integer x = 46 integer y = 20 integer width = 1545 integer height = 1428 integer taborder = 30 boolean bringtotop = true string title = "none" string dataobject = "dw_ljfieb_cominfo" boolean border = false boolean livescroll = true borderstyle borderstyle = stylelowered! end type event clicked;IF row <= 0 THEN RETURN IF dwo.Name = 'b_psw' THEN Parent.TriggerEvent('ue_modpsw') ELSEIF dwo.Name = 'p_1' THEN Parent.TriggerEvent('ue_address') END IF end event type cb_reflash from uo_imflatbutton within w_ljfieb_cominfo integer x = 178 integer y = 1496 integer width = 311 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "刷新" end type event clicked;call super::clicked;string arg_msg dw_1.Retrieve() IF wf_fromdw(s_org_info, arg_msg) <> 1 THEN MessageBox('ERROR', arg_msg) END IF end event