コード例 #1
0
        public ActionResult ValidPrintDate(int?storeId, DateTime?startDate, DateTime?endDate)
        {
            if (!storeId.HasValue || !startDate.HasValue || !endDate.HasValue)
            {
                return(Json(OperationResult.Error("参数错误")));
            }

            //如果打印日期包含今日,需要店铺闭店
            if (endDate.Value.Date > DateTime.Now.Date)
            {
                return(Json(OperationResult.Error("打印日期不可超过今日")));
            }
            else if (endDate.Value.Date == DateTime.Now.Date)
            {
                if (!_storeContract.IsInClosedStat(storeId.Value))
                {
                    return(Json(OperationResult.Error("打印日期包含今日,店铺需要闭店后才能打印")));
                }
            }
            return(Json(OperationResult.OK()));
        }