$PBExportHeader$w_incrdercr_edit.srw forward global type w_incrdercr_edit from w_publ_edit_choice end type end forward global type w_incrdercr_edit from w_publ_edit_choice integer width = 1157 integer height = 1652 string title = "固定资产增减方式" boolean minbox = true windowtype windowtype = popup! long backcolor = 80269524 end type global w_incrdercr_edit w_incrdercr_edit on w_incrdercr_edit.create call super::create end on on w_incrdercr_edit.destroy call super::destroy end on event retrieve_uc;dw_UC.retrieve(sys_accsetid) end event type cb_func from w_publ_edit_choice`cb_func within w_incrdercr_edit boolean visible = false integer x = 731 integer y = 364 end type type cb_exit from w_publ_edit_choice`cb_exit within w_incrdercr_edit integer x = 686 end type type cb_add from w_publ_edit_choice`cb_add within w_incrdercr_edit integer x = 151 end type event cb_add::clicked;IF NOT (f_power_ind(1938,sys_msg_pow) OR f_power_ind(1959,sys_msg_pow)) THEN MessageBox(publ_operator,'你没有使用权限!') 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(publ_operator,'没有任何修改,不可以保存!') RETURN END IF dw_uc.Object.incrdecrname[dw_uc.GetRow()] = Trim(dw_uc.Object.incrdecrname[dw_uc.GetRow()]) IF dw_uc.Object.incrdecrname[dw_uc.GetRow()] = '' THEN MessageBox(publ_operator,'请输入结算方式名称!') RETURN END IF dw_uc.Object.accsetid[dw_uc.GetRow()] = sys_accsetid IF dw_uc.Object.incrdecrid[dw_uc.GetRow()] = 0 THEN ll_newid = f_sys_scidentity(sys_accsetid,"cw_incrdecr","incrdecrid",errmsg,TRUE,id_sqlca) IF ll_newid <= 0 THEN MessageBox(publ_operator,errmsg) RETURN ELSE dw_uc.Object.incrdecrid[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 (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!) LS_UPDATE_FLAG = FALSE RETURN ELSE COMMIT; LS_UPDATE_FLAG = TRUE 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_incrdercr_edit integer x = 343 end type event cb_edit::clicked;IF NOT (f_power_ind(1938,sys_msg_pow) OR f_power_ind(1959,sys_msg_pow)) THEN MessageBox(publ_operator,'你没有使用权限!') 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 4 dw_uc.SetTabOrder ( i, 0 ) NEXT modifyrow_no = 0 ELSE modifyrow_no = dw_uc.GetRow() FOR i = 1 TO 4 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_incrdercr_edit integer x = 535 end type event cb_delet::clicked;IF NOT (f_power_ind(1938,sys_msg_pow) OR f_power_ind(1959,sys_msg_pow)) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",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(publ_operator,'没有操作目标记录!') RETURN END IF LS_id = DW_UC.Object.incrdecrid[DW_UC.GetRow()] SELECT COUNT(*) INTO :LS_LONG FROM cw_assetcard WHERE cw_assetcard.incrdecrid = :LS_id AND cw_assetcard.accsetid = :sys_accsetid; IF SQLCA.SQLCode <> 0 THEN MessageBox (publ_operator,"数据查询操作失败!(请重试!)",Exclamation!,OK!) RETURN END IF IF LS_LONG > 0 THEN MessageBox (publ_operator,"该资料已经使用于固定资产,不可以删除!",Exclamation!,OK!) RETURN END IF 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_incrdercr_edit boolean visible = false integer x = 645 integer y = 368 boolean enabled = false end type type dw_uc from w_publ_edit_choice`dw_uc within w_incrdercr_edit integer width = 1138 integer height = 1380 string dataobject = "dw_incrdecr_index" end type event dw_uc::rowfocuschanged;call super::rowfocuschanged;if currentrow>0 then this.selectrow(0,false) this.selectrow(currentrow,true) end if end event type cb_rtr from w_publ_edit_choice`cb_rtr within w_incrdercr_edit end type type cb_help from w_publ_edit_choice`cb_help within w_incrdercr_edit boolean visible = false integer x = 891 integer y = 388 end type type ln_bar from w_publ_edit_choice`ln_bar within w_incrdercr_edit end type type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_incrdercr_edit end type type r_bar from w_publ_edit_choice`r_bar within w_incrdercr_edit end type