Beispiel #1
0
        public Enums.PayErrorMsg CheckParamsValid(GenerateOrderDto dto)
        {
            var errorMsg = Enums.PayErrorMsg.失败;

            if (dto.UserId <= 0 || dto.TotalFee < 0 || dto.Payment < 0 || dto.UserCouponId < 0 || dto.PostFee < 0)
            {
                return(Enums.PayErrorMsg.参数错误);
            }

            using (var cxt = DbContext(DbOperation.Read))
            {
                var repo   = new OrderRepo(cxt);
                var result = repo.CheckParamsValid(dto);
                EnumHelper.TryParsebyValue(result, out errorMsg);

                return(errorMsg);
            }
        }