Esempio n. 1
0
        public JsonResult GetParkFeeRuleData()
        {
            JsonResult json = new JsonResult();

            try
            {
                if (string.IsNullOrEmpty(Request.Params["parkingId"]))
                {
                    return(json);
                }

                string parkingId = Request.Params["parkingId"].ToString();

                List <ParkCarType>     carTypes  = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingId);
                List <ParkCarModel>    carModels = ParkCarModelServices.QueryByParkingId(parkingId);
                List <ParkFeeRule>     rules     = ParkFeeRuleServices.QueryParkFeeRuleByParkingId(parkingId);
                List <ParkArea>        areas     = ParkAreaServices.GetParkAreaByParkingId(parkingId);
                List <ParkFeeRuleView> models    = new List <ParkFeeRuleView>();
                foreach (var item in rules)
                {
                    ParkFeeRuleView view = new ParkFeeRuleView().ToParkFeeRuleView(item, areas, carTypes, carModels);
                    view.ParkingID = parkingId;
                    models.Add(view);
                }
                json.Data = models;
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "获取收费规则集合失败");
            }
            return(json);
        }
Esempio n. 2
0
        /// <summary>
        /// 车辆进场类型
        /// </summary>
        /// <returns></returns>
        public JsonResult GetCardEntranceType()
        {
            string     parkingid = Request.Params["parkingid"];
            JsonResult json      = new JsonResult();

            try
            {
                json.Data = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingid);
            }
            catch { }
            return(json);
        }
Esempio n. 3
0
        public JsonResult GetParkCarType()
        {
            JsonResult json = new JsonResult();

            if (string.IsNullOrEmpty(Request.Params["parkingId"]))
            {
                return(json);
            }

            string parkingId = Request.Params["parkingid"].ToString();

            json.Data = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingId)
                        .Where(p => p.BaseTypeID == BaseCarType.StoredValueCar || p.BaseTypeID == BaseCarType.TempCar);

            return(json);
        }
Esempio n. 4
0
 public JsonResult GetCarTypeData(string parkingId)
 {
     try
     {
         List <ParkCarType> carTypes = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingId);
         carTypes = carTypes.Where(p => p.BaseTypeID != BaseCarType.TempCar).ToList();
         return(Json(MyResult.Success("", carTypes)));
     }
     catch (MyException ex)
     {
         return(Json(MyResult.Error(ex.Message)));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptions(ex, "获取车类失败");
         return(Json(MyResult.Error("获取车类失败")));
     }
 }
Esempio n. 5
0
        public JsonResult GetCarTypeData(string parkingId)
        {
            JsonResult json = new JsonResult();

            try
            {
                List <ParkCarType> carTypes = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingId);
                json.Data = carTypes;
                return(json);
            }
            catch (MyException ex)
            {
                ExceptionsServices.AddExceptions(ex, ex.Message);
                return(json);
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "获取车类失败");
                return(json);
            }
        }
Esempio n. 6
0
        public JsonResult GetParkCarTypeData()
        {
            JsonResult json = new JsonResult();

            try
            {
                if (string.IsNullOrEmpty(Request.Params["parkingId"]))
                {
                    return(json);
                }

                string             parkingid = Request.Params["parkingid"].ToString();
                BaseParkinfo       parking   = ParkingServices.QueryParkingByRecordId(parkingid);
                List <ParkCarType> carTypes  = ParkCarTypeServices.QueryParkCarTypeByParkingId(parkingid);
                foreach (var item in carTypes)
                {
                    ProcessListShowData(item);
                }
                var result = from p in carTypes select new {
                    CarTypeID                = p.CarTypeID,
                    CarTypeName              = p.CarTypeName,
                    PKID                     = p.PKID,
                    BaseTypeID               = (int)p.BaseTypeID,
                    BaseTypeDes              = p.BaseTypeID.GetDescription(),
                    RepeatIn                 = p.RepeatIn,
                    ParkName                 = parking.PKName,
                    RepeatOut                = p.RepeatOut,
                    AffirmIn                 = p.AffirmIn,
                    AffirmOut                = p.AffirmOut,
                    InBeginTime              = p.InBeginTime != DateTime.MinValue ? p.InBeginTime.ToString("yyyy-MM-dd HH:mm:ss") : "",
                    InEdnTime                = p.InEdnTime != DateTime.MinValue ? p.InEdnTime.ToString("yyyy-MM-dd HH:mm:ss") : "",
                    MaxUseMoney              = p.MaxUseMoney,
                    AllowLose                = p.AllowLose,
                    LpDistinguish            = (int)p.LpDistinguish,
                    LpDistinguishDes         = p.LpDistinguish.GetDescription(),
                    InOutEditCar             = p.InOutEditCar,
                    InOutTime                = p.InOutTime,
                    CarNoLike                = p.CarNoLike,
                    IsAllowOnlIne            = p.IsAllowOnlIne,
                    Amount                   = p.Amount,
                    MaxMonth                 = p.MaxMonth,
                    MaxValue                 = p.MaxValue,
                    OnlineUnit               = p.OnlineUnit,
                    OverdueToTemp            = p.OverdueToTemp,
                    OverdueToTempDes         = p.OverdueToTemp.GetDescription(),
                    LotOccupy                = p.LotOccupy,
                    LotOccupyDes             = p.LotOccupy.GetDescription(),
                    Deposit                  = p.Deposit,
                    MonthCardExpiredEnterDay = p.MonthCardExpiredEnterDay,
                    AffirmBegin              = string.IsNullOrWhiteSpace(p.AffirmBegin)?"00:00":p.AffirmBegin,
                    AffirmEnd                = string.IsNullOrWhiteSpace(p.AffirmEnd) ? "23:59" : p.AffirmEnd,
                    IsDispatch               = p.IsDispatch
                };
                json.Data = result;
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "获取车类型集合失败");
            }
            return(json);
        }