//private Dictionary<string, List<DomainVO>> DomainsByDomainName = new Dictionary<string,List<DomainVO>>();

        public void AddDomain(SchoolYearSemester SchoolYearSemester, string StudentId, string DomainName, decimal?DomainScore)
        {
            DomainVO domainVO = new DomainVO();

            domainVO.DomainName = DomainName;
            if (DomainScore.HasValue)
            {
                domainVO.DomainScore = DomainScore.Value;
            }
            else
            {
                domainVO.DomainScore = 0;
            }
            domainVO.SchoolYearSemester = SchoolYearSemester;
            domainVO.StudentId          = StudentId;

            if (!DomainsBySchoolYear.ContainsKey(SchoolYearSemester))
            {
                DomainsBySchoolYear.Add(SchoolYearSemester, new Dictionary <string, List <DomainVO> >());
            }
            if (!DomainsBySchoolYear[SchoolYearSemester].ContainsKey(DomainName))
            {
                DomainsBySchoolYear[SchoolYearSemester].Add(DomainName, new List <DomainVO>());
            }
            DomainsBySchoolYear[SchoolYearSemester][DomainName].Add(domainVO);

            //if(!DomainsByDomainName.ContainsKey(domainName))
            //    DomainsByDomainName.Add(domainName, new List<DomainVO>());
            //DomainsByDomainName[domainName].Add(domainVO);
        }
Example #2
0
        /// <summary>
        /// 處理學習歷程
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public static Dictionary <int, ValueObj.SchoolYearSemester> ProcessSemesterHistory(JHSchool.Data.JHSemesterHistoryRecord record)
        {
            Dictionary <int, ValueObj.SchoolYearSemester> result = new Dictionary <int, ValueObj.SchoolYearSemester>();

            /*
             * 1: 一上; 2: 一下; 3: 二上; 4: 二下; 5: 三上; 6: 三下
             * */
            result.Add(1, null);
            result.Add(2, null);
            result.Add(3, null);
            result.Add(4, null);
            result.Add(5, null);
            result.Add(6, null);

            foreach (var item in record.SemesterHistoryItems)
            {
                int gradeYear = item.GradeYear;
                if (gradeYear > 6)
                {
                    gradeYear -= 6;
                }

                // 由[(年級-1)*2+學期]取得Key
                int key = (gradeYear - 1) * 2 + item.Semester;
                if (result.ContainsKey(key))
                {
                    result[key] = new ValueObj.SchoolYearSemester(item.SchoolYear, item.Semester);
                }
            }

            return(result);
        }
 public List <Data.DemeritRecord> GetDemeritsBySchoolYear(SchoolYearSemester schoolYearSemester)
 {
     if (DemeritsBySchoolYear.ContainsKey(schoolYearSemester))
     {
         return(DemeritsBySchoolYear[schoolYearSemester]);
     }
     else
     {
         return(new List <Data.DemeritRecord>());
     }
 }
 public List <ServiceVO> GetServicesBySchoolYear(SchoolYearSemester schoolYearSemester)
 {
     if (ServicesBySchoolYear.ContainsKey(schoolYearSemester))
     {
         return(ServicesBySchoolYear[schoolYearSemester]);
     }
     else
     {
         return(new List <ServiceVO>());
     }
 }
 public List <DomainVO> GetDomainsBySechoolYear(SchoolYearSemester SchoolYearSemester, string domainName)
 {
     if (DomainsBySchoolYear.ContainsKey(SchoolYearSemester))
     {
         if (DomainsBySchoolYear[SchoolYearSemester].ContainsKey(domainName))
         {
             return(DomainsBySchoolYear[SchoolYearSemester][domainName]);
         }
     }
     return(new List <DomainVO>());
 }
Example #6
0
 public List <ClubVO> GetClubsBySchoolYear(SchoolYearSemester schoolYearSemester)
 {
     if (ClubsBySchoolYear.ContainsKey(schoolYearSemester))
     {
         return(ClubsBySchoolYear[schoolYearSemester]);
     }
     else
     {
         return(new List <ClubVO>());
     }
 }
        public void AddService(DataRow row)
        {
            ServiceVO serviceVo = new ServiceVO(row);

            SchoolYearSemester SchoolYearSemester = serviceVo.SchoolYearSemester;

            if (!ServicesBySchoolYear.ContainsKey(SchoolYearSemester))
            {
                ServicesBySchoolYear.Add(SchoolYearSemester, new List <ServiceVO>());
            }

            ServicesBySchoolYear[SchoolYearSemester].Add(serviceVo);
        }
Example #8
0
        public ClubVO(DataRow row)
        {
            StudentId = ("" + row["ref_student_id"]).Trim();

            SchoolYearSemester = new ValueObj.SchoolYearSemester(("" + row["school_year"]).Trim(), ("" + row["semester"]).Trim());
        }