Esempio n. 1
0
        public ActionResult Index()
        {
            try
            {
                string auth = AppUserToken;

                if (auth.IsEmpty())
                {
                    //没有登录
                    //
                    return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
                }
                else if (auth == "-1")
                {
                    return(RedirectToAction("Register", "ParkingPayment"));
                }
                Car car   = Carapi.bb(auth);
                Car mycar = JsonConvert.DeserializeObject <Car>(JsonHelper.GetJsonString(car));

                return(View(mycar));
            }
            catch (Exception e)
            {
                return(View());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 根据月卡包月数获取可用优惠券
        /// </summary>
        /// <param name="CardID"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public string GetCouponByMonth(string CardID, int month)
        {
            StringBuilder strData = new StringBuilder();
            string        auth    = AppUserToken;

            CouponByMonth      cb   = Carapi.cbm(CardID, month, auth);
            CouponByMonth      coup = JsonConvert.DeserializeObject <CouponByMonth>(JsonHelper.GetJsonString(cb));
            List <CouponByMon> list = new List <CouponByMon>(coup.Result.CouponList);
            var obj = from p in list
                      select new
            {
                Full         = p.Full.ToString(),
                Cut          = p.Cut.ToString(),
                ReceiveTime  = p.ReceiveTime.ToString("yyyy-MM-dd HH:mm:ss"),
                DeadlineTime = p.DeadlineTime.ToString("yyyy-MM-dd HH:mm:ss"),
                Status       = (int)p.Status,
                CouponID     = p.CouponID,
                CapPrice     = p.CapPrice.ToString(),
                CouponType   = p.CouponType,
                Brife        = p.Brife,
                CutPrice     = p.CutPrice.ToString(),
            };

            //strData.Append("{");

            strData.Append(JsonHelper.GetJsonString(obj));

            //strData.Append("}");
            return(strData.ToString());
        }
Esempio n. 3
0
        public ActionResult Index()
        {
            try
            {
                string auth = AppUserToken;
                LogerHelper.Loger.Info(AppUserToken);
                if (auth.IsEmpty())
                {
                    //没有登录
                    //
                    return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
                }
                else if (auth == "-1")
                {
                    return(RedirectToAction("Register", "ParkingPayment"));
                }

                //string auth = "D8F586C77EB73316CFB5FC8C035EF3AFD4BF2EB5DF8F150448EDB019BFE4E5814E401DEBF5C242031E53AD4858A3C1DFDF2537FD4F193CC86928F771770CF6CA";



                Car car   = Carapi.bb(auth);
                Car mycar = JsonConvert.DeserializeObject <Car>(JsonHelper.GetJsonString(car));

                return(View(mycar));
            }
            catch (Exception e)
            {
                return(View());
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 月卡明细
        /// </summary>
        /// <returns></returns>
        public ActionResult MonthCardMX()
        {
            string auth = AppUserToken;

            if (auth.IsEmpty())
            {
                //没有登录
                //
                return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
            }
            else if (auth == "-1")
            {
                return(RedirectToAction("Register", "ParkingPayment"));
            }
            CardDetail cd     = Carapi.cd(1, 1, 50, auth);
            CardDetail detail = JsonConvert.DeserializeObject <CardDetail>(JsonHelper.GetJsonString(cd));

            return(View(detail));
        }
Esempio n. 5
0
        /// <summary>
        /// 月卡信息
        /// </summary>
        /// <param name="CarID"></param>
        /// <returns></returns>
        public ActionResult MonthCardInfo(string CarID)
        {
            string auth = AppUserToken;

            if (auth.IsEmpty())
            {
                //没有登录
                //
                return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
            }
            else if (auth == "-1")
            {
                return(RedirectToAction("Register", "ParkingPayment"));
            }
            MonthCard mc1  = Carapi.mc(auth, CarID);
            MonthCard mymc = JsonConvert.DeserializeObject <MonthCard>(JsonHelper.GetJsonString(mc1));

            if (mymc == null)
            {
                return(null);
            }
            return(View(mymc));
        }
Esempio n. 6
0
        public ActionResult DeleteMyLicensePlate(string cid, string plateNo = "")
        {
            try
            {
                string auth = AppUserToken;

                if (auth.IsEmpty())
                {
                    //没有登录
                    //
                    return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
                }
                else if (auth == "-1")
                {
                    return(RedirectToAction("Register", "ParkingPayment"));
                }
                //string auth = "D8F586C77EB73316CFB5FC8C035EF3AFD4BF2EB5DF8F150448EDB019BFE4E5814E401DEBF5C242031E53AD4858A3C1DFDF2537FD4F193CC86928F771770CF6CA";
                string        carid      = cid;
                Unbundlingcar uncar      = Carapi.cc(carid, auth);
                Unbundlingcar jiebangcar = JsonConvert.DeserializeObject <Unbundlingcar>(JsonHelper.GetJsonString(uncar));
                if (uncar.Result == "解绑车辆成功")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "解绑车辆成功" };
                    res.Data = Phone;//返回单个对象;

                    //
                    if (!plateNo.IsEmpty())
                    {
                        //先查询
                        WX_CarInfo car = CarService.GetCarInfoByPlateNo(WeiXinUser.AccountID, plateNo);
                        if (car != null)
                        {
                            bool result = CarService.DelWX_CarInfo(car.RecordID);
                            if (!result)
                            {
                                TxtLogServices.WriteTxtLogEx("WXBindCarError", "用户删除车牌失败:{2},{1},{0}", result, car.RecordID, plateNo);
                            }
                        }
                    }
                    //
                    return(res);
                }
                else if (uncar.Result == "该账号已在其他设备登录,请重新登录")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "该账号已在其他设备登录,请重新登录" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
                else if (uncar.Result == "该车辆有未出场记录,无法解绑")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "该车辆有未出场记录,无法解绑" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
                else
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "解绑车辆失败" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
            }
            catch (Exception e)
            {
                return(Json(MyResult.Error("解绑失败")));
            }
        }
Esempio n. 7
0
        public ActionResult AddMyLicensePlate(string licenseplate)
        {
            try
            {
                string auth = AppUserToken;

                if (auth.IsEmpty())
                {
                    //没有登录
                    //
                    return(RedirectToAction("Index", "ErrorPrompt", new { message = "用户登录失败" }));
                }
                else if (auth == "-1")
                {
                    return(RedirectToAction("Register", "ParkingPayment"));
                }

                //string auth = "D8F586C77EB73316CFB5FC8C035EF3AFD4BF2EB5DF8F150448EDB019BFE4E5814E401DEBF5C242031E53AD4858A3C1DFDF2537FD4F193CC86928F771770CF6CA";

                string plate    = licenseplate;
                AddCar addcar   = Carapi.dd(plate, auth);
                AddCar addmycar = JsonConvert.DeserializeObject <AddCar>(JsonHelper.GetJsonString(addcar));
                if (addcar.Result == "该车辆已被其它帐户绑定,是否找回?")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "该车辆已被其它帐户绑定" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
                else if (addcar.Result == "添加车辆成功")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "添加车辆成功" };
                    res.Data = Phone;//返回单个对象;

                    WX_CarInfo model = new WX_CarInfo();
                    model.AccountID = WeiXinUser.AccountID;
                    model.PlateNo   = licenseplate.ToPlateNo();
                    model.Status    = 1;
                    //
                    int result = CarService.AddWX_CarInfo(model);
                    if (result != 1)
                    {
                        TxtLogServices.WriteTxtLogEx("WXBindCarError", "用户添加车牌失败:{0}", result);
                    }
                    //
                    return(res);
                }
                else if (addcar.Result == "该账号已在其他设备登录,请重新登录")
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "该账号已在其他设备登录,请重新登录" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
                else
                {
                    JsonResult res   = new JsonResult();
                    var        Phone = new { Status = "添加失败" };
                    res.Data = Phone;//返回单个对象;
                    return(res);
                }
            }
            catch (Exception e)
            {
                return(Json(MyResult.Error("添加失败")));
            }
        }