Example #1
0
        public override CommandResult Delete(DeviceBus info)
        {
            var devices = new DeviceBLL(RepoUri).GetItems(null).QueryObjects;

            if (devices != null && devices.Exists(it => it.Bus == info.ID))
            {
                return(new CommandResult(ResultCode.Fail, "不能删除此总线, 已经有设备挂接在这个总线之下"));
            }
            return(base.Delete(info));
        }
Example #2
0
        public override CommandResult Delete(Division info)
        {
            var devices = new DeviceBLL(RepoUri).GetItems(null).QueryObjects;

            if (devices != null && devices.Exists(it => it.Division == info.ID))
            {
                return(new CommandResult(ResultCode.Fail, "区域下面已经有设备不能删除"));
            }
            return(base.Delete(info));
        }