$PBExportHeader$w_fileway_edit.srw forward global type w_fileway_edit from w_publ_edit_choice end type end forward global type w_fileway_edit from w_publ_edit_choice integer width = 3712 integer height = 1308 string title = "打开方式" boolean minbox = true windowtype windowtype = popup! end type global w_fileway_edit w_fileway_edit type variables uo_usergroup uo_user end variables on w_fileway_edit.create call super::create end on on w_fileway_edit.destroy call super::destroy end on event close; call super::close //f_sc_array('0') destroy uo_user end event event open;call super::open;uo_user=create uo_usergroup end event type cb_func from w_publ_edit_choice`cb_func within w_fileway_edit boolean visible = false integer x = 1152 integer width = 165 boolean enabled = false end type type cb_exit from w_publ_edit_choice`cb_exit within w_fileway_edit integer x = 837 end type type cb_add from w_publ_edit_choice`cb_add within w_fileway_edit end type event cb_add::clicked;String arg_msg = '' Long ll_newid,i String ls_sccode,ls_ffpsw String ls_way,ls_type,ls_path Long cnt Boolean if_newarea = FALSE IF dw_edit_mode THEN dw_uc.AcceptText() IF dw_uc.GetNextModified(0, Primary!) = 0 THEN MessageBox(publ_operator,'没有任何修改,不可以保存!') RETURN END IF ls_way = dw_uc.Object.way[dw_uc.GetRow()] ls_type = dw_uc.Object.filetype[dw_uc.GetRow()] ls_path = dw_uc.Object.path[dw_uc.GetRow()] IF ls_way = '' OR ls_type = '' OR ls_path = '' THEN MessageBox(publ_operator,'资料不能为空!') RETURN END IF SELECT count(*) INTO :cnt FROM u_file_way where filetype = :ls_type and way = :ls_way; IF SQLCA.SQLCODE<>0 THEN MessageBox(publ_operator,'查询打开方式数据失败!') RETURN END IF IF cnt>0 THEN MessageBox(publ_operator,'资料重复,请检查!') RETURN END IF IF dw_uc.Object.id[dw_uc.GetRow()] = 0 THEN //参数0表示取得目标本身的ID ll_newid = f_sys_scidentity(0,"u_file_way","id",arg_msg,TRUE,id_sqlca) IF ll_newid < 0 THEN MessageBox(publ_operator,arg_msg) RETURN ELSE dw_uc.Object.id[dw_uc.GetRow()] = ll_newid if_newarea = TRUE 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 (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!) LS_UPDATE_FLAG = FALSE RETURN ELSE commit; FOR i = 1 TO 4 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 4 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_fileway_edit end type event cb_edit::clicked;String arg_msg = '' 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 4 dw_uc.SetTabOrder ( i, 0 ) NEXT modifyrow_no = 0 ELSE modifyrow_no = dw_uc.GetRow() IF modifyrow_no > 0 THEN FOR i = 1 TO 4 dw_uc.SetTabOrder ( i, i*10) NEXT ELSE MessageBox('','没有可修改的资料!') RETURN END IF 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_fileway_edit end type event cb_delet::clicked;call super::clicked;string arg_msg='' IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN RETURN END IF long LS_id LONG LS_LONG=0 string ls_code IF DW_UC.GETROW()<=0 THEN MESSAGEBOX('','没有操作目标记录!') RETURN END IF LS_id=DW_UC.OBJECT.id[DW_UC.GETROW()] dw_uc.SetRedraw (false) dw_UC.DeleteRow (0) dw_UC.TriggerEvent (rowfocuschanged!) if dw_UC.Update() = -1 then rollback; MessageBox (publ_operator,"删除记录操作失败!",Exclamation!,OK!) else commit; end if dw_uc.SetRedraw (true) end event type cb_choice from w_publ_edit_choice`cb_choice within w_fileway_edit boolean visible = false integer x = 987 integer width = 165 boolean enabled = false end type type dw_uc from w_publ_edit_choice`dw_uc within w_fileway_edit integer width = 3680 integer height = 1036 string dataobject = "dw_fileway" boolean hscrollbar = true boolean hsplitscroll = true end type type cb_rtr from w_publ_edit_choice`cb_rtr within w_fileway_edit end type type cb_help from w_publ_edit_choice`cb_help within w_fileway_edit integer x = 686 end type type ln_bar from w_publ_edit_choice`ln_bar within w_fileway_edit end type type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_fileway_edit end type type r_bar from w_publ_edit_choice`r_bar within w_fileway_edit integer x = 1381 end type