/// <summary> /// 获取某卡 /// </summary> /// <param name="guid"></param> /// <returns></returns> public CardServiceModel GetCard(string carNo, string parkCode, CarTypeEnum carType) { try { CardServiceModel model = null; string key = parkCode + Convert.ToBase64String(Encoding.UTF8.GetBytes(carNo)); switch (carType) { case CarTypeEnum.TempCar: model = _tempCardDatabaseoperate.GetFromDataBase(key); break; case CarTypeEnum.MonthCar: model = _monthCardDatabaseoperate.GetFromDataBase(key); break; case CarTypeEnum.ValueCar: model = _valueCardDatabaseoperate.GetFromDataBase(key); break; case CarTypeEnum.VIPCar: model = _monthCardDatabaseoperate.GetFromDataBase(key); break; } return(model); } catch (Exception ex) { return(null); } }
/// <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); }
/// <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); }
/// <summary> /// 获取某黑名单 /// </summary> /// <param name="guid"></param> /// <returns></returns> public BlacklistModel GetBlacklist(string parkcode) { BlacklistModel model = new BlacklistModel(); try { //只从数据库读,redis并不缓存此实体 model = databaseoperate.GetFromDataBase(parkcode); model.List.OrderByDescending(a => a.StartDate).ToList(); //降序 return(model); } catch (Exception ex) { return(null); } }
/// <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); }
/// <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); }
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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// 读取指令 /// </summary> /// <param name="drivewayGuid">车道唯一id</param> /// <returns></returns> public VoiceCommandModel GetCommand(string drivewayGuid) { return(databaseoperate.GetFromDataBase(drivewayGuid)); }
/// <summary> /// 读取通行设置 /// </summary> /// <param name="guid"></param> /// <returns></returns> public TrafficRestrictionModel GetTrafficRestriction(string guid) { return(databaseoperate.GetFromDataBase(guid)); }
/// <summary> /// 读取开闸原因 /// </summary> /// <param name="drivewayGuid"></param> /// <returns></returns> public OpenGateReasonModel GetOpenReason(string guid) { return(databaseoperate.GetFromDataBase(guid)); }