Ejemplo n.º 1
0
        void _BGWAbsenceAndPeriodList_DoWork(object sender, DoWorkEventArgs e)
        {
            typeList = GetConfig.GetPeriodList();

            absenceList = GetConfig.GetAbsenceList();
        }
Ejemplo n.º 2
0
        public override void InitializeExport(SmartSchool.API.PlugIn.Export.ExportWizard wizard)
        {
            //取得文字評量代碼表清單
            List <string> faceList = GetConfig.GetWordCommentList();

            //加入欲匯出之欄位資料
            wizard.ExportableFields.AddRange("學年度", "學期");
            foreach (string each in faceList)
            {
                wizard.ExportableFields.Add(each);
            }

            wizard.ExportPackage += delegate(object sender, SmartSchool.API.PlugIn.Export.ExportPackageEventArgs e)
            {
                //取得學生清單
                List <SHStudentRecord> students = SHStudent.SelectByIDs(e.List);

                //取得學生相關文字評量記錄
                Dictionary <string, List <SHMoralScoreRecord> > DicMoralScore = GetMoralScore(e.List);

                students.Sort(SortStudent);

                //整理填入資料
                foreach (SHStudentRecord stud in students) //每一位學生
                {
                    if (DicMoralScore.ContainsKey(stud.ID))
                    {
                        foreach (SHMoralScoreRecord MScore in DicMoralScore[stud.ID]) //每一筆資料
                        {
                            //取得文字評量內容的Dictionary物件,可加快比對速度
                            Dictionary <string, string> studTextScore = GetTextScore(MScore);

                            RowData row = new RowData();
                            row.ID = stud.ID;
                            //對於每一個要匯出的欄位
                            foreach (string field in e.ExportFields)
                            {
                                if (wizard.ExportableFields.Contains(field))
                                {
                                    string value = "";

                                    switch (field)
                                    {
                                    case "學年度":
                                        value = MScore.SchoolYear.ToString();
                                        break;

                                    case "學期":
                                        value = MScore.Semester.ToString();
                                        break;

                                    default:
                                        value = findTextScore(studTextScore, field);     //取得文字評量
                                        break;
                                    }
                                    row.Add(field, value);
                                }
                            }
                            e.Items.Add(row);
                        }
                    }
                }
            };
        }