void go2_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName.Equals("State")) { GasADObject obj = sender as GasADObject; if (obj.State.Equals(State.Loaded)) { WebClientInfo wci = App.Current.Resources["dbclient"] as WebClientInfo; applyslist.LoadOnPathChanged = false; applyslist.Path = "sql"; applyslist.Names = "state,road,districtname,cusDy,cusDom,cusFloor,apartment,placeholder"; String sql = @"select * from (select case when a.f_districtname is null then '新增' when b.f_districtname is null then '已建' else '重复 ' end state, isnull(a.f_road, b.f_road) road, isnull(a.f_districtname, b.f_districtname) districtname, isnull( a.f_cusDy, b.f_cusDy) cusDy, isnull( a.f_cusDom, b.f_cusDom) cusDom, isnull(a.f_cusFloor, b.f_cusFloor) cusFloor, isnull(a.f_apartment, b.f_apartment) apartment from (select f_road, f_districtname, f_cusDy, f_cusDom, f_cusFloor, f_apartment from T_GASADDRESS where f_districtname='{0}') a full join (select f_road, f_districtname, f_cusDy, f_cusDom, f_cusFloor, f_apartment from T_GASADDRESSTEMP) b on a.f_road = b.f_road and a.f_districtname = b.f_districtname and a.f_cusDy=b.f_cusDy and a.f_cusDom=b.f_cusDom and a.f_cusFloor = b.f_cusFloor and a.f_apartment=b.f_apartment ) t "; string orderBy = " order by len(road), road, len(districtname), districtname,len(cusDom), cusDom,len(cusDy), cusDy,len(cusFloor), cusFloor,len(apartment), apartment"; applyslist.SumHQL = String.Format(sql, new String[] { districtname.Text }).Replace("\r\n", " "); applyslist.HQL = (applyslist.SumHQL + orderBy).Replace("\r\n", " "); applyslist.Load(); save.IsEnabled = true; search.IsEnabled = true; cancel.IsEnabled = true; } } }
void go2_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName.Equals("State")) { GasADObject obj = sender as GasADObject; if (obj.State.Equals(State.Loaded)) { WebClientInfo wci = App.Current.Resources["dbclient"] as WebClientInfo; applyslist.LoadOnPathChanged = false; applyslist.Path = "sql"; applyslist.Names = "state,road,districtname,cusDy,cusDom,cusFloor,apartment,placeholder"; String sql = @"select cast(nvl2(a.f_districtname, nvl2(b.f_districtname,'重复','已建'), '新增') as varchar(10)) state, nvl2(a.f_road, a.f_road, b.f_road) road, nvl2(a.f_districtname, a.f_districtname, b.f_districtname) districtname, nvl2(a.f_cusDy, a.f_cusDy, b.f_cusDy) cusDy, nvl2(a.f_cusDom, a.f_cusDom, b.f_cusDom) cusDom, nvl2(a.f_cusFloor, a.f_cusFloor, b.f_cusFloor) cusFloor, nvl2(a.f_apartment, a.f_apartment, b.f_apartment) apartment from (select f_road, f_districtname, f_cusDy, f_cusDom, f_cusFloor, f_apartment from T_GASADDRESS where f_districtname='{0}') a full join (select f_road, f_districtname, f_cusDy, f_cusDom, f_cusFloor, f_apartment from T_GASADDRESSTEMP) b on a.f_road = b.f_road and a.f_districtname = b.f_districtname and a.f_cusDy=b.f_cusDy and a.f_cusDom=b.f_cusDom and a.f_cusFloor = b.f_cusFloor and a.f_apartment=b.f_apartment order by length(road), road, length(districtname), districtname,length(cusDom), cusDom,length(cusDy), cusDy,length(cusFloor), cusFloor,length(apartment), apartment"; applyslist.HQL = String.Format(sql, new String[] { districtname.Text }); applyslist.Load(); save.IsEnabled = true; search.IsEnabled = true; cancel.IsEnabled = true; } } }