private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int selectedHandle; selectedHandle = this.gridView1.GetSelectedRows()[0]; if (selectedHandle >= 0) { string areaid = this.gridView1.GetRowCellValue(selectedHandle, "Areaid").ToString(); //删除前判断当前区域下面是否有活动测点 20170829 PointDefineGetByAreaIdRequest PointDefineRequest = new PointDefineGetByAreaIdRequest(); PointDefineRequest.AreaId = areaid; var result = pointDefineService.GetPointDefineCacheByAreaId(PointDefineRequest); if (result.Data != null && result.Data.Count > 0) { XtraMessageBox.Show("当前区域下面存在已定义设备,请先删除设备,再删除当前区域!"); return; } if (XtraMessageBox.Show("删除不可恢复,是否确定删除?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { AreaDeleteRequest arearequest = new AreaDeleteRequest(); arearequest.Id = areaid; areaService.DeleteArea(arearequest); LoadArea(); } } }
public BasicResponse <List <Jc_DefInfo> > GetPointDefineCacheByAreaId(PointDefineGetByAreaIdRequest PointDefineRequest) { return(_PointDefineService.GetPointDefineCacheByAreaId(PointDefineRequest)); }