$PBExportHeader$w_oppose_cust_ch.srw forward global type w_oppose_cust_ch from w_publ_choice end type type st_2 from statictext within w_oppose_cust_ch end type type st_4 from statictext within w_oppose_cust_ch end type type em_1 from editmask within w_oppose_cust_ch end type type em_2 from editmask within w_oppose_cust_ch end type type pb_em1 from picturebutton within w_oppose_cust_ch end type type pb_em2 from picturebutton within w_oppose_cust_ch end type type pb_2 from picturebutton within w_oppose_cust_ch end type end forward global type w_oppose_cust_ch from w_publ_choice integer width = 3584 integer height = 1836 string title = "客户投诉单选择" event ue_date1 ( ) event ue_date2 ( ) event ue_date3 ( ) event ue_date4 ( ) st_2 st_2 st_4 st_4 em_1 em_1 em_2 em_2 pb_em1 pb_em1 pb_em2 pb_em2 pb_2 pb_2 end type global w_oppose_cust_ch w_oppose_cust_ch type variables s_oppose_cust_ch s_rslt end variables forward prototypes public function integer days_in_month (integer month, integer year) end prototypes event ue_date1();//IF THIS.Text = "本日" THEN em_1.text = string(today(),"yyyy-mm-dd") em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN // int li_Month, li_Year, li_Days // li_Month = Month(today()) // li_Year = Year(today()) // li_Days = days_in_month(li_Month, li_Year) // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_date2();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN int li_DayNum li_DayNum = DayNumber(today()) em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN // int li_Month, li_Year, li_Days // li_Month = Month(today()) // li_Year = Year(today()) // li_Days = days_in_month(li_Month, li_Year) // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_date3();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN int li_Month, li_Year, li_Days li_Month = Month(today()) li_Year = Year(today()) li_Days = days_in_month(li_Month, li_Year) em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_date4();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN Int li_Month, li_Year, li_Days li_Month = Month(Today()) li_Year = Year(Today()) IF li_Month = 1 THEN li_Month = 12 li_Year = li_Year - 1 ELSE li_Month -= 1 END IF li_Days = days_in_month(li_Month, li_Year) em_1.Text = String(Date(li_Year, li_Month, 1),"yyyy-mm-dd") em_2.Text = String(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of //days in 11 of the 12 months. February is, of course, the problem. //In a leap year February has 29 days, otherwise 28. Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31} // Get the number of days per month for a non leap year. li_DaysInMonth = li_Days[Month] // Check for a leap year. If Month = 2 Then // If the year is a leap year, change the number of days. // Leap Year Calculation: // Year divisible by 4, but not by 100, unless it is also divisible by 400 If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then li_DaysInMonth = 29 End If End If //Return the number of days in the relevant month Return li_DaysInMonth end function on w_oppose_cust_ch.create int iCurrent call super::create this.st_2=create st_2 this.st_4=create st_4 this.em_1=create em_1 this.em_2=create em_2 this.pb_em1=create pb_em1 this.pb_em2=create pb_em2 this.pb_2=create pb_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.st_2 this.Control[iCurrent+2]=this.st_4 this.Control[iCurrent+3]=this.em_1 this.Control[iCurrent+4]=this.em_2 this.Control[iCurrent+5]=this.pb_em1 this.Control[iCurrent+6]=this.pb_em2 this.Control[iCurrent+7]=this.pb_2 end on on w_oppose_cust_ch.destroy call super::destroy destroy(this.st_2) destroy(this.st_4) destroy(this.em_1) destroy(this.em_2) destroy(this.pb_em1) destroy(this.pb_em2) destroy(this.pb_2) end on event resize;call super::resize;dw_ch.Width = this.workspacewidth() - dw_ch.x dw_ch.height = this.workspacewidth() - dw_ch.y end event event ue_before_open;call super::ue_before_open;triggerevent('ue_date1') end event event open;call super::open;s_rslt.billid = 0 end event event close;call super::close;closewithreturn(this, s_rslt) end event type cb_func from w_publ_choice`cb_func within w_oppose_cust_ch end type type cb_exit from w_publ_choice`cb_exit within w_oppose_cust_ch end type type sle_ch from w_publ_choice`sle_ch within w_oppose_cust_ch integer x = 567 end type type dw_ch from w_publ_choice`dw_ch within w_oppose_cust_ch string dataobject = "dw_oppsoe_cust_ch" end type type st_1 from w_publ_choice`st_1 within w_oppose_cust_ch integer width = 535 string text = "物料编码/单据编码含" end type type cb_retrieve from w_publ_choice`cb_retrieve within w_oppose_cust_ch end type event cb_retrieve::clicked;String ls_query ls_query = sle_ch.Text IF Pos(ls_query, '%') <= 0 THEN ls_query = '%' + ls_query + '%' END IF DateTime ld_begin, ld_end ld_begin = DateTime(Date(em_1.Text), Time(0)) ld_end = DateTime(Date(em_2.Text), Time('23:59:59')) dw_ch.Retrieve(ls_query, ld_begin, ld_end) end event type cb_choice from w_publ_choice`cb_choice within w_oppose_cust_ch end type event cb_choice::clicked;call super::clicked;LONG LS_ROW LS_ROW=dw_CH.getrow() if LS_ROW<=0 then messagebox('系统提示','请先选择目标行!',StopSign!) return end if s_rslt.billid=dw_CH.OBJECT.billid[LS_ROW] s_rslt.billcode = dw_ch.Object.billcode[LS_ROW] CLOSE(PARENT) end event type ln_bar from w_publ_choice`ln_bar within w_oppose_cust_ch end type type ln_bar2 from w_publ_choice`ln_bar2 within w_oppose_cust_ch end type type r_bar from w_publ_choice`r_bar within w_oppose_cust_ch end type type ln_1 from w_publ_choice`ln_1 within w_oppose_cust_ch end type type ln_2 from w_publ_choice`ln_2 within w_oppose_cust_ch end type type st_2 from statictext within w_oppose_cust_ch integer x = 1125 integer y = 208 integer width = 251 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 = 134217739 string text = "投诉日期" boolean focusrectangle = false end type type st_4 from statictext within w_oppose_cust_ch integer x = 1861 integer y = 196 integer width = 105 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 = 134217739 boolean enabled = false string text = "到:" alignment alignment = right! boolean focusrectangle = false end type type em_1 from editmask within w_oppose_cust_ch integer x = 1353 integer y = 180 integer width = 407 integer height = 88 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type 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 em_2 from editmask within w_oppose_cust_ch integer x = 1966 integer y = 180 integer width = 407 integer height = 88 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type 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 pb_em1 from picturebutton within w_oppose_cust_ch integer x = 1769 integer y = 180 integer width = 101 integer height = 92 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_1.triggerevent(rbuttondown!) end event type pb_em2 from picturebutton within w_oppose_cust_ch integer x = 2382 integer y = 180 integer width = 101 integer height = 92 integer taborder = 130 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_2.triggerevent(rbuttondown!) end event type pb_2 from picturebutton within w_oppose_cust_ch integer x = 2491 integer y = 180 integer width = 101 integer height = 92 integer taborder = 140 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date1.BMP" alignment htextalign = left! end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=本日~tEvent=ue_date1" menustr = menustr + "|" + "Text=本周~tEvent=ue_date2" menustr = menustr + "|" + "Text=本月~tEvent=ue_date3" menustr = menustr + "|" + "Text=上月~tEvent=ue_date4" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event