| | |
| | | _allBindingList.Add(new FacilityViewModel(item)); |
| | | } |
| | | } |
| | | this.placeViewModelBindingSource.DataSource = _allBindingList; |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | this.facilityViewModelBindingSource.DataSource = _allBindingList; |
| | | this.facilityViewModelBindingSource.ResetBindings(false); |
| | | } |
| | | |
| | | //新增小区 |
| | | private void btnAddBuilding_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //新增 |
| | | private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | /* var dlg = new AddPlaceDlg(); |
| | | dlg.SetBindingData("Build"); |
| | | dlg.ReloadDataEvent += async (Vmo) => |
| | | { |
| | | var id = await _facilityBll.Insert(Vmo); |
| | | if (id > 0) |
| | | { |
| | | _allBindingList.Add(new PlaceViewModel(Vmo)); |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog();*/ |
| | | } |
| | | |
| | | //新增学校 |
| | | private void btnAddschool_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | /* var dlg = new AddPlaceDlg(); |
| | | dlg.SetBindingData("School"); |
| | | dlg.ReloadDataEvent += async (Vmo) => |
| | | { |
| | | var id = await _facilityBll.Insert(Vmo); |
| | | if (id > 0) |
| | | { |
| | | _allBindingList.Add(new PlaceViewModel(Vmo)); |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog();*/ |
| | | } |
| | | |
| | | //新增医院 |
| | | private void btnAddHospital_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | /* var dlg = new AddPlaceDlg(); |
| | | dlg.SetBindingData("Hospital"); |
| | | dlg.ReloadDataEvent += async (Vmo) => |
| | | { |
| | | var id = await _facilityBll.Insert(Vmo); |
| | | if (id > 0) |
| | | { |
| | | _allBindingList.Add(new PlaceViewModel(Vmo)); |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | */ |
| | | } |
| | | |
| | | //新增商铺 |
| | | private void btnAddShop_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | /* var dlg = new AddPlaceDlg(); |
| | | dlg.SetBindingData("Shop"); |
| | | dlg.ReloadDataEvent += async (Vmo) => |
| | | { |
| | | var id = await _facilityBll.Insert(Vmo); |
| | | if (id > 0) |
| | | { |
| | | _allBindingList.Add(new PlaceViewModel(Vmo)); |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | */ |
| | | var dlg = new AddFacilityDlg(); |
| | | dlg.ReloadDataEvent += async (vmo) => |
| | | { |
| | | var id = await _facilityBll.Insert(vmo); |
| | | if (id > 0) |
| | | { |
| | | vmo.ID = id; |
| | | _allBindingList.Add(new FacilityViewModel(vmo)); |
| | | this.facilityViewModelBindingSource.ResetBindings(false); |
| | | return true; |
| | | } |
| | | return false; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //删除 |
| | |
| | | return; |
| | | } |
| | | _allBindingList.Remove(vm); |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | this.facilityViewModelBindingSource.ResetBindings(false); |
| | | TipFormHelper.ShowSucceed("删除成功!"); |
| | | } |
| | | |
| | |
| | | current.SortCode = prev.SortCode; |
| | | prev.SortCode = sortCode; |
| | | _allBindingList = _allBindingList.OrderBy(x => x.SortCode).ToList(); |
| | | this.placeViewModelBindingSource.DataSource = _allBindingList; |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | this.facilityViewModelBindingSource.DataSource = _allBindingList; |
| | | this.facilityViewModelBindingSource.ResetBindings(false); |
| | | this.gridView1.FocusedRowHandle = prevHandle; |
| | | } |
| | | |
| | |
| | | current.SortCode = next.SortCode; |
| | | next.SortCode = sortCode; |
| | | _allBindingList = _allBindingList.OrderBy(x => x.SortCode).ToList(); |
| | | this.placeViewModelBindingSource.DataSource = _allBindingList; |
| | | this.placeViewModelBindingSource.ResetBindings(false); |
| | | this.facilityViewModelBindingSource.DataSource = _allBindingList; |
| | | this.facilityViewModelBindingSource.ResetBindings(false); |
| | | this.gridView1.FocusedRowHandle = nextHandle; |
| | | } |
| | | } |