$PBExportHeader$w_unit_def.srw forward global type w_unit_def from w_publ_edit_choice end type type cb_view from uo_imflatbutton within w_unit_def end type end forward global type w_unit_def from w_publ_edit_choice integer width = 1819 integer height = 1544 string title = "单位" boolean minbox = true windowtype windowtype = popup! cb_view cb_view end type global w_unit_def w_unit_def on w_unit_def.create int iCurrent call super::create this.cb_view=create cb_view iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_view end on on w_unit_def.destroy call super::destroy destroy(this.cb_view) end on type cb_func from w_publ_edit_choice`cb_func within w_unit_def end type type cb_exit from w_publ_edit_choice`cb_exit within w_unit_def end type type cb_add from w_publ_edit_choice`cb_add within w_unit_def end type event cb_add::clicked;call super::clicked;if not f_power_ind(667) then messagebox('提示','你没有使用权限!', Information!, OK! ) return end if long ll_newid,i string errmsg IF dw_edit_mode THEN dw_uc.accepttext() if dw_uc.GetNextModified(0, Primary!)=0 then MESSAGEBOX('提示','没有任何修改,不可以保存!', Information!, OK! ) RETURN end if DW_UC.OBJECT.unit[DW_UC.GETROW()]=TRIM(DW_UC.OBJECT.unit[DW_UC.GETROW()]) IF DW_UC.OBJECT.unit[DW_UC.GETROW()]='' THEN MESSAGEBOX('提示','请输入单位!', Information!, OK! ) RETURN END IF if dw_uc.object.unitid[dw_uc.getrow()]=0 then ll_newid=f_sys_scidentity(0,"u_unit_def","unitid",errmsg,false,sqlca) if ll_newid<=0 then messagebox('提示',errmsg, Information!, OK! ) return else dw_uc.object.unitid[DW_UC.GETROW()]=ll_newid end if end if end if IF dw_edit_mode THEN string ls_errmsg if dw_UC.Update() = -1 then if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then ls_errmsg="关键内容重复" else ls_errmsg="因为网络或其他原因>"+ins_sqlerrtext end if rollback; MessageBox ('提示',ls_errmsg+",保存操作失败!", Information!, OK! ) LS_UPDATE_FLAG=FALSE RETURN else commit; for i=1 to 3 dw_UC.SetTabOrder ( i, 0 ) next LS_UPDATE_FLAG=TRUE end if ins_sqlerrtext="" ELSE long li_row, li_cur_row li_cur_row = dw_UC.GetRow() li_row = dw_UC.InsertRow (0) for i=1 to 3 dw_UC.SetTabOrder ( i, i*10 ) next dw_uc.selectrow(0,false) dw_UC.ScrollToRow (li_row) dw_uc.selectrow(li_row,true) dw_UC.SetFocus() modifyrow_no= li_row END IF dw_edit_mode= NOT dw_edit_mode WF_FACE_CHANGE() end event type cb_edit from w_publ_edit_choice`cb_edit within w_unit_def end type event cb_edit::clicked;call super::clicked;if not f_power_ind(667) then messagebox('提示','你没有使用权限!', Information!, OK! ) return end if Long i IF dw_edit_mode THEN IF dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = NewModified! OR dw_uc.GetItemStatus(dw_uc.GetRow(), 0, Primary!) = New! THEN dw_uc.DeleteRow(dw_uc.GetRow()) ELSE dw_uc.ReselectRow(dw_uc.GetRow()) END IF FOR i = 1 TO 2 dw_uc.SetTabOrder ( i, 0 ) NEXT modifyrow_no = 0 ELSE modifyrow_no = dw_uc.GetRow() FOR i = 1 TO 2 dw_uc.SetTabOrder ( i, i*10 ) NEXT dw_uc.SetFocus() dw_uc.SelectRow(0,FALSE) dw_uc.ScrollToRow (modifyrow_no) dw_uc.SelectRow(modifyrow_no,TRUE) END IF dw_edit_mode = NOT dw_edit_mode WF_FACE_CHANGE() end event type cb_delet from w_publ_edit_choice`cb_delet within w_unit_def end type event cb_delet::clicked;call super::clicked;if not f_power_ind(667) then messagebox('提示','你没有使用权限!', Information!, OK! ) return end if IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN RETURN END IF string arg_msg IF DW_UC.GETROW()<=0 THEN MESSAGEBOX('提示','没有操作目标记录!', Information!, OK! ) RETURN END IF dw_uc.SetRedraw (false) dw_UC.DeleteRow (0) dw_UC.TriggerEvent (rowfocuschanged!) if dw_UC.Update() = -1 then rollback; MessageBox ('提示',"删除记录操作失败!", Information!, OK! ) else commit; end if dw_uc.SetRedraw (true) end event type cb_choice from w_publ_edit_choice`cb_choice within w_unit_def boolean visible = false integer x = 1609 boolean enabled = false end type type dw_uc from w_publ_edit_choice`dw_uc within w_unit_def integer width = 1792 string dataobject = "dw_unit_def" end type event dw_uc::dwnkey;call super::dwnkey;IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF end event type cb_rtr from w_publ_edit_choice`cb_rtr within w_unit_def end type type cb_help from w_publ_edit_choice`cb_help within w_unit_def end type type ln_bar from w_publ_edit_choice`ln_bar within w_unit_def integer endx = 1792 end type type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_unit_def integer endx = 1792 end type type r_bar from w_publ_edit_choice`r_bar within w_unit_def end type type cb_view from uo_imflatbutton within w_unit_def integer x = 837 integer width = 151 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "预览" string normalpicname = "preview.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME = 'dw_rp_unit_def' LS_PRMSG.SHARE_DW = DW_UC LS_PRMSG.TAG_TEXT = parent.title LS_PRMSG.SETUP_FLAG = 0 LS_PRMSG.PAGECH_FLAG = 1 OpenWithParm(w_publ_preview,LS_PRMSG) end event