public List <LimitedTimeGiftTemplate> GetLimitedTimeGiftListByType(LTGTriggerType type) { List <LimitedTimeGiftTemplate> temp = new List <LimitedTimeGiftTemplate>(); for (int i = 0; i < mLimitedTimeGiftList.Count; ++i) { if (mLimitedTimeGiftList[i].TriggerType == type) { temp.Add(mLimitedTimeGiftList[i]); } } return(temp); }
public LimitedTimeGiftTemplate GetLimitedTimeGiftByTypeAndParam(LTGTriggerType type, string param) { for (int i = 0; i < mLimitedTimeGiftList.Count; ++i) { if (mLimitedTimeGiftList[i].TriggerType == type) { if (string.IsNullOrEmpty(param)) { return(mLimitedTimeGiftList[i]); } else if (!string.IsNullOrEmpty(mLimitedTimeGiftList[i].TargetParameter)) { if (mLimitedTimeGiftList[i].TargetParameter.StartsWith("<")) { var str = mLimitedTimeGiftList[i].TargetParameter.Replace("<", "").Split(','); if (str != null && str.Length > 0) { if (int.Parse(param) < int.Parse(str[0])) { return(mLimitedTimeGiftList[i]); } } } else if (mLimitedTimeGiftList[i].TargetParameter.StartsWith(">")) { var str = mLimitedTimeGiftList[i].TargetParameter.Replace(">", "").Split(','); if (str != null && str.Length > 0) { if (int.Parse(param) > int.Parse(str[0])) { return(mLimitedTimeGiftList[i]); } } } else { if (mLimitedTimeGiftList[i].TargetParameter.Equals(param)) { return(mLimitedTimeGiftList[i]); } } } } } return(null); }