Esempio n. 1
0
        /// <summary>
        /// 添加车类
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddCarType(CarTypeModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (!flag)
            {
                return(false);       //数据库不成功就不要往下执行了
            }
            return(redisoperate.SaveToRedis());
        }
Esempio n. 2
0
        /// <summary>
        /// 添加车场
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddParkLot(ParkLotModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (flag)
            {
                flag = redisoperate.SaveToRedis();
            }
            return(flag);
        }
Esempio n. 3
0
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public bool AddRole(RolePermissionModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (!flag)
            {
                return(false);       //数据库不成功就不要往下执行了
            }
            return(redisoperate.SaveToRedis());
        }
Esempio n. 4
0
        /// <summary>
        /// 设置固定车延期模板
        /// </summary>
        /// <returns></returns>
        public bool SetPermanentTemplate(PermanentTemplateModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (flag)
            {
                //此时不需要判断redis是否成功,因为修改时redis一定会返回false
                redisoperate.SaveToRedis();
            }
            return(flag);
        }
Esempio n. 5
0
        /// <summary>
        /// 添加车道
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddDriveway(DrivewayModel model)
        {
            _redisoperate.model = model;
            bool flag = _databaseoperate.SaveToDataBase(model);

            if (flag)
            {
                flag = _redisoperate.SaveToRedis();
                if (flag)
                {
                    flag = _extenredisoperate.KeyLinkGuid(); //关联设备MAC与车道GUID
                }
            }
            return(flag);
        }
Esempio n. 6
0
        /// <summary>
        /// 添加城市
        /// </summary>
        /// <returns></returns>
        public bool AddCityCode(CityCodeModel model)
        {
            redisoperate.model = model;
            bool redisResult = redisoperate.SaveToRedis();

            return(redisResult);
        }
Esempio n. 7
0
 /// <summary>
 /// 车道闸口锁定
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool SetGateKeep(GateKeepListModel model)
 {
     _gateKeepRedisOperate.model = model;
     //因修改的时候始终是false,所以暂不参考redis返回值
     _gateKeepRedisOperate.SaveToRedis();
     return(true);
 }
Esempio n. 8
0
        /// <summary>
        /// 设置剩余车位数
        /// </summary>
        /// <returns></returns>
        public bool SetRemainingSpace(SpaceNumberModel model)
        {
            redisoperate.model = model;
            bool redisResult = redisoperate.SaveToRedis();

            return(redisResult);
        }
Esempio n. 9
0
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddUser(UserAccountModel model)
        {
            List <UserAccountModel> alluser = GetUserList(model.ProjectGuid);

            if (!alluser.Exists(o => o.Mobile == model.Mobile))
            {
                redisoperate.model = model;
                bool flag = databaseoperate.SaveToDataBase(model);
                if (!flag)
                {
                    return(false);       //数据库不成功就不要往下执行了
                }
                return(redisoperate.SaveToRedis());
            }
            else
            {
                LastErrorDescribe = "添加失败!当前用户已存在";
                return(false);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 设置功能点
        /// </summary>
        /// <returns></returns>
        public bool SetFunctionPoint(FunctionPointModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.SaveToDataBase(model);

            if (!flag)
            {
                return(false);
            }
            //此时不需要判断redis是否成功,因为修改时redis一定会返回false
            redisoperate.SaveToRedis();
            return(flag);
        }
Esempio n. 11
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);
        }