$PBExportHeader$w_ctdatetime_init.srw forward global type w_ctdatetime_init from w_publ_base end type type dw_1 from datawindow within w_ctdatetime_init end type type dw_2 from datawindow within w_ctdatetime_init end type type mle_log from multilineedit within w_ctdatetime_init end type type em_step from editmask within w_ctdatetime_init end type type gb_2 from groupbox within w_ctdatetime_init end type type gb_1 from groupbox within w_ctdatetime_init end type type st_msg from statictext within w_ctdatetime_init end type type st_2 from statictext within w_ctdatetime_init end type type em_1 from editmask within w_ctdatetime_init end type type st_1 from statictext within w_ctdatetime_init end type type cb_refresh_2 from uo_imflatbutton within w_ctdatetime_init end type type cb_5 from uo_imflatbutton within w_ctdatetime_init end type type cb_6 from uo_imflatbutton within w_ctdatetime_init end type type cb_1 from uo_imflatbutton within w_ctdatetime_init end type end forward global type w_ctdatetime_init from w_publ_base integer width = 3602 integer height = 2200 string title = "截数及数据删除" boolean maxbox = true windowstate windowstate = maximized! long backcolor = 80269524 dw_1 dw_1 dw_2 dw_2 mle_log mle_log em_step em_step gb_2 gb_2 gb_1 gb_1 st_msg st_msg st_2 st_2 em_1 em_1 st_1 st_1 cb_refresh_2 cb_refresh_2 cb_5 cb_5 cb_6 cb_6 cb_1 cb_1 end type global w_ctdatetime_init w_ctdatetime_init type variables uo_yfct uo_ct end variables on w_ctdatetime_init.create int iCurrent call super::create this.dw_1=create dw_1 this.dw_2=create dw_2 this.mle_log=create mle_log this.em_step=create em_step this.gb_2=create gb_2 this.gb_1=create gb_1 this.st_msg=create st_msg this.st_2=create st_2 this.em_1=create em_1 this.st_1=create st_1 this.cb_refresh_2=create cb_refresh_2 this.cb_5=create cb_5 this.cb_6=create cb_6 this.cb_1=create cb_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_1 this.Control[iCurrent+2]=this.dw_2 this.Control[iCurrent+3]=this.mle_log this.Control[iCurrent+4]=this.em_step this.Control[iCurrent+5]=this.gb_2 this.Control[iCurrent+6]=this.gb_1 this.Control[iCurrent+7]=this.st_msg this.Control[iCurrent+8]=this.st_2 this.Control[iCurrent+9]=this.em_1 this.Control[iCurrent+10]=this.st_1 this.Control[iCurrent+11]=this.cb_refresh_2 this.Control[iCurrent+12]=this.cb_5 this.Control[iCurrent+13]=this.cb_6 this.Control[iCurrent+14]=this.cb_1 end on on w_ctdatetime_init.destroy call super::destroy destroy(this.dw_1) destroy(this.dw_2) destroy(this.mle_log) destroy(this.em_step) destroy(this.gb_2) destroy(this.gb_1) destroy(this.st_msg) destroy(this.st_2) destroy(this.em_1) destroy(this.st_1) destroy(this.cb_refresh_2) destroy(this.cb_5) destroy(this.cb_6) destroy(this.cb_1) end on event open;call super::open;dw_1.settransobject(sqlca) dw_2.settransobject(sqlca) dw_1.retrieve() cb_refresh_2.triggerevent(clicked!) uo_ct = create uo_yfct end event event resize;mle_log.width=newwidth - mle_log.x - 5 mle_log.height=newheight - mle_log.y - 10 st_msg.width=mle_log.width end event type cb_func from w_publ_base`cb_func within w_ctdatetime_init end type type cb_exit from w_publ_base`cb_exit within w_ctdatetime_init integer x = 2313 integer y = 40 integer width = 274 end type type dw_1 from datawindow within w_ctdatetime_init integer x = 14 integer y = 1004 integer width = 754 integer height = 1056 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_ctdatatime_init" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type type dw_2 from datawindow within w_ctdatetime_init integer width = 2286 integer height = 800 integer taborder = 50 boolean bringtotop = true string dataobject = "dw_ctdatatime_mx" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;if currentrow<=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end event type mle_log from multilineedit within w_ctdatetime_init integer x = 791 integer y = 888 integer width = 2779 integer height = 1188 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean hscrollbar = true boolean vscrollbar = true boolean displayonly = true borderstyle borderstyle = stylelowered! end type type em_step from editmask within w_ctdatetime_init integer x = 2313 integer y = 508 integer width = 274 integer height = 96 integer taborder = 100 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "100" alignment alignment = center! borderstyle borderstyle = stylelowered! string mask = "###" boolean spin = true double increment = 10 string minmax = "50~~150" end type type gb_2 from groupbox within w_ctdatetime_init integer y = 780 integer width = 786 integer height = 1296 integer taborder = 110 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 end type type gb_1 from groupbox within w_ctdatetime_init integer x = 2295 integer width = 315 integer height = 800 integer taborder = 120 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 end type type st_msg from statictext within w_ctdatetime_init integer x = 791 integer y = 808 integer width = 2779 integer height = 76 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16776960 boolean enabled = false boolean border = true boolean focusrectangle = false end type type st_2 from statictext within w_ctdatetime_init integer x = 18 integer y = 840 integer width = 251 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean enabled = false string text = "截数日期" boolean focusrectangle = false end type type em_1 from editmask within w_ctdatetime_init integer x = 270 integer y = 824 integer width = 480 integer height = 92 integer taborder = 90 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 alignment alignment = center! borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type event constructor;this.text=string(today(),'yyyy-mm-dd') end event event rbuttondown;s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X s_calender.Y = THIS.Y OpenWithParm(w_calendar,s_calender) THIS.Text = String(id_date_selected) end event type st_1 from statictext within w_ctdatetime_init integer x = 2313 integer y = 448 integer width = 274 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "提交步长:" boolean focusrectangle = false end type type cb_refresh_2 from uo_imflatbutton within w_ctdatetime_init integer x = 2313 integer y = 276 integer width = 274 integer height = 96 integer taborder = 20 boolean bringtotop = true string text = "刷新" end type event clicked;call super::clicked;dw_2.retrieve() end event type cb_5 from uo_imflatbutton within w_ctdatetime_init integer x = 270 integer y = 920 integer width = 242 integer height = 80 integer taborder = 30 boolean bringtotop = true string text = "检查" end type event clicked;call super::clicked;string arg_log,arg_msg datetime server_dt server_dt=datetime(date(em_1.text),time('23:59:59')) if uo_ct.check_no_finish(server_dt,arg_log,arg_msg)=0 then end if mle_log.text=arg_log end event type cb_6 from uo_imflatbutton within w_ctdatetime_init integer x = 507 integer y = 920 integer width = 242 integer height = 80 integer taborder = 40 boolean bringtotop = true string text = "截数" end type event clicked;call super::clicked;datetime server_dt string arg_msg,arg_log if if_hisdb then messagebox('提示','当前数据库是历史查询数据库,不能截数',information!,OK!) return end if server_dt=datetime(date(em_1.text),time('23:59:59')) if MessageBox("询问", '是否将当前时间 '+string(server_dt,'yyyy-mm-dd hh:mm:SS')+' 设定为截数时间?', Question!, yesno!, 2)=2 then return if uo_ct.init_ct(true,server_dt,arg_msg,arg_log,false)=0 then messagebox('错误','设定截数时间失败>>'+arg_msg,stopsign!,OK!) return end if //应付帐 if f_ct_mstpay(server_dt,arg_msg,arg_log,false)=0 then messagebox('错误','设定应付帐删除标记失败>>'+arg_msg,stopsign!,OK!) return end if //应收帐 if f_ct_msttake(server_dt,arg_msg,arg_log,true)=0 then messagebox('错误','设定应收帐删除标记失败>>'+arg_msg,stopsign!,OK!) return end if messagebox('提示','设定截数时间成功'+arg_msg,information!,OK!) mle_log.text=arg_log dw_1.retrieve() end event type cb_1 from uo_imflatbutton within w_ctdatetime_init integer x = 2313 integer y = 612 integer width = 274 integer height = 96 integer taborder = 20 boolean bringtotop = true string text = "删除数据" end type event clicked;call super::clicked;long li_row,ls_ct_errnum datetime bgdt,eddt long bg_ctmint,ed_ctmint,ls_ct_id int ls_step string arg_msg,arg_log if if_hisdb then messagebox('提示','当前数据库是历史查询数据库,不能截数',information!,OK!) return end if li_row=dw_2.getrow() if li_row <=0 then messagebox("提示",'请选择要删除数据的截数',information!,OK!) return end if bgdt=dw_2.object.ct_stdt[li_row] eddt=dw_2.object.ct_eddt[li_row] ls_ct_errnum=dw_2.object.ct_errnum[li_row] ls_ct_id=dw_2.object.ct_id[li_row] IF MessageBox ("询问","是否确定要删除截数数据吗?["+string(bgdt)+' - '+string(eddt)+']的已经截数的数据,删除时间可能要很长,系统将不能进行其它操作?',Question!,YesNo! ) = 2 THEN RETURN if ls_ct_errnum > 0 then messagebox("提示","["+string(bgdt)+' - '+string(eddt)+']的已经截数的数据在导出时有错误,不能删除',information!,OK!) return end if select ct_dateint into :bg_ctmint from sys_ct_data where ct_datetime = :bgdt; if sqlca.sqlcode <> 0 then messagebox("错误",'查询截数开始时间标记失败',stopsign!,OK!) return end if select ct_dateint into :ed_ctmint from sys_ct_data where ct_datetime = :eddt; if sqlca.sqlcode <> 0 then messagebox("错误",'查询截数结束时间标记失败',stopsign!,OK!) return end if ls_step=integer(em_step.text) if ls_step=0 then messagebox("提示",'请输入提交步长',information!,OK!) return end if uo_ct.del_ct_data(eddt,ls_ct_id,bg_ctmint,ed_ctmint,ls_step,arg_msg,arg_log,true) UPDATE sys_ct_datamx SET ct_delflag = 1 Where sys_ct_datamx.ct_id = :ls_ct_id; IF sqlca.SQLCode <> 0 THEN MessageBox("错误",'更新删除标记失败',stopsign!,OK!) RETURN END IF mle_log.text=arg_log messagebox("提示",'数据删除完毕',information!,OK!) end event