123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- $PBExportHeader$w_fileclass_def.srw
- forward
- global type w_fileclass_def from w_publ_edit_choice
- end type
- type dw_bill_list from u_dw_rbtnfilter within w_fileclass_def
- end type
- type cb_imexport from uo_imflatbutton within w_fileclass_def
- end type
- end forward
- global type w_fileclass_def from w_publ_edit_choice
- integer width = 3611
- integer height = 2380
- string title = "单据附件分类定义"
- boolean minbox = true
- windowtype windowtype = popup!
- dw_bill_list dw_bill_list
- cb_imexport cb_imexport
- end type
- global w_fileclass_def w_fileclass_def
- on w_fileclass_def.create
- int iCurrent
- call super::create
- this.dw_bill_list=create dw_bill_list
- this.cb_imexport=create cb_imexport
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_bill_list
- this.Control[iCurrent+2]=this.cb_imexport
- end on
- on w_fileclass_def.destroy
- call super::destroy
- destroy(this.dw_bill_list)
- destroy(this.cb_imexport)
- end on
- event retrieve_uc;long lrow
- lrow=dw_bill_list.getrow()
- if lrow<=0 then
- dw_uc.reset()
- else
- dw_uc.retrieve(dw_bill_list.Object.billtype[lrow] )
- end if
- end event
- type cb_func from w_publ_edit_choice`cb_func within w_fileclass_def
- end type
- type cb_exit from w_publ_edit_choice`cb_exit within w_fileclass_def
- integer x = 1266
- end type
- type cb_add from w_publ_edit_choice`cb_add within w_fileclass_def
- end type
- event cb_add::clicked;call super::clicked;IF Not f_power_ind(952) 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.ClassName[dw_uc.GetRow()] = Trim(dw_uc.Object.ClassName[dw_uc.GetRow()])
-
-
- IF dw_uc.Object.ClassName[dw_uc.GetRow()] = '' THEN
- MessageBox('提示','请输入类型名称!',information!,OK!)
- RETURN
- END IF
- IF dw_uc.Object.billtype[dw_uc.GetRow()] = 0 THEN
- MessageBox('提示','没有指定单据类型!',information!,OK!)
- RETURN
- END IF
-
- IF dw_uc.Object.classid[dw_uc.GetRow()] = 0 THEN
- ll_newid = f_sys_scidentity(0,"U_FileClass","classid",errmsg,False,sqlca)
- IF ll_newid <= 0 THEN
- MessageBox(publ_operator,errmsg)
- RETURN
- ELSE
- dw_uc.Object.classid[dw_uc.GetRow()] = ll_newid
-
- END IF
- END IF
-
- dw_uc.AcceptText()
- 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+",保存操作失败!",stopsign!,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,blrow
- blrow = dw_bill_list.GetRow()
- IF blrow <= 0 THEN
- MessageBox('错误','没有指定当前单据类型',stopsign!,OK!)
- RETURN
- END IF
-
- 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()
- dw_uc.Object.billtype[li_row] = dw_bill_list.Object.billtype[blrow]
- 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_fileclass_def
- end type
- event cb_edit::clicked;call super::clicked;if not f_power_ind(952) 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 3
- dw_uc.SetTabOrder ( i, 0 )
- NEXT
- modifyrow_no = 0
- ELSE
- modifyrow_no = dw_uc.GetRow()
- FOR i = 1 TO 3
- 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_fileclass_def
- end type
- event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(952) THEN
- MessageBox('提示','你没有使用权限!',information!,OK!)
- RETURN
- END IF
- IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- Long LS_id
- Long LS_LONG = 0
- String ls_code,arg_msg
- IF DW_UC.GetRow() <= 0 THEN
- MessageBox('提示','没有操作目标记录!',information!,OK!)
- RETURN
- END IF
- LS_id = DW_UC.Object.classid[DW_UC.GetRow()]
- SELECT COUNT(*) INTO :LS_LONG FROM U_File
- Where U_File.classid = :LS_id using sys_fileDB_sqlca;
- IF SQLCA.SQLCode <> 0 THEN
- MessageBox ('错误',"数据查询操作失败!(请重试!)",stopsign!,OK!)
- RETURN
- END IF
- IF LS_LONG > 0 THEN
- MessageBox ('错误',"该资料已经使用于档案资料,不可以删除!",stopsign!,OK!)
- RETURN
- END IF
-
- DW_UC.SetRedraw (FALSE)
- DW_UC.DeleteRow (0)
- DW_UC.TriggerEvent (RowFocusChanged!)
- IF DW_UC.Update() = -1 THEN
- ROLLBACK;
- MessageBox ('错误',"删除记录操作失败!",stopsign!,OK!)
- ELSE
- COMMIT;
- END IF
- DW_UC.SetRedraw (TRUE)
- end event
- type cb_choice from w_publ_edit_choice`cb_choice within w_fileclass_def
- integer x = 0
- string text = "刷新"
- string normalpicname = "refresh.BMP"
- end type
- event cb_choice::clicked;call super::clicked;parent.triggerevent('retrieve_uc')
- end event
- type dw_uc from w_publ_edit_choice`dw_uc within w_fileclass_def
- integer x = 1257
- integer y = 180
- integer width = 2290
- integer height = 2044
- string dataobject = "dw_fileclass"
- end type
- type cb_rtr from w_publ_edit_choice`cb_rtr within w_fileclass_def
- boolean visible = false
- integer x = 151
- end type
- type cb_help from w_publ_edit_choice`cb_help within w_fileclass_def
- integer x = 1115
- end type
- type ln_bar from w_publ_edit_choice`ln_bar within w_fileclass_def
- integer beginx = -37
- integer endx = 1966
- end type
- type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_fileclass_def
- integer beginx = -37
- integer endx = 1966
- end type
- type r_bar from w_publ_edit_choice`r_bar within w_fileclass_def
- integer x = 2592
- end type
- type dw_bill_list from u_dw_rbtnfilter within w_fileclass_def
- integer x = 5
- integer y = 180
- integer width = 1253
- integer height = 2044
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_fj_bill_data"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean rbutton_filter_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 and not dw_edit_mode THEN
- this.SelectRow( 0, FALSE)
- this.SelectRow( currentrow, TRUE)
- this.ScrollToRow( currentrow)
- parent.triggerevent( 'retrieve_uc')
- END IF
- end event
- type cb_imexport from uo_imflatbutton within w_fileclass_def
- event ue_f7 ( )
- integer x = 837
- integer width = 279
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- string text = "导入/导出"
- string normalpicname = "imexport.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;open(w_fj_bill_mng_imexport)
- parent.triggerevent('retrieve_uc')
- end event
|