$PBExportHeader$w_saletask_kind_edit.srw forward global type w_saletask_kind_edit from w_publ_edit_choice end type type cb_view from uo_imflatbutton within w_saletask_kind_edit end type end forward global type w_saletask_kind_edit from w_publ_edit_choice integer width = 1586 integer height = 1544 string title = "销售类型设定" boolean minbox = true windowtype windowtype = popup! cb_view cb_view end type global w_saletask_kind_edit w_saletask_kind_edit on w_saletask_kind_edit.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_saletask_kind_edit.destroy call super::destroy destroy(this.cb_view) end on type cb_func from w_publ_edit_choice`cb_func within w_saletask_kind_edit end type type cb_exit from w_publ_edit_choice`cb_exit within w_saletask_kind_edit integer x = 987 end type type cb_add from w_publ_edit_choice`cb_add within w_saletask_kind_edit end type event cb_add::clicked;call super::clicked;IF Not f_power_ind(1750) 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.kindname[dw_uc.GetRow()] = Trim(dw_uc.Object.kindname[dw_uc.GetRow()]) IF dw_uc.Object.kindname[dw_uc.GetRow()] = '' THEN MessageBox('提示','请输入项目名称!', Information!, OK! ) RETURN END IF IF dw_uc.Object.kind[dw_uc.GetRow()] = 0 THEN ll_newid = f_sys_scidentity(0,"u_saletask_kind","kind",errmsg,False,sqlca) IF ll_newid <= 0 THEN MessageBox('提示',errmsg, Information!, OK! ) RETURN ELSE dw_uc.Object.kind[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_saletask_kind_edit end type event cb_edit::clicked;call super::clicked;IF Not f_power_ind(1750) 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_saletask_kind_edit end type event cb_delet::clicked;call super::clicked;IF Not f_power_ind(1750) 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 Long LS_LONG,ll_kind ll_kind = DW_UC.Object.kind[DW_UC.GetRow()] if ll_kind <= 1 then MessageBox ("提示","系统默认的订单类型,不能删除", Information!, OK! ) RETURN end if LS_LONG = 0 SELECT COUNT(*) Into :LS_LONG From u_saletask Where kind = :ll_kind ; IF SQLCA.SQLCode <> 0 THEN MessageBox ("提示","数据查询操作失败!(请重试!)", Information!, OK! ) RETURN END IF IF LS_LONG > 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 ('提示',"删除记录操作失败!",Exclamation!,OK!) ELSE COMMIT; END IF DW_UC.SetRedraw (True) end event type cb_choice from w_publ_edit_choice`cb_choice within w_saletask_kind_edit boolean visible = false integer x = 1248 boolean enabled = false end type type dw_uc from w_publ_edit_choice`dw_uc within w_saletask_kind_edit integer width = 1559 string dataobject = "dw_saletask_kind" end type type cb_rtr from w_publ_edit_choice`cb_rtr within w_saletask_kind_edit end type type cb_help from w_publ_edit_choice`cb_help within w_saletask_kind_edit integer x = 837 end type type ln_bar from w_publ_edit_choice`ln_bar within w_saletask_kind_edit integer endx = 1563 end type type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_saletask_kind_edit integer endx = 1563 end type type r_bar from w_publ_edit_choice`r_bar within w_saletask_kind_edit integer x = 1426 end type type cb_view from uo_imflatbutton within w_saletask_kind_edit boolean visible = false 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_oppose_item' //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