/// <summary> /// 取得年齡統計項目與值 /// </summary> /// <returns></returns> public Dictionary <string, int> GetAllAgeCountItemValue(AgeCountType act) { Dictionary <string, int> returnDic = null; if (act == AgeCountType.全部) { returnDic = _AgeTotalCountItemDic; } if (act == AgeCountType.男生) { returnDic = _AgeBoyCountItemDic; } if (act == AgeCountType.女生) { returnDic = _AgeGirlCountItemDic; } if (act == AgeCountType.未分性別) { returnDic = _AgeNoGenderCountItemDic; } return(returnDic); }
/// <summary> /// 取得某個年齡統計項目的值,找不到回傳-1 /// </summary> /// <param name="ItemName"></param> /// <param name="act"></param> /// <returns></returns> public int GetAgeCounterItemValue(string ItemName, AgeCountType act, string GradeYear) { int returnValue = -1; ItemName += "_" + GradeYear; if (act == AgeCountType.全部) { if (_AgeTotalCountItemDic.ContainsKey(ItemName)) { returnValue = _AgeTotalCountItemDic[ItemName]; } } if (act == AgeCountType.男生) { if (_AgeBoyCountItemDic.ContainsKey(ItemName)) { returnValue = _AgeBoyCountItemDic[ItemName]; } } if (act == AgeCountType.女生) { if (_AgeGirlCountItemDic.ContainsKey(ItemName)) { returnValue = _AgeGirlCountItemDic[ItemName]; } } if (act == AgeCountType.未分性別) { if (_AgeNoGenderCountItemDic.ContainsKey(ItemName)) { returnValue = _AgeNoGenderCountItemDic[ItemName]; } } return(returnValue); }