public static bool Delete(string recordId) { if (string.IsNullOrWhiteSpace(recordId)) { throw new ArgumentNullException("recordId"); } List <ParkArea> areas = ParkAreaServices.GetParkAreaByParkingId(recordId); if (areas.Count != 0) { throw new MyException("请先删除改车场下的所有区域"); } IParking factory = ParkingFactory.GetFactory(); bool result = factory.Delete(recordId); if (result) { OperateLogServices.AddOperateLog(OperateType.Delete, string.Format("recordId:{0}", recordId)); } return(result); }