$PBExportHeader$w_rpt_update.srw $PBExportComments$Update设置-- 窗口 forward global type w_rpt_update from Window end type type dw3 from datawindow within w_rpt_update end type type st_4 from statictext within w_rpt_update end type type st_3 from statictext within w_rpt_update end type type st_2 from statictext within w_rpt_update end type type ddlb_1 from dropdownlistbox within w_rpt_update end type type st_1 from statictext within w_rpt_update end type type rb_4 from radiobutton within w_rpt_update end type type rb_5 from radiobutton within w_rpt_update end type type rb_3 from radiobutton within w_rpt_update end type type rb_2 from radiobutton within w_rpt_update end type type rb_1 from radiobutton within w_rpt_update end type type cbx_1 from checkbox within w_rpt_update end type type dw2 from datawindow within w_rpt_update end type type cb_2 from commandbutton within w_rpt_update end type type cb_1 from commandbutton within w_rpt_update end type type dw1 from datawindow within w_rpt_update end type type gb_2 from groupbox within w_rpt_update end type type gb_1 from groupbox within w_rpt_update end type end forward global type w_rpt_update from Window int X=5 int Y=320 int Width=2926 int Height=1712 boolean TitleBar=true string Title="更新属性" long BackColor=80269524 boolean ControlMenu=true WindowType WindowType=response! dw3 dw3 st_4 st_4 st_3 st_3 st_2 st_2 ddlb_1 ddlb_1 st_1 st_1 rb_4 rb_4 rb_5 rb_5 rb_3 rb_3 rb_2 rb_2 rb_1 rb_1 cbx_1 cbx_1 dw2 dw2 cb_2 cb_2 cb_1 cb_1 dw1 dw1 gb_2 gb_2 gb_1 gb_1 end type global w_rpt_update w_rpt_update type variables int i,ii_rows string is_temp datawindow idw DataWindowChild idw_child string is_updatetable,is_updatewhere,is_updatekeyinplace end variables forward prototypes public subroutine wf_ok () end prototypes public subroutine wf_ok ();if cbx_1.checked=false then cb_1.enabled=true else if ddlb_1.text>'' and dw1.find("cupdate='yes'",1,999)>0 and dw2.find("ckey='yes'",1,999)>0 then cb_1.enabled=true else cb_1.enabled=false end if end if end subroutine on w_rpt_update.create this.dw3=create dw3 this.st_4=create st_4 this.st_3=create st_3 this.st_2=create st_2 this.ddlb_1=create ddlb_1 this.st_1=create st_1 this.rb_4=create rb_4 this.rb_5=create rb_5 this.rb_3=create rb_3 this.rb_2=create rb_2 this.rb_1=create rb_1 this.cbx_1=create cbx_1 this.dw2=create dw2 this.cb_2=create cb_2 this.cb_1=create cb_1 this.dw1=create dw1 this.gb_2=create gb_2 this.gb_1=create gb_1 this.Control[]={this.dw3,& this.st_4,& this.st_3,& this.st_2,& this.ddlb_1,& this.st_1,& this.rb_4,& this.rb_5,& this.rb_3,& this.rb_2,& this.rb_1,& this.cbx_1,& this.dw2,& this.cb_2,& this.cb_1,& this.dw1,& this.gb_2,& this.gb_1} end on on w_rpt_update.destroy destroy(this.dw3) destroy(this.st_4) destroy(this.st_3) destroy(this.st_2) destroy(this.ddlb_1) destroy(this.st_1) destroy(this.rb_4) destroy(this.rb_5) destroy(this.rb_3) destroy(this.rb_2) destroy(this.rb_1) destroy(this.cbx_1) destroy(this.dw2) destroy(this.cb_2) destroy(this.cb_1) destroy(this.dw1) destroy(this.gb_2) destroy(this.gb_1) end on event open;f_wcenter(this) idw=w_rpt_main.dw3 idw.rowscopy(1,idw.rowcount(),Primary!,dw1,1,Primary!) dw1.sharedata(dw2) string ls[],ls_sql,ls_from ls_sql=w_rpt_main.istr_rpt.rsqlselect if ls_sql='' then return f_rpt_cksql(ls_sql,is_temp,ls_from,is_temp,is_temp,is_temp) ls_from=f_replace(ls_from+',',',','~t') f_atab(ls[],ls_from) for i=1 to upperbound(ls[]) ddlb_1.additem(ls[i]) next dw3.GetChild('cname',idw_child) dw3.insertrow(0) dw1.rowscopy(1,dw1.rowcount(),Primary!,idw_child,1,Primary!) idw_child.insertrow(1) is_updatetable=w_rpt_main.is_updatetable ddlb_1.text=is_updatetable is_updatewhere=w_rpt_main.is_updatewhere rb_1.checked=is_updatewhere="0" rb_2.checked=is_updatewhere="1" rb_3.checked=is_updatewhere="2" is_updatekeyinplace=lower(w_rpt_main.is_updatekeyinplace) rb_4.checked=is_updatekeyinplace="no" rb_5.checked=is_updatekeyinplace="yes" ii_rows=dw1.rowcount() for i=1 to ii_rows if dw1.getitemstring(i,'cupdate')='yes' then dw1.SelectRow(i,true) end if if dw1.getitemstring(i,'cidentity')='yes' then dw3.setitem(1,1,dw1.getitemstring(i,'cname')) end if next ii_rows=dw2.rowcount() for i=1 to ii_rows if dw2.getitemstring(i,'ckey')='yes' then dw2.SelectRow(i,true) end if next if is_updatetable>'' then cbx_1.postevent(clicked!) cbx_1.checked=true else cbx_1.postevent(clicked!) cbx_1.postevent(clicked!) end if end event type dw3 from datawindow within w_rpt_update int X=507 int Y=1528 int Width=919 int Height=92 int TabOrder=80 string DataObject="dw_rpt_identity" boolean Border=false boolean LiveScroll=true end type type st_4 from statictext within w_rpt_update int X=55 int Y=1536 int Width=453 int Height=76 boolean Enabled=false string Text="Identity Column:" Alignment Alignment=Right! boolean FocusRectangle=false long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type type st_3 from statictext within w_rpt_update int X=1472 int Y=620 int Width=590 int Height=76 boolean Enabled=false string Text="Unigue Key Column(s):" Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type type st_2 from statictext within w_rpt_update int X=9 int Y=620 int Width=535 int Height=76 boolean Enabled=false string Text="Updateable Columns:" Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type type ddlb_1 from dropdownlistbox within w_rpt_update int X=1211 int Y=20 int Width=910 int Height=228 int TabOrder=10 BorderStyle BorderStyle=StyleLowered! boolean VScrollBar=true long TextColor=33554432 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event selectionchanged;wf_ok() end event type st_1 from statictext within w_rpt_update int X=754 int Y=32 int Width=453 int Height=76 boolean Enabled=false string Text="Table To Update:" Alignment Alignment=Center! boolean FocusRectangle=false long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type type rb_4 from radiobutton within w_rpt_update int X=1248 int Y=240 int Width=686 int Height=76 string Text="Use Delete then Insert" BorderStyle BorderStyle=StyleLowered! boolean Checked=true long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;is_updatekeyinplace="no" end event type rb_5 from radiobutton within w_rpt_update int X=1248 int Y=336 int Width=795 int Height=76 string Text="Use Update" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;is_updatekeyinplace="yes" end event type rb_3 from radiobutton within w_rpt_update int X=105 int Y=432 int Width=795 int Height=76 string Text="Key and Modified Columns" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;is_updatewhere="2" end event type rb_2 from radiobutton within w_rpt_update int X=105 int Y=336 int Width=795 int Height=76 string Text="Key and Updateable Columns" BorderStyle BorderStyle=StyleLowered! boolean Checked=true long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;is_updatewhere="1" end event type rb_1 from radiobutton within w_rpt_update int X=105 int Y=240 int Width=384 int Height=76 string Text="Key Columns" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;is_updatewhere="0" end event type cbx_1 from checkbox within w_rpt_update int X=50 int Y=20 int Width=439 int Height=76 string Text="Allow Updates" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;ddlb_1.enabled=checked rb_1.enabled=checked rb_2.enabled=checked rb_3.enabled=checked rb_4.enabled=checked rb_5.enabled=checked dw1.enabled=checked dw2.enabled=checked dw3.enabled=checked wf_ok() end event type dw2 from datawindow within w_rpt_update int X=1463 int Y=696 int Width=1435 int Height=808 int TabOrder=70 string DataObject="dw_rpt_column" BorderStyle BorderStyle=StyleLowered! boolean HScrollBar=true boolean VScrollBar=true boolean HSplitScroll=true boolean LiveScroll=true end type event clicked;if row>0 then if getSelectedRow(Row - 1)=row then SelectRow(Row,false) setitem(row,'ckey','no') else SelectRow(Row,true) setitem(row,'ckey','yes') end if wf_ok() end if return 1 end event type cb_2 from commandbutton within w_rpt_update int X=2533 int Y=212 int Width=247 int Height=108 int TabOrder=30 string Text="取消" int TextSize=-9 int Weight=400 string FaceName="宋体" FontPitch FontPitch=Variable! end type event clicked;close(parent) end event type cb_1 from commandbutton within w_rpt_update int X=2533 int Y=64 int Width=247 int Height=108 int TabOrder=20 boolean Enabled=false string Text="确认" int TextSize=-9 int Weight=400 string FaceName="宋体" FontPitch FontPitch=Variable! end type event clicked;is_temp=dw3.getitemstring(1,1) ii_rows=dw1.rowcount() for i=1 to ii_rows if dw1.getitemstring(i,'cname')=is_temp then dw1.setitem(i,'cidentity','yes') else dw1.setitem(i,'cidentity','no') end if next idw.reset() dw1.rowscopy(1,ii_rows,Primary!,idw,1,Primary!) if cbx_1.checked then w_rpt_main.is_updatetable=ddlb_1.text w_rpt_main.is_updatewhere=is_updatewhere w_rpt_main.is_updatekeyinplace=is_updatekeyinplace else w_rpt_main.is_updatetable='' w_rpt_main.is_updatewhere='2' w_rpt_main.is_updatekeyinplace='no' end if w_rpt_main.ii_save=1 close(parent) end event type dw1 from datawindow within w_rpt_update int X=9 int Y=696 int Width=1435 int Height=808 int TabOrder=60 string DataObject="dw_rpt_column" BorderStyle BorderStyle=StyleLowered! boolean HScrollBar=true boolean VScrollBar=true boolean HSplitScroll=true boolean LiveScroll=true end type event clicked;if row>0 then if getSelectedRow(Row -1)=row then SelectRow(Row,false) setitem(row,'cupdate','no') else SelectRow(Row,true) setitem(row,'cupdate','yes') end if wf_ok() end if return 1 end event type gb_2 from groupbox within w_rpt_update int X=1175 int Y=152 int Width=946 int Height=408 int TabOrder=40 string Text="Key Modification" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type type gb_1 from groupbox within w_rpt_update int X=41 int Y=152 int Width=946 int Height=408 int TabOrder=50 string Text="Where Clause For Update/Delete" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type