/// <summary> /// 预约日期是否可以预约 /// </summary> /// <returns></returns> public ActionResult IsReservationForDateValid(DateTime reservationForDate) { var jsonResult = new JsonResultModel <bool>() { Status = JsonResultStatus.Success }; var isValid = HttpContext.RequestServices.GetService <ReservationHelper>().IsReservationForDateAvailable(reservationForDate, false, out var msg); if (isValid) { jsonResult.SetSuccessResult(true); } else { jsonResult.Result = false; jsonResult.ErrorMsg = msg; } return(Json(jsonResult)); }