Ejemplo n.º 1
0
        /// <summary>
        /// 注销车场
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CancelParkLot(ParkLotModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.DeleteInDataBase(model);

            if (flag)
            {
                flag = redisoperate.DeleteInRedis();  //此时不需要判断redis是否成功,因为修改时redis一定会返回false
            }
            return(flag);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除车类
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool DeleteCarType(CarTypeModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.DeleteInDataBase(model);

            if (!flag)
            {
                return(false);       //数据库不成功就不要往下执行了
            }
            return(redisoperate.DeleteInRedis());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 删除固定车延期模板
        /// </summary>
        /// <returns></returns>
        public bool DeletePermanentTemplate(PermanentTemplateModel model)
        {
            redisoperate.model = model;
            bool flag = databaseoperate.DeleteInDataBase(model);

            if (flag)
            {
                flag = redisoperate.DeleteInRedis();
            }
            return(flag);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 删除车道
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool DeleteDriveway(DrivewayModel model)
        {
            _redisoperate.model = model;
            bool flag = _databaseoperate.DeleteInDataBase(model);

            if (flag)
            {
                flag = _extenredisoperate.KeyUnLinkGuid(); //解除关联设备MAC与车道GUID
                if (flag)
                {
                    flag = _redisoperate.DeleteInRedis();
                }
            }
            return(flag);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public bool DeleteRole(RolePermissionModel model)
        {
            redisoperate.model = model;
            RolePermissionModel contentModel = GetRole(model.Guid);

            if (model.ProjectGuid != contentModel.ProjectGuid)
            {
                LastErrorDescribe = "项目编码不一致";//后续添加到错误枚举
                return(false);
            }
            if (model.IsAdmin)
            {
                LastErrorDescribe = "禁止删除超级管理员";//后续添加到错误枚举
                return(false);
            }
            bool flag = databaseoperate.DeleteInDataBase(model);

            if (!flag)
            {
                return(false);       //数据库不成功就不要往下执行了
            }
            return(redisoperate.DeleteInRedis());
        }