public static PlanInfos GetAddonPlanByPlan(string plan) { PlanInfos planInfos = default(PlanInfos); if (!string.IsNullOrEmpty(plan)) { try { if (ConfigVars.Instance.addonPlans != null && ConfigVars.Instance.addonPlans.Where(p => p.name.ToLower().Trim() == plan.ToLower().Trim()).Count() > 0) { planInfos = ConfigVars.Instance.addonPlans.Where(p => p.name.ToLower().Trim() == plan).FirstOrDefault(); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } return(planInfos); }
public static PlanInfos GetAddonPlanByLevel(string planLevel) { PlanInfos planInfos = default(PlanInfos); if (!string.IsNullOrEmpty(planLevel)) { try { if (ConfigVars.Instance.addonPlans != null && ConfigVars.Instance.addonPlans.Where(p => p.level.ToString() == planLevel).Count() > 0) { planInfos = ConfigVars.Instance.addonPlans.FirstOrDefault(p => p.level.ToString() == planLevel); } } catch (Exception e) { Console.WriteLine(e.Message); } } return(planInfos); }