Exemple #1
0
        /// <summary>
        /// Main Method to create professor dictionaries
        /// It contains keys for expertise level 3,4 and 5
        /// </summary>
        /// <param name="id">id of the professor</param>
        /// <param name="exp">expertise</param>
        public void MakeMainDictionary(int id, Expertise exp)
        {
            Dictionary <int, List <int> > expDic = new Dictionary <int, List <int> >();

            if (mainDic.ContainsKey(id))
            {
                expDic      = mainDic[id];
                mainDic[id] = MakeExpDictionary(expDic, exp);
            }
            else
            {
                expDic = MakeExpDictionary(expDic, exp);
                mainDic.Add(id, expDic);
            }
        }
Exemple #2
0
        /// <summary>
        /// Method to make expertise directory
        /// </summary>
        /// <param name="expDic">expertise dictionary</param>
        /// <param name="exp">expertise</param>
        /// <returns>expertise dictionary</returns>
        public Dictionary <int, List <int> > MakeExpDictionary(Dictionary <int, List <int> > expDic, Expertise exp)
        {
            List <int> profList = new List <int>();

            if (expDic.ContainsKey(exp.TopicID))
            {
                profList = expDic[exp.TopicID];
                profList.Add(exp.ProfessorID);
                expDic[exp.TopicID] = profList;
            }
            else
            {
                profList.Add(exp.ProfessorID);
                expDic.Add(exp.TopicID, profList);
            }
            return(expDic);
        }