/// <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); }
/// <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()); }
/// <summary> /// 删除固定车延期模板 /// </summary> /// <returns></returns> public bool DeletePermanentTemplate(PermanentTemplateModel model) { redisoperate.model = model; bool flag = databaseoperate.DeleteInDataBase(model); if (flag) { flag = redisoperate.DeleteInRedis(); } return(flag); }
/// <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); }
/// <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()); }