public static bool Update(BaseParkinfo model, bool addlog = true) { if (model == null) { throw new ArgumentNullException("model"); } if (string.IsNullOrWhiteSpace(model.PKNo)) { throw new MyException("车场编号不能为空"); } IParking factory = ParkingFactory.GetFactory(); BaseParkinfo park = factory.QueryParkingByParkingNo(model.PKNo); if (park != null && park.PKID != model.PKID) { throw new MyException("车场编号不能重复"); } bool result = factory.Update(model); if (result && addlog) { OperateLogServices.AddOperateLog <BaseParkinfo>(model, OperateType.Update); } return(result); }