Пример #1
0
        private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int selectedHandle;

            selectedHandle = this.gridView1.GetSelectedRows()[0];
            if (selectedHandle >= 0)
            {
                string AddressTypeid = this.gridView1.GetRowCellValue(selectedHandle, "ID").ToString();
                //删除前判断当前地点类型下面是否有活动测点  20170829
                PointDefineGetByAddressTypeIdRequest PointDefineRequest = new PointDefineGetByAddressTypeIdRequest();
                PointDefineRequest.AddressTypeId = AddressTypeid;
                var result = pointDefineService.GetPointDefineCacheByAddressTypeId(PointDefineRequest);
                if (result.Data != null && result.Data.Count > 0)
                {
                    XtraMessageBox.Show("当前地点类型下面存在已定义设备,请先删除设备,再删除当前地点类型!");
                    return;
                }
                if (XtraMessageBox.Show("删除不可恢复,是否确定删除?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    KJ_AddresstypeDeleteRequest AddressTyperequest = new KJ_AddresstypeDeleteRequest();
                    AddressTyperequest.Id = AddressTypeid;
                    AddressTypeService.DeleteKJ_Addresstype(AddressTyperequest);
                    //删除当前地点类型下面的定义的规则
                    KJ_AddresstyperuleDeleteByAddressTypeIdRequest kJ_AddresstyperuleRequest = new KJ_AddresstyperuleDeleteByAddressTypeIdRequest();
                    kJ_AddresstyperuleRequest.AddressTypeId = AddressTypeid;
                    AddresstyperuleService.DeleteKJ_AddresstyperuleByAddressTypeId(kJ_AddresstyperuleRequest);
                    LoadAddressType();
                }
            }
        }
Пример #2
0
        public BasicResponse DeleteKJ_AddresstyperuleByAddressTypeId(KJ_AddresstyperuleDeleteByAddressTypeIdRequest kJ_AddresstyperuleRequest)
        {
            _Repository.DeleteKJ_AddresstyperuleByAddressTypeId(kJ_AddresstyperuleRequest.AddressTypeId);
            var kJ_Addresstyperuleresponse = new BasicResponse();

            return(kJ_Addresstyperuleresponse);
        }