コード例 #1
0
        public ActionResult CXOrder(string orderid, int type)
        {
            try
            {
                string auth = AppUserToken;

                if (auth.IsEmpty())
                {
                    //没有登录
                    //
                    return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
                }
                else if (auth == "-1")
                {
                    return(RedirectToAction("Register", "ParkingPayment"));
                }
                ParkingDetail pkd = ParkingApi.cc(orderid, type, auth);
                //Session[token]
                ParkingDetail pk = JsonConvert.DeserializeObject <ParkingDetail>(JsonHelper.GetJsonString(pkd));
                return(View(pk));
            }
            catch
            {
                return(View());
            }
        }
コード例 #2
0
        public async Task <ActionResult <ParkingDetail> > CreateParkingDetail(ParkingDetail parkingDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var createdparkingDetail = await _parkingDetailService.Create(parkingDetail);

            return(Ok(createdparkingDetail));
        }
コード例 #3
0
        /// <summary>
        /// 获取停车详情
        /// 1001 订单查询成功,业务参数将返回。
        /// 1002 未查询到停车信息。
        /// 1500 接口处理异常。
        /// </summary>
        public override APIReply <ParkingDetail> ParkingDetail(ParkingDetailRequest request)
        {
            ParkingPayment payment = new ParkingPayment();

            payment.PayType = PYun.API.Reply.ParkingPayment.PAY_TYPE_CASH;

            ParkingDetail detail = new ParkingDetail();

            detail.PlateColor = ColorType.Blue;
            return(base.ParkingDetail(request));
        }
コード例 #4
0
        public async Task <ParkingDetail> Create(ParkingDetail parkingDetail)
        {
            if (parkingDetail == null)
            {
                return(null);
            }

            _genijalnoParkingContext.ParkingDetails.Add(parkingDetail);

            await _genijalnoParkingContext.SaveChangesAsync();

            return(parkingDetail);
        }
コード例 #5
0
        public async Task <ActionResult <ParkingDetail> > UpdateParkingDetail(ParkingDetail parkingDetail)
        {
            if (parkingDetail == null)
            {
                return(BadRequest());
            }

            //var pd = await _parkingDetailService.Get(id);

            //if (pd == null)
            //    return BadRequest();

            var updatedParkingDetail = await _parkingDetailService.Update(parkingDetail);

            return(Ok(updatedParkingDetail));
        }
コード例 #6
0
        public async Task <ParkingDetail> Update(ParkingDetail parkingDetail)
        {
            var updatedParkingDetail = await _parkingDetailRepository.Update(parkingDetail);

            return(updatedParkingDetail);
        }
コード例 #7
0
        public async Task <ParkingDetail> Create(ParkingDetail parkingDetail)
        {
            var createdParkingDetail = await _parkingDetailRepository.Create(parkingDetail);

            return(createdParkingDetail);
        }