$PBExportHeader$w_workgroup.srw forward global type w_workgroup from w_publ_edit_choice end type type cb_print from uo_imflatbutton within w_workgroup end type end forward global type w_workgroup from w_publ_edit_choice integer width = 3611 integer height = 2380 string title = "工作中心" boolean minbox = true windowtype windowtype = popup! cb_print cb_print end type global w_workgroup w_workgroup on w_workgroup.create int iCurrent call super::create this.cb_print=create cb_print iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_print end on on w_workgroup.destroy call super::destroy destroy(this.cb_print) end on event ue_before_open;call super::ue_before_open;if_ue_sentdataout=true end event event ue_sentdataout;call super::ue_sentdataout;IF dw_edit_mode THEN MessageBox(publ_operator,'编辑状态下不能使用') RETURN END IF OpenWithParm(w_sentdataout,dw_uc) end event type cb_func from w_publ_edit_choice`cb_func within w_workgroup integer width = 165 end type type cb_exit from w_publ_edit_choice`cb_exit within w_workgroup integer x = 1166 end type type cb_add from w_publ_edit_choice`cb_add within w_workgroup integer x = 315 end type event cb_add::clicked;call super::clicked;IF NOT f_power_ind(688) 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.workgroupcode[dw_uc.GetRow()] = Trim(dw_uc.Object.workgroupcode[dw_uc.GetRow()]) dw_uc.Object.workgroupname[dw_uc.GetRow()] = Trim(dw_uc.Object.workgroupname[dw_uc.GetRow()]) dw_uc.Object.workshop[dw_uc.GetRow()] = Trim(dw_uc.Object.workshop[dw_uc.GetRow()]) IF dw_uc.Object.workgroupcode[dw_uc.GetRow()] = '' THEN MessageBox(publ_operator,'请输入工作中心号!') RETURN END IF IF dw_uc.Object.workgroupname[dw_uc.GetRow()] = '' THEN MessageBox(publ_operator,'请输入工作中心名称!') RETURN END IF IF dw_uc.Object.wrkgrpid[dw_uc.GetRow()] = 0 THEN MessageBox(publ_operator,'请选择所属工组!') RETURN END IF IF dw_uc.Object.workgroupid[dw_uc.GetRow()] = 0 THEN ll_newid = f_sys_scidentity(0,"u_workgroup","workgroupid",errmsg,FALSE,sqlca) IF ll_newid <= 0 THEN MessageBox(publ_operator,errmsg) RETURN ELSE dw_uc.Object.workgroupid[dw_uc.GetRow()] = ll_newid END IF dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator ELSE dw_uc.Object.modemp[dw_uc.GetRow()] = publ_operator dw_uc.Object.moddate[dw_uc.GetRow()] = DateTime(Today(),Now()) END IF END IF IF dw_edit_mode THEN String ls_errmsg dw_uc.AcceptText() 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 8 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 8 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_workgroup integer x = 507 end type event cb_edit::clicked;call super::clicked;if not f_power_ind(688) 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 8 dw_UC.SetTabOrder ( i, 0 ) next modifyrow_no = 0 ELSE modifyrow_no = dw_UC.getrow() for i=1 to 8 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_workgroup integer x = 699 end type event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(688) 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('','没有操作目标记录!') RETURN END IF ls_id = dw_uc.Object.workgroupid[dw_uc.GetRow()] SELECT count(*) INTO :ls_long FROM u_outware WHERE u_outware.relid = :ls_id AND u_outware.billtype = 3; 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 //ls_long = 0 //SELECT count(*) INTO :ls_long FROM u_workgroupmx // WHERE u_workgroupmx.workgroupid = :ls_id; //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_workgroup boolean visible = false integer x = 878 integer width = 165 boolean enabled = false end type type dw_uc from w_publ_edit_choice`dw_uc within w_workgroup integer width = 3593 integer height = 2108 string dataobject = "dw_workgroup_edit" boolean hscrollbar = true end type type cb_rtr from w_publ_edit_choice`cb_rtr within w_workgroup end type type cb_help from w_publ_edit_choice`cb_help within w_workgroup integer x = 1015 end type type ln_bar from w_publ_edit_choice`ln_bar within w_workgroup end type type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_workgroup end type type r_bar from w_publ_edit_choice`r_bar within w_workgroup end type type cb_print from uo_imflatbutton within w_workgroup integer x = 850 integer width = 165 integer height = 164 integer taborder = 60 boolean bringtotop = true string text = "打印" string normalpicname = "print.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_workgroup_print' LS_PRMSG.SHARE_DW=DW_UC LS_PRMSG.TAG_TEXT='工作中心表' LS_PRMSG.SETUP_FLAG=0 LS_PRMSG.PAGECH_FLAG=1 Openwithparm(w_publ_preview,LS_PRMSG) end event