/// <summary>
        /// 取得學習歷程
        /// </summary>
        /// <param name="studentid">學生編號</param>
        /// <returns>學習歷程</returns>
        public static List <SemesterHistoryData> GetSemesterHistory(string studentid)
        {
            bool checkAddDefault            = true;
            List <SemesterHistoryData> list = new List <SemesterHistoryData>();

            foreach (SemesterHistoryRecord each in SemesterHistory.Instance[studentid])
            {
                SemesterHistoryData sh = new SemesterHistoryData();
                sh.GradeYear  = each.GradeYear.ToString();
                sh.SchoolYear = each.SchoolYear.ToString();
                sh.Semester   = each.Semester.ToString();
                list.Add(sh);
            }

            // 檢查是否已有預設學年度學期資料
            foreach (SemesterHistoryData shd in list)
            {
                if (shd.SchoolYear == School.DefaultSchoolYear && shd.Semester == School.DefaultSemester)
                {
                    checkAddDefault = false;
                    break;
                }
            }

            if (checkAddDefault == true)
            {
                SemesterHistoryData current = new SemesterHistoryData();
                current.SchoolYear = School.DefaultSchoolYear;
                current.Semester   = School.DefaultSemester;
                list.Add(current);
            }

            //假造資料
            //SemesterHistoryData sh11 = new SemesterHistoryData();
            //sh11.GradeYear = "1";
            //sh11.SchoolYear = "96";
            //sh11.Semester = "1";
            //list.Add(sh11);

            //SemesterHistoryData sh12 = new SemesterHistoryData();
            //sh12.GradeYear = "1";
            //sh12.SchoolYear = "96";
            //sh12.Semester = "2";
            //list.Add(sh12);

            //SemesterHistoryData sh21 = new SemesterHistoryData();
            //sh21.GradeYear = "2";
            //sh21.SchoolYear = "97";
            //sh21.Semester = "1";
            //list.Add(sh21);

            //SemesterHistoryData sh22 = new SemesterHistoryData();
            //sh22.GradeYear = "2";
            //sh22.SchoolYear = "97";
            //sh22.Semester = "2";
            //list.Add(sh22);

            return(list);
        }
Example #2
0
        public void OnChangeStep()
        {
            foreach (DataGridViewRow row in dgDailyLifeRecommend.Rows)
            {
                SemesterHistoryData sh = row.Tag as SemesterHistoryData;

                foreach (DataGridViewColumn column in dgDailyLifeRecommend.Columns)
                {
                    if (column.Name == SCHOOL_YEAR_COLUMN)
                    {
                        continue;
                    }
                    if (column.Name == SEMESTER_COLUMN)
                    {
                        continue;
                    }

                    string value = string.Empty;

                    if (row.Cells[column.Name].Value != null)
                    {
                        value = row.Cells[column.Name].Value.ToString();
                    }

                    DailyLifeRecommendItem item = new DailyLifeRecommendItem();
                    item.SchoolYear  = sh.SchoolYear;
                    item.Semester    = sh.Semester;
                    item.Name        = column.Name;
                    item.Description = value;

                    _parent.TransferStudentData.DailyLifeRecommendData.SetItem(item);
                }
            }

            //將值塞入 _data 中
            foreach (DataGridViewRow row in dgPublicService.Rows)
            {
                SemesterHistoryData sh = row.Tag as SemesterHistoryData;

                foreach (DataGridViewColumn column in dgPublicService.Columns)
                {
                    if (column.Name == SCHOOL_YEAR_COLUMN)
                    {
                        continue;
                    }
                    if (column.Name == SEMESTER_COLUMN)
                    {
                        continue;
                    }

                    string value = string.Empty;

                    if (row.Cells[column.Name].Value != null)
                    {
                        value = row.Cells[column.Name].Value.ToString();
                    }

                    PublicServiceItem item = new PublicServiceItem();
                    item.SchoolYear  = sh.SchoolYear;
                    item.Semester    = sh.Semester;
                    item.Name        = column.Name;
                    item.Description = value;

                    _parent.TransferStudentData.PublicServiceData.SetItem(item);
                }
            }

            foreach (DataGridViewRow row in dgSchoolSpecial.Rows)
            {
                SemesterHistoryData sh = row.Tag as SemesterHistoryData;

                foreach (DataGridViewColumn column in dgSchoolSpecial.Columns)
                {
                    if (column.Name == SCHOOL_YEAR_COLUMN)
                    {
                        continue;
                    }
                    if (column.Name == SEMESTER_COLUMN)
                    {
                        continue;
                    }

                    string value = string.Empty;

                    if (row.Cells[column.Name].Value != null)
                    {
                        value = row.Cells[column.Name].Value.ToString();
                    }

                    SchoolSpecialItem item = new SchoolSpecialItem();
                    item.SchoolYear  = sh.SchoolYear;
                    item.Semester    = sh.Semester;
                    item.Name        = column.Name;
                    item.Description = value;

                    _parent.TransferStudentData.SchoolSpecialData.SetItem(item);
                }
            }
        }
Example #3
0
        public void OnChangeStep()
        {
            //將值塞入 _data 中
            foreach (DataGridViewRow row in dgDailyBehavior.Rows)
            {
                SemesterHistoryData sh = row.Tag as SemesterHistoryData;

                foreach (DataGridViewColumn column in dgDailyBehavior.Columns)
                {
                    if (column.Name == SCHOOL_YEAR_COLUMN)
                    {
                        continue;
                    }
                    if (column.Name == SEMESTER_COLUMN)
                    {
                        continue;
                    }

                    string value = string.Empty;

                    if (row.Cells[column.Name].Value != null)
                    {
                        value = row.Cells[column.Name].Value.ToString();
                    }

                    DailyBehaviorItem item = new DailyBehaviorItem();
                    item.SchoolYear = sh.SchoolYear;
                    item.Semester   = sh.Semester;
                    //item.Index = string.Empty;
                    item.Name   = column.Name;
                    item.Degree = value;

                    _parent.TransferStudentData.DailyBehaviorData.SetItem(item);
                }
            }

            foreach (DataGridViewRow row in dgTeam.Rows)
            {
                SemesterHistoryData sh = row.Tag as SemesterHistoryData;

                foreach (string groupActivityItem in _groupActivityItems)
                {
                    string           degree     = string.Empty;
                    DataGridViewCell degreeCell = row.Cells[GetGADegreeColName(groupActivityItem)];
                    if (degreeCell.Value != null)
                    {
                        degree = degreeCell.Value.ToString();
                    }

                    string           text     = string.Empty;
                    DataGridViewCell textCell = row.Cells[GetGATextColName(groupActivityItem)];
                    if (textCell.Value != null)
                    {
                        text = textCell.Value.ToString();
                    }

                    GroupActivityItem item = new GroupActivityItem();
                    item.SchoolYear = sh.SchoolYear;
                    item.Semester   = sh.Semester;
                    item.Name       = groupActivityItem;
                    item.Degree     = degree;
                    item.Text       = text;

                    _parent.TransferStudentData.GroupActivityData.SetItem(item);
                }
            }
        }