コード例 #1
0
        /// <summary>
        /// 透過學生類別取得 UDT 內設定不排名學生.ID
        /// </summary>
        /// <returns></returns>
        public static List <string> GetNonRankStudentIDFromUDTByStudentTag(List <StudentTagRecord> StudTagRecList, SchoolType ST)
        {
            List <string> TagNameList = new List <string>();
            List <string> retVal      = new List <string>();

            TagNameList = (from data in UDTTransfer.GetDataFromUDT_StudTypeWeight() where data.CheckNonRank == true && data.SchoolType == ST.ToString() select data.StudentType).ToList();

            foreach (StudentTagRecord StudTagRec in StudTagRecList)
            {
                if (TagNameList.Contains(StudTagRec.FullName))
                {
                    retVal.Add(StudTagRec.RefStudentID);
                }
            }
            return(retVal);
        }
コード例 #2
0
        /// <summary>
        /// 透過學生類別取得 UDT 內設定特種身分 學生.ID,特種身分
        /// </summary>
        /// <param name="StudTagRecList"></param>
        /// <param name="ST"></param>
        /// <returns></returns>
        public static Dictionary <string, string> GetStudentSpcTypeFormUDTByStudentTag(List <StudentTagRecord> StudTagRecList, SchoolType ST)
        {
            Dictionary <string, DAL.UserDefData_StudTypeWeight> retVal = new Dictionary <string, DAL.UserDefData_StudTypeWeight>();
            Dictionary <string, DAL.UserDefData_StudTypeWeight> weight = new Dictionary <string, DAL.UserDefData_StudTypeWeight>();
            Dictionary <string, string> retVal1 = new Dictionary <string, string>();

            foreach (DAL.UserDefData_StudTypeWeight udd in UDTTransfer.GetDataFromUDT_StudTypeWeight().Where(x => x.SchoolType == ST.ToString()))
            {
                if (udd.AddWeight < 0)
                {
                    continue;
                }

                if (!weight.ContainsKey(udd.StudentType))
                {
                    weight.Add(udd.StudentType, udd);
                }
            }

            foreach (StudentTagRecord StudTagRec in StudTagRecList)
            {
                if (weight.ContainsKey(StudTagRec.FullName))
                {
                    if (retVal.ContainsKey(StudTagRec.RefStudentID))
                    {
                        // 當有2個以上,取其高
                        if (retVal[StudTagRec.RefStudentID].AddWeight < weight[StudTagRec.FullName].AddWeight)
                        {
                            retVal[StudTagRec.RefStudentID] = weight[StudTagRec.FullName];
                        }
                    }
                    else
                    {
                        retVal.Add(StudTagRec.RefStudentID, weight[StudTagRec.FullName]);
                    }
                }
            }

            foreach (KeyValuePair <string, DAL.UserDefData_StudTypeWeight> dd in retVal)
            {
                // 回傳特種身分
                retVal1.Add(dd.Key, dd.Value.JoinStudType);
            }

            return(retVal1);
        }
コード例 #3
0
        /// <summary>
        /// 透過學生類別取得 UDT 內設定加分比重 學生.ID,比重
        /// </summary>
        /// <param name="StudTagRecList"></param>
        /// <param name="ST"></param>
        /// <returns></returns>
        public static Dictionary <string, decimal> GetStudentAddWeightFormUDTByStudentTag(List <StudentTagRecord> StudTagRecList, SchoolType ST)
        {
            Dictionary <string, decimal> retVal = new Dictionary <string, decimal>();
            Dictionary <string, decimal> weight = new Dictionary <string, decimal>();

            foreach (DAL.UserDefData_StudTypeWeight udd in UDTTransfer.GetDataFromUDT_StudTypeWeight().Where(x => x.SchoolType == ST.ToString()))
            {
                if (udd.AddWeight < 0)
                {
                    continue;
                }

                if (!weight.ContainsKey(udd.StudentType))
                {
                    weight.Add(udd.StudentType, udd.AddWeight);
                }
            }

            foreach (StudentTagRecord StudTagRec in StudTagRecList)
            {
                if (weight.ContainsKey(StudTagRec.FullName))
                {
                    if (retVal.ContainsKey(StudTagRec.RefStudentID))
                    {
                        // 當有2個以上,取其高
                        if (retVal[StudTagRec.RefStudentID] < weight[StudTagRec.FullName])
                        {
                            retVal[StudTagRec.RefStudentID] = weight[StudTagRec.FullName];
                        }
                    }
                    else
                    {
                        retVal.Add(StudTagRec.RefStudentID, weight[StudTagRec.FullName]);
                    }
                }
            }
            return(retVal);
        }