Esempio n. 1
0
        /// <summary>
        /// 获取某角色
        /// </summary>
        /// <param name="projectGuid"></param>
        /// <returns></returns>
        public RolePermissionModel GetRole(string guid)
        {
            RolePermissionModel model = null;

            redisoperate.model = new RolePermissionModel()
            {
                Guid = guid
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(guid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
                else
                {
                    LastErrorDescribe = "未找到该角色";
                }
            }

            return(model);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取功能点
        /// </summary>
        /// <param name="parkingcode"></param>
        /// <returns></returns>
        public FunctionPointModel GetFunctionPoint(string projectguid, string parkcode)
        {
            FunctionPointModel model = null;

            redisoperate.model = new FunctionPointModel()
            {
                ParkCode = parkcode
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(parkcode);
                if (model == null)
                {
                    //都没有的时候设置一个默认的
                    model = new FunctionPointModel()
                    {
                        ProjectGuid  = projectguid,
                        ParkCode     = parkcode,
                        PostponeMode = 0,
                        PastDueMode  = 0,
                        MinDays      = 0,
                        MinBalance   = 0
                    };
                }
            }

            return(model);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取车道车辆进出抓拍数据
        /// </summary>
        /// <param name="parkingCode">车场编号</param>
        /// <param name="deviceMacAddress">车道mac地址</param>
        /// <returns></returns>
        public CaptureInOutModel GetGateData(string parkingCode, string deviceMacAddress)
        {
            CaptureInOutModel model = null;

            _gateDataRedisOperate.model = new CaptureInOutModel()
            {
                ParkCode = parkingCode, DriveWayMAC = deviceMacAddress
            };
            model = _gateDataRedisOperate.GetFromRedis();
            return(model);
        }
Esempio n. 4
0
        /// <summary>
        /// 获取车道拦截异常数据
        /// </summary>
        /// <param name="devicemacaddress">车道相机标识</param>
        /// <returns></returns>
        public GateCatchDetailModel GetGateCatch(string devicemacaddress)
        {
            GateCatchDetailModel model = null;

            _gateCatchRedisOperate.model = new GateCatchDetailModel()
            {
                DriveWayMAC = devicemacaddress
            };
            model = _gateCatchRedisOperate.GetFromRedis();
            return(model);
        }
Esempio n. 5
0
        /// <summary>
        /// 读取车道闸口锁定集合
        /// </summary>
        /// <param name="parkingCode">停车场编码</param>
        /// <returns></returns>
        public GateKeepListModel GetGateKeep(string parkingCode)
        {
            GateKeepListModel model = null;

            _gateKeepRedisOperate.model = new GateKeepListModel()
            {
                ParkingCode = parkingCode
            };
            model = _gateKeepRedisOperate.GetFromRedis();
            return(model);
        }
Esempio n. 6
0
        /// <summary>
        /// 获取车场的剩余车位数
        /// </summary>
        /// <param name="parkcode"></param>
        /// <returns></returns>
        public SpaceNumberModel GetRemainingSpace(string parkcode)
        {
            SpaceNumberModel model = null;

            redisoperate.model = new SpaceNumberModel()
            {
                ParkCode = parkcode
            };
            model = redisoperate.GetFromRedis();
            return(model);
        }
Esempio n. 7
0
        /// <summary>
        /// 获取某计费模板
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public BillingTemplateModel GetBillingTemplate(string carTypeGuid)
        {
            BillingTemplateModel model = null;

            redisoperate.model = new BillingTemplateModel()
            {
                CarTypeGuid = carTypeGuid
            };
            model = redisoperate.GetFromRedis();
            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(carTypeGuid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }
            return(model);
        }
Esempio n. 8
0
        /// <summary>
        /// 根据停车场编码获取停车场
        /// </summary>
        /// <param name="parkingCode">停车场编码</param>
        /// <returns>停车场实体</returns>
        public ParkLotModel GetParkLot(string parkingCode)
        {
            ParkLotModel model = null;

            redisoperate.model = new ParkLotModel()
            {
                ParkCode = parkingCode
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(parkingCode);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }
            return(model);
        }
Esempio n. 9
0
        public APIAccessModel Get(string appid)
        {
            APIAccessModel model = null;

            redisoperate.model = new APIAccessModel()
            {
                AppID = appid
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(appid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }
            return(model);
        }
Esempio n. 10
0
        /// <summary>
        /// 获取某车类
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public CarTypeModel GetCarType(string guid)
        {
            CarTypeModel model = null;

            redisoperate.model = new CarTypeModel()
            {
                Guid = guid
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(guid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }

            return(model);
        }
Esempio n. 11
0
        /// <summary>
        /// 获取某车道
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public DrivewayModel GetDriveway(string guid)
        {
            DrivewayModel model = null;

            _redisoperate.model = new DrivewayModel()
            {
                Guid = guid
            };
            model = _redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = _databaseoperate.GetFromDataBase(guid);
                //缓存到redis
                if (model != null)
                {
                    _redisoperate.model = model;
                    _redisoperate.SaveToRedis();
                }
            }

            return(model);
        }
Esempio n. 12
0
        /// <summary>
        /// 获取某收款账户
        /// </summary>
        /// <param name="guid">该账户guid</param>
        /// <returns></returns>
        public GatherAccountModel GetGatherAccount(string guid)
        {
            GatherAccountModel model = null;

            redisoperate.model = new GatherAccountModel()
            {
                Guid = guid
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(guid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }

            return(model);
        }
Esempio n. 13
0
        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <param name="projectGuid"></param>
        /// <returns></returns>
        public MenuModel GetMenu(string projectGuid)
        {
            MenuModel model = null;

            redisoperate.model = new MenuModel()
            {
                ProjectGuid = projectGuid
            };
            model = redisoperate.GetFromRedis();

            //从数据库读
            if (model == null)
            {
                model = databaseoperate.GetFromDataBase(projectGuid);
                //缓存到redis
                if (model != null)
                {
                    redisoperate.model = model;
                    redisoperate.SaveToRedis();
                }
            }

            return(model);
        }