Ejemplo n.º 1
0
        private static void ResCourseData()
        {
            //課程科目屬性
            ListPaneField CourseSubjectType = new ListPaneField("科目組別");

            CourseSubjectType.PreloadVariable += delegate(object sender, PreloadVariableEventArgs e)
            {
                Tool.Instance.Courses = K12.Data.Course.SelectByIDs(e.Keys);
                Tool.Instance.Refresh();
            };

            CourseSubjectType.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Tool.Instance.GetSubjectType(e.Key);
            };

            K12.Presentation.NLDPanels.Course.AddListPaneField(CourseSubjectType);

            //FISCA.InteractionService.SubscribeEvent("SubjectChange", (sender, args) =>
            //{
            //    //取得更新資料
            //    Tool.Instance.Refresh();
            //    //重讀
            //    CourseSubjectType.Reload();
            //});
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            _bgLLoadUDT.DoWork             += _bgLLoadUDT_DoWork;
            _bgLLoadUDT.RunWorkerCompleted += _bgLLoadUDT_RunWorkerCompleted;
            _bgLLoadUDT.RunWorkerAsync();
            Dictionary <string, UDT_HighConcern> _HighConcernDict = new Dictionary <string, UDT_HighConcern>();

            _HighConcernDict = UDTTransfer.GetHighConcernDictAll();
            ListPaneField HighConcernField = new ListPaneField("高關懷特殊身分");

            HighConcernField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_HighConcernDict.ContainsKey(e.Key))
                {
                    e.Value = "是";
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(HighConcernField);

            ListPaneField HighCountField = new ListPaneField("高關懷減免人數");

            HighCountField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_HighConcernDict.ContainsKey(e.Key))
                {
                    e.Value = _HighConcernDict[e.Key].NumberReduce;
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(HighCountField);

            ListPaneField HighDocNoField = new ListPaneField("高關懷文號");

            HighDocNoField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_HighConcernDict.ContainsKey(e.Key))
                {
                    e.Value = _HighConcernDict[e.Key].DocNo;
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(HighDocNoField);

            // 當高關懷特殊身分有更新
            FISCA.InteractionService.SubscribeEvent("KH_HighConcern_HighConcernContent", (sender, args) =>
            {
                _HighConcernDict = UDTTransfer.GetHighConcernDictAll();
                HighConcernField.Reload();
                HighCountField.Reload();
                HighDocNoField.Reload();
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 處理學生資料
        /// </summary>
        private static void ResStudentData()
        {
            Dictionary <string, StudentRecord_Ext> StudentExtDic = GetStudentExt();
            Dictionary <string, string>            StudentEnName = GetStudentExName();

            #region 學生 暱稱&居留證號

            ListPaneField StudentEnglishNameField = new ListPaneField("英文姓名");
            StudentEnglishNameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (StudentEnName.ContainsKey(e.Key))
                {
                    e.Value = StudentEnName[e.Key];
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(StudentEnglishNameField);

            ListPaneField StudentNicknameField = new ListPaneField("英文別名");
            StudentNicknameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (StudentExtDic.ContainsKey(e.Key))
                {
                    e.Value = StudentExtDic[e.Key].Nickname;
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(StudentNicknameField);

            ListPaneField PassportNumberField = new ListPaneField("居留證號");
            PassportNumberField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (StudentExtDic.ContainsKey(e.Key))
                {
                    e.Value = StudentExtDic[e.Key].PassportNumber;
                }
            };
            K12.Presentation.NLDPanels.Student.AddListPaneField(PassportNumberField);

            FISCA.InteractionService.SubscribeEvent("Res_StudentExt", (sender, args) =>
            {
                //取得更新資料
                StudentExtDic = GetStudentExt();
                StudentEnName = GetStudentExName();
                //重讀
                StudentNicknameField.Reload();
                PassportNumberField.Reload();
                StudentEnglishNameField.Reload();
            });
            #endregion
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title">要顯示的標題文字。</param>
        /// <param name="fieldName">對應資料庫或是 Value Object 的欄位名稱。</param>
        public ListPaneFieldImproved(string title, string fieldName)
        {
            FieldName = fieldName;
            CacheProvider = null;
            CurrentCache = null;

            if (Backend == null)
                Backend = new QueryHelper();

            Field = new ListPaneField(title);
            Field.CompareValue += (CompareValue);
            Field.PreloadVariable += (Field_PreloadVariable);
            Field.GetVariable += (Field_GetVariable);

            UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="title">要顯示的標題文字。</param>
        /// <param name="fieldName">對應資料庫或是 Value Object 的欄位名稱。</param>
        public ListPaneFieldImproved(string title, string fieldName)
        {
            FieldName     = fieldName;
            CacheProvider = null;
            CurrentCache  = null;

            if (Backend == null)
            {
                Backend = new QueryHelper();
            }

            Field = new ListPaneField(title);
            Field.CompareValue    += (CompareValue);
            Field.PreloadVariable += (Field_PreloadVariable);
            Field.GetVariable     += (Field_GetVariable);

            UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 處理教師資料
        /// </summary>
        private static void ResTeacherData()
        {
            Dictionary <string, TeacherRecord_Ext> TeacherExtDic = GetTeacherExt();

            ListPaneField TeacherCellPhoneField = new ListPaneField("行動電話");

            TeacherCellPhoneField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TeacherExtDic.ContainsKey(e.Key))
                {
                    e.Value = TeacherExtDic[e.Key].CellPhone;
                }
            };
            K12.Presentation.NLDPanels.Teacher.AddListPaneField(TeacherCellPhoneField);

            FISCA.InteractionService.SubscribeEvent("Res_TeacherExt", (sender, args) =>
            {
                TeacherExtDic = GetTeacherExt();
                TeacherCellPhoneField.Reload();
            });
        }
Ejemplo n.º 7
0
        public void SetupPresentation()
        {
            Course.Instance.RibbonBarItems["編輯"].Index   = 0;
            Course.Instance.RibbonBarItems["資料統計"].Index = 1;
            Course.Instance.RibbonBarItems["指定"].Index   = 2;
            Course.Instance.RibbonBarItems["教務"].Index   = 3;

            //CourseSyncAllBackground
            FISCA.Features.Register("CourseSyncAllBackground", x =>
            {
                this.SyncAllBackground();
            });

            RibbonBarItem rbItema = Course.Instance.RibbonBarItems["編輯"];

            #region RibbonBar 學生/匯入匯出
            RibbonBarItem rbItem = Course.Instance.RibbonBarItems["資料統計"];

            rbItem["匯出"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯出"].Image = Properties.Resources.Export_Image;
            rbItem["匯出"]["匯出課程基本資料"].Enable = User.Acl["JHSchool.Course.Ribbon0030"].Executable;
            rbItem["匯出"]["匯出課程基本資料"].Click += delegate
            {
                new JHSchool.CourseExtendControls.Ribbon.CourseExportWizard().ShowDialog();
            };

            rbItem["匯入"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯入"].Image = Properties.Resources.Import_Image;
            rbItem["匯入"]["匯入課程基本資料"].Enable = User.Acl["JHSchool.Course.Ribbon0020"].Executable;
            rbItem["匯入"]["匯入課程基本資料"].Click += delegate
            {
                new JHSchool.CourseExtendControls.Ribbon.CourseImportWizard().ShowDialog();
                Course.Instance.SyncAllBackground();
            };
            #endregion

            //報表,是以常態呈現
            rbItem["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["報表"].Image = Properties.Resources.paste_64;
            rbItem["報表"].SupposeHasChildern = true;

            #region RibbonBar 課程/指定
            //目的是先建立按鈕順序(新增 / 刪除 / 類別)
            //by dylan
            RibbonBarItem   rbItemx1 = Course.Instance.RibbonBarItems["編輯"];
            RibbonBarButton rbButton = rbItemx1["新增"];
            rbButton.Size = RibbonBarButton.MenuButtonSize.Large;
            rbButton      = rbItemx1["刪除"];
            rbButton.Size = RibbonBarButton.MenuButtonSize.Large;

            rbItem = Course.Instance.RibbonBarItems["指定"];
            //由類別模組提供
            //rbItem["類別"].Image = InternalExtendControls.Tagging.Resources.ctxTag_Image;
            //rbItem["類別"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["類別"].SupposeHasChildern = true;
            //rbItem["類別"].PopupOpen += new EventHandler<PopupOpenEventArgs>(
            //    new TaggingMenu("JHSchool.Course.Ribbon0040", "JHSchool.Course.Ribbon0050").MenuOpen);
            #endregion

            #region RibbonBar 課程/統計報表
            //rbItem = Course.Instance.RibbonBarItems["統計報表"];
            //rbItem["報表"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["報表"].Image = CourseExtendControls.Ribbon.Resources.btnReport_Image;
            //rbItem["報表"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 課程/其它
            //rbItem = Course.Instance.RibbonBarItems["其它"];
            //rbItem["修改歷程"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["修改歷程"].Image = CourseExtendControls.Ribbon.Resources.btnHistory_Image;
            //rbItem["修改歷程"].Click += delegate
            //{

            //};
            #endregion

            #region 註冊權限管理
            Catalog ribbon = RoleAclSource.Instance["課程"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0000", "新增課程資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0010", "刪除課程資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0020", "匯入課程資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0030", "匯出課程資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0040", "指定課程類別"));
            //ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0050", "管理課程類別清單"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0060", "分組上課"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0070", "成績輸入"));
            ribbon.Add(new RibbonFeature("JHSchool.Course.Ribbon0080", "成績計算"));

            Catalog detail = RoleAclSource.Instance["課程"]["資料項目"];

            Catalog report = RoleAclSource.Instance["課程"]["報表"];
            report.Add(new ReportFeature("JHSchool.Course.Report0000", "學生修課清單"));
            #endregion

            //ListPaneField idField = new ListPaneField("ID");
            //idField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            //{
            //    e.Value = e.Key;
            //};
            //idField.CompareValue += delegate(object sender, CompareValueEventArgs e)
            //{
            //    int x, y;

            //    if (!int.TryParse(e.Value1.ToString(), out x))
            //        x = int.MaxValue;

            //    if (!int.TryParse(e.Value2.ToString(), out y))
            //        y = int.MaxValue;

            //    e.Result = x.CompareTo(y);
            //};
            //this.AddListPaneField(idField);


            #region Search Conditions
            ConfigData cd = User.Configuration["CourseSearchOptionPreference"];

            SearchName = SearchConditionMenu["課程名稱"];
            SearchName.AutoCheckOnClick    = true;
            SearchName.AutoCollapseOnClick = false;
            SearchName.Checked             = cd.GetBoolean("SearchName", true);
            SearchName.Click += delegate
            {
                cd.SetBoolean("SearchName", SearchName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchDomain = SearchConditionMenu["領域"];
            SearchDomain.AutoCheckOnClick    = true;
            SearchDomain.AutoCollapseOnClick = false;
            SearchDomain.Checked             = cd.GetBoolean("SearchDomain", true);
            SearchDomain.Click += delegate
            {
                cd.SetBoolean("SearchDomain", SearchDomain.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchSubject = SearchConditionMenu["科目"];
            SearchSubject.AutoCheckOnClick    = true;
            SearchSubject.AutoCollapseOnClick = false;
            SearchSubject.Checked             = cd.GetBoolean("SearchSubject", true);
            SearchSubject.Click += delegate
            {
                cd.SetBoolean("SearchSubject", SearchSubject.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            Present.Search += new EventHandler <SearchEventArgs>(Course_Search);
            #endregion

            ListPaneField nameField = new ListPaneField("名稱");
            nameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Name;
                }
            };
            this.AddListPaneField(nameField);

            ListPaneField domainField = new ListPaneField("領域");
            domainField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Domain;
                }
            };
            this.AddListPaneField(domainField);

            ListPaneField subjectField = new ListPaneField("科目名稱");
            subjectField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Subject;
                }
            };
            this.AddListPaneField(subjectField);

            ListPaneField classField = new ListPaneField("所屬班級");
            classField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    if (Items[e.Key].Class != null)
                    {
                        e.Value = Items[e.Key].Class.Name;
                    }
                }
            };
            this.AddListPaneField(classField);

            ListPaneField sectField = new ListPaneField("節數/權數");
            sectField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    string period = Items[e.Key].Period;
                    string credit = Items[e.Key].Credit;
                    if (period == credit)
                    {
                        e.Value = period;
                    }
                    else
                    {
                        e.Value = period + "/" + credit;
                    }
                }
            };
            this.AddListPaneField(sectField);

            ListPaneField schoolyearField = new ListPaneField("學年度");
            schoolyearField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].SchoolYear;
                }
            };
            this.AddListPaneField(schoolyearField);

            ListPaneField semesterField = new ListPaneField("學期");
            semesterField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Semester;
                }
            };
            this.AddListPaneField(semesterField);

            ListPaneField semScoreField = new ListPaneField("學期成績");
            semScoreField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    if (Items[e.Key].CalculationFlag == "1")
                    {
                        e.Value = "列入";
                    }

                    if (Items[e.Key].CalculationFlag == "2")
                    {
                        e.Value = "不列入";
                    }
                }
            };
            this.AddListPaneField(semScoreField);

            //this.AddView(new AllItemView());

            this.AddView(new SubjectView());
            //this.AddView(new CategoryView()); //由類別模組提供
            this.AddView(new GradeYear_Class_View());

            //this.RequiredDescription += delegate(object sender, RequiredDescriptionEventArgs e)
            //{
            //    e.Result = this[e.PrimaryKey].GetDescription();
            //};

            Present.NavPaneContexMenu.GetChild("重新整理").Click += delegate { this.SyncAllBackground(); };

            //由類別模組提供
            //Present.SetDescriptionPaneBulider(new DescriptionPaneBulider<CourseDescription>());

            Present.FilterMenu.SupposeHasChildern = true;
            Present.FilterMenu.PopupOpen         += delegate(object sender, PopupOpenEventArgs e)
            {
                List <SemesterInfo> semesterList = new List <SemesterInfo>();
                foreach (var item in Items)
                {
                    SemesterInfo semester = new SemesterInfo();
                    semester.SchoolYear = item.SchoolYear;
                    semester.Semester   = item.Semester;
                    if (!semesterList.Contains(semester))
                    {
                        semesterList.Add(semester);
                    }
                }
                if (semesterList.Count <= 0)
                {
                    MenuButton mb = e.VirtualButtons[FiltedSemester.ToString()];
                    //mb.Visible = false;
                }
                semesterList.Sort();
                foreach (var item in semesterList)
                {
                    MenuButton mb = e.VirtualButtons[item.ToString()];
                    mb.AutoCheckOnClick    = true;
                    mb.AutoCollapseOnClick = true;
                    mb.Checked             = (item == FiltedSemester);
                    mb.Tag             = item;
                    mb.CheckedChanged += delegate
                    {
                        if (mb.Checked)
                        {
                            FiltedSemester = (SemesterInfo)mb.Tag;
                            SetSource();
                        }
                    };
                }
            };

            MotherForm.AddPanel(K12.Presentation.NLDPanels.Course);
            _Initilized = true;
            //FillFilter();

            UseFilter = true;
            SetSource();
        }
Ejemplo n.º 8
0
        static public void Main()
        {
            //Student.Instance.AddDetailBulider(new ContentItemBulider<StudentExtendControls.UpdateRecordItem>());
            //Class.Instance.AddDetailBulider(new DetailBulider<JHSchool.Permrec.ClassExtendControls.ClassStudentItem>());

            System.Threading.ThreadPool.QueueUserWorkItem(x =>
            {
                JHSchool.Data.JHStudent.SelectAll();
            });


            // 學生聯絡電話
//            K12.Presentation.NLDPanels.Student.AddDetailBulider(new DetailBulider<StudentExtendControls.PhoneItem>());
            Student.Instance.AddDetailBulider(new DetailBulider <StudentExtendControls.PhoneItem>());

            Catalog catalog02 = RoleAclSource.Instance["學生"]["資料項目"];

            catalog02.Add(new DetailItemFeature(typeof(StudentExtendControls.PhoneItem)));


            // 班級學生資訊
            Class.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.Permrec.ClassExtendControls.ClassStudentItem>());
            Student.Instance.AddDetailBulider(new DetailBulider <StudentExtendControls.AddressPalmerwormItem>());

            // 聯絡電話功能先移除
            //Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider<JHSchool.Permrec.StudentExtendControls.PhonePalmerwormItem>());

            // 高中自訂欄位註解
//            Student.Instance.AddDetailBulider(new ContentItemBulider<StudentExtendControls.ExtensionValuesPalmerwormItem>());
            Student.Instance.AddDetailBulider(new DetailBulider <StudentExtendControls.DiplomaInfoPalmerworm>());

            Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.Permrec.StudentExtendControls.ParentInfoPalmerwormItem>());
            //Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.Permrec.StudentExtendControls.ParentInfoPalmerwormItem>());
            // Test new Class Item

            // 學生>班級資訊覆寫
            IStudentClassDetailItemAPI item = FISCA.InteractionService.DiscoverAPI <IStudentClassDetailItemAPI>();

            if (item != null)
            {
                Student.Instance.AddDetailBulider(item.CreateBasicInfo());
            }
            else
            {
                Student.Instance.AddDetailBulider(new DetailBulider <JHSchool.Permrec.StudentExtendControls.ClassItem>());
            }


            Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.Permrec.StudentExtendControls.SemesterHistoryDetail>());
            Student.Instance.AddDetailBulider(new DetailBulider <StudentExtendControls.BeforeEnrollmentItem>());

            RibbonBarButton Class_rbDelItem   = Class.Instance.RibbonBarItems["編輯"]["刪除"];
            RibbonBarButton Student_rbDelItem = Student.Instance.RibbonBarItems["編輯"]["刪除"];
            RibbonBarButton Teacher_rbDelItem = Teacher.Instance.RibbonBarItems["編輯"]["刪除"];

            Student.Instance.RibbonBarItems["教務"]["新生作業"].Size  = RibbonBarButton.MenuButtonSize.Large;
            Student.Instance.RibbonBarItems["教務"]["新生作業"].Image = Properties.Resources.user_write_64;

            Student.Instance.RibbonBarItems["教務"]["異動作業"].Size  = RibbonBarButton.MenuButtonSize.Large;
            Student.Instance.RibbonBarItems["教務"]["異動作業"].Image = Properties.Resources.demographic_reload_64;

            EduAdmin.Instance.RibbonBarItems["基本設定"].Index             = 0;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"].Index          = 1;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["新生作業"].Enable = true;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["新生作業"].Size   = RibbonBarButton.MenuButtonSize.Large;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["異動作業"].Enable = true;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["異動作業"].Size   = RibbonBarButton.MenuButtonSize.Large;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["成績作業"].Enable = true;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["成績作業"].Size   = RibbonBarButton.MenuButtonSize.Large;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["畢業作業"].Enable = true;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["畢業作業"].Size   = RibbonBarButton.MenuButtonSize.Large;

            //Teacher.Instance.SelectedListChanged _=dele

            Class.Instance.SelectedListChanged += delegate
            {
                Class_rbDelItem.Enable = (Class.Instance.SelectedList.Count < 2) & User.Acl["JHSchool.Class.Ribbon0010"].Executable;
            };

            Student.Instance.SelectedListChanged += delegate
            {
                Student_rbDelItem.Enable = (Student.Instance.SelectedList.Count < 2) & User.Acl["JHSchool.Student.Ribbon0010"].Executable;
            };

            Teacher.Instance.SelectedListChanged += delegate
            {
                Teacher_rbDelItem.Enable = (Teacher.Instance.SelectedList.Count < 2) & User.Acl["JHSchool.Teacher.Ribbon0010"].Executable;
            };

            // 匯入照片
            //20131216 - dylan註解
            //RibbonBarItem rbiPhotoImport = Student.Instance.RibbonBarItems["資料統計"];
            //rbiPhotoImport["匯入"]["學籍相關匯入"]["匯入學生照片"].Enable = User.Acl["JHSchool.Student.Ribbon0130"].Executable;
            //rbiPhotoImport["匯入"]["學籍相關匯入"]["匯入學生照片"].Click += (sender, e) => (new K12.Form.Photo.PhotosBatchImportForm()).ShowDialog();

            //已由K12.Form.Photo取代
            //rbiPhotoImport["匯入"]["匯入照片"].Click += delegate
            //{
            //    JHSchool.Permrec.StudentExtendControls.PhotosBatchImportExports.PhotosBatchImportForm PhotoBatchImport = new JHSchool.Permrec.StudentExtendControls.PhotosBatchImportExports.PhotosBatchImportForm();
            //    PhotoBatchImport.ShowDialog();
            //};

            // 匯出照片
            //20131216 - dylan註解
            //RibbonBarItem rbiPhotoExport = Student.Instance.RibbonBarItems["資料統計"];
            //rbiPhotoExport["匯出"]["學籍相關匯出"]["匯出學生照片"].Enable = User.Acl["JHSchool.Student.Ribbon0120"].Executable;
            //rbiPhotoExport["匯出"]["學籍相關匯出"]["匯出學生照片"].Click += (sender, e) => (new K12.Form.Photo.PhotosBatchExportForm()).ShowDialog();
            //已由K12.Form.Photo取代
            //rbiPhotoExport["匯出"]["匯出照片"].Click += delegate
            //{
            //    JHSchool.Permrec.StudentExtendControls.PhotosBatchImportExports.PhotosBatchExportForm PhotoBatchExport = new JHSchool.Permrec.StudentExtendControls.PhotosBatchImportExports.PhotosBatchExportForm();
            //    PhotoBatchExport.ShowDialog();
            //};


            //2012/5/10 - dylan - (移除此功能,由快速待處理替代)
            // 快速加入待處理功能
            //Student.Instance.RibbonBarItems["待處理學生"]["加入"].Size = RibbonBarButton.MenuButtonSize.Small;
            //Student.Instance.RibbonBarItems["待處理學生"]["加入"].Click += delegate
            //{
            //    // 將所選學生加入待處理
            //    Student.Instance.AddToTemporal(Student.Instance.SelectedKeys);

            //};

            //Student.Instance.RibbonBarItems["待處理學生"]["移出"].Size = RibbonBarButton.MenuButtonSize.Small;
            //Student.Instance.RibbonBarItems["待處理學生"]["移出"].Click += delegate
            //{
            //    // 將所選學生移出待處理
            //    Student.Instance.RemoveFromTemporal(Student.Instance.SelectedKeys);

            //};

            //Student.Instance.RibbonBarItems["待處理學生"]["瀏覽"].Size = RibbonBarButton.MenuButtonSize.Small;
            //Student.Instance.RibbonBarItems["待處理學生"]["瀏覽"].Click += delegate
            //{
            //    // 瀏覽待處理學生

            //        K12.Presentation.NLDPanels.Student.DisplayStatus = DisplayStatus.Temp;
            //        if ( K12.Presentation.NLDPanels.Student.DisplayStatus == DisplayStatus.Temp )
            //            K12.Presentation.NLDPanels.Student.SelectAll();

            //};

            //RibbonBarControlContainer rbiTemporaStudentManager = MotherForm.RibbonBarItems["學生", "待處理學生"].Controls["快速加入"];
            //rbiTemporaStudentManager.Control = new JHSchool.Permrec.StudentExtendControls.Ribbon.TemporaStudentManager();
            //MotherForm.RibbonBarItems["學生", "待處理學生"].SetTopContainer(ContainerType.Small);

            // 教育程度資料檔
            RibbonBarItem rbiEducationData = Student.Instance.RibbonBarItems["教務"];

            //rbiEducationData["新生作業"]["產生教育程度資料"].Image = Properties.Resources.capture_save_64;
            rbiEducationData["新生作業"]["產生教育程度資料"].Enable = User.Acl["JHSchool.Student.Ribbon0140"].Executable;
            rbiEducationData["新生作業"]["產生教育程度資料"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.EduAdminExtendCotnrols.EducationDataCreator.EducationCodeCreateForm edCreator = new JHSchool.Permrec.EduAdminExtendCotnrols.EducationDataCreator.EducationCodeCreateForm();
                    edCreator.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            #region 產生教育程度資料 - 刻意放2份程式碼
            //rbiEducationData["畢業作業"]["產生教育程度資料"].Image = Properties.Resources.capture_save_64;
            rbiEducationData["畢業作業"]["產生教育程度資料"].Enable = User.Acl["JHSchool.Student.Ribbon0140"].Executable;
            rbiEducationData["畢業作業"]["產生教育程度資料"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.EduAdminExtendCotnrols.EducationDataCreator.EducationCodeCreateForm edCreator = new JHSchool.Permrec.EduAdminExtendCotnrols.EducationDataCreator.EducationCodeCreateForm();
                    edCreator.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };
            #endregion

            // 學生報表
            // 轉出回條
            MenuButton rbStudentReports = Student.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbStudentReports["轉出回條"].Enable = User.Acl["JHSchool.Student.Report0080"].Executable;
            rbStudentReports["轉出回條"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentBackToArticleForm sbtaf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentBackToArticleForm();
                    sbtaf.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            string 轉出回條 = "ischool/國中系統/學生/報表/學籍/轉出回條";
            FISCA.Features.Register(轉出回條, arg =>
            {
                JHSchool.Permrec.StudentExtendControls.Reports.StudentBackToArticleForm sbtaf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentBackToArticleForm();
                sbtaf.ShowDialog();
            });

            // 在學證明書_無成績
            rbStudentReports["在學證明書(無成績)"].Enable = User.Acl["JHSchool.Student.Report0090"].Executable;
            rbStudentReports["在學證明書(無成績)"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentAtSchoolCertificateForm sascf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentAtSchoolCertificateForm();
                    sascf.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            // 畢修業證明書相關資料
            rbStudentReports["畢修業證明書相關資料"].Enable = User.Acl["JHSchool.Student.Report0100"].Executable;
            rbStudentReports["畢修業證明書相關資料"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentGraduateInfoManager sgim = new JHSchool.Permrec.StudentExtendControls.Reports.StudentGraduateInfoManager();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            // 轉學證明書
            rbStudentReports["轉學證明書"].Enable = User.Acl["JHSchool.Student.Report0110"].Executable;
            rbStudentReports["轉學證明書"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentTransExportForm stff = new JHSchool.Permrec.StudentExtendControls.Reports.StudentTransExportForm();
                    stff.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            string URL轉學證明書 = "ischool/國中系統/學生/報表/學籍/轉學證明書";
            FISCA.Features.Register(URL轉學證明書, arg =>
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentTransExportForm stff = new JHSchool.Permrec.StudentExtendControls.Reports.StudentTransExportForm();
                    stff.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            });

            if (ModuleType == ModuleFlag.KaoHsiung)
            {
                // 休學證明書
                rbStudentReports["休學證明書"].Enable = User.Acl["JHSchool.Permrec.StudentExtendControls.Reports.StudentLeaveForm"].Executable;
                rbStudentReports["休學證明書"].Click += delegate
                {
                    if (Student.Instance.SelectedList.Count >= 1)
                    {
                        JHSchool.Permrec.StudentExtendControls.Reports.StudentLeaveForm slf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentLeaveForm();
                        slf.ShowDialog();
                    }
                    else
                    {
                        MsgBox.Show("請選擇學生");
                    }
                };
            }

            // 畢業證明書
            rbStudentReports["畢業證明書"].Enable = User.Acl["JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateFormA"].Executable;
            rbStudentReports["畢業證明書"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateFormA sgcfa = new JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateFormA();
                    sgcfa.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            // 畢業證書
            rbStudentReports["畢業證書"].Enable = User.Acl["JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateForm"].Executable;
            rbStudentReports["畢業證書"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateForm sgcf = new JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateForm();
                    sgcf.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };


            #region 在教務作業上增加RibbonBar

            RibbonBarButton rbItemClassUpgrade = EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["班級升級"];
            rbItemClassUpgrade.Size   = RibbonBarButton.MenuButtonSize.Medium;
            rbItemClassUpgrade.Image  = Properties.Resources.btnUpgrade_Image;
            rbItemClassUpgrade.Enable = User.Acl["JHSchool.EduAdmin.Ribbon0110"].Executable;
            rbItemClassUpgrade.Click += delegate
            {
                JHSchool.Permrec.EduAdminExtendCotnrols.ClassUpgrade.ClassUpgradeForm CUF = new JHSchool.Permrec.EduAdminExtendCotnrols.ClassUpgrade.ClassUpgradeForm();
                CUF.ShowDialog();
            };


            MenuButton rbItemTool05 = EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["畢業作業"]["產生畢業證書字號"];
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["畢業作業"].Image = Properties.Resources.graduated_write_64;
            EduAdmin.Instance.RibbonBarItems["批次作業/檢視"]["畢業作業"].Size  = RibbonBarButton.MenuButtonSize.Medium;
            rbItemTool05.Enable = User.Acl["JHSchool.EduAdmin.Ribbon00801"].Executable;
            rbItemTool05.Click += delegate
            {
                EduAdminExtendCotnrols.StudGraduateDocNo.BatchStudGraduateDocNo BSGD = new JHSchool.Permrec.EduAdminExtendCotnrols.StudGraduateDocNo.BatchStudGraduateDocNo();
                BSGD.ShowDialog();
            };


            //RibbonBarButton rbItem1 = EduAdmin.Instance.RibbonBarItems["學籍"]["名冊"];
            //rbItem1.Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem1.Image = GDResources.btnItemNameList_Image;
            //rbItem1.Enable = User.Acl["JHSchool.EduAdmin.Ribbon0060"].Executable;
            //rbItem1.Click += delegate
            //{

            //    JHSchool.Permrec.AffairExtendControls.GovernmentalDocument.Process.NameList.RegisterNames();
            //    new ListForm().ShowDialog();

            //};

            //RibbonBarItem ViewForm1 = EduAdmin.Instance.RibbonBarItems["學籍"];
            //ViewForm1["異動資料檢視"].Enable = User.Acl["JHSchool.EduAdmin.Ribbon0070"].Executable;
            //ViewForm1["異動資料檢視"].Click += delegate
            //{
            //    UpdateRecordViewForm UpReViewForm = new UpdateRecordViewForm();
            //    UpReViewForm.ShowDialog();
            //};
            #endregion
            MenuButton rbClassStudentListRptItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassStudentListRptItem["班級名條"].Enable = User.Acl["JHSchool.Class.Report0000"].Executable;
            rbClassStudentListRptItem["班級名條"].Click += delegate
            {
                //JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentListRpt jcslr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentListRpt();
                JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentListRptForm cslpr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentListRptForm();
                cslpr.ShowDialog();
            };

            // 學生男女比例
            MenuButton rbClassGenderPercentageItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassGenderPercentageItem["學生男女比例"].Enable = User.Acl["JHSchool.Class.Report0130"].Executable;
            rbClassGenderPercentageItem["學生男女比例"].Click += delegate
            {
                JHSchool.Permrec.ClassExtendControls.Reports.ClassGenderPercentageRpt csgrp = new JHSchool.Permrec.ClassExtendControls.Reports.ClassGenderPercentageRpt();
            };

            // 里鄰統計
            MenuButton rbClassDistrictAreaCountItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassDistrictAreaCountItem["學生里鄰統計"].Enable = User.Acl["JHSchool.Class.Report0140"].Executable;
            rbClassDistrictAreaCountItem["學生里鄰統計"].Click += delegate
            {
                JHSchool.Permrec.ClassExtendControls.Reports.ClassDistrictAreaCountRpt csacr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassDistrictAreaCountRpt();
            };

            // 學生年齡統計
            MenuButton rbClassStudentAgeCountItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassStudentAgeCountItem["學生年齡統計"].Enable = User.Acl["JHSchool.Class.Report0150"].Executable;
            rbClassStudentAgeCountItem["學生年齡統計"].Click += delegate
            {
                JHSchool.Permrec.ClassExtendControls.Reports.ClassAgePercentageRpt capr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassAgePercentageRpt();
                capr.ShowDialog();
            };

            // 學生父母職業統計
            MenuButton rbClassStudentJobCountItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassDistrictAreaCountItem["學生父母職業統計"].Enable = User.Acl["JHSchool.Class.Report0160"].Executable;
            rbClassDistrictAreaCountItem["學生父母職業統計"].Click += delegate
            {
                JHSchool.Permrec.ClassExtendControls.Reports.ClassParentJobPercentageRpt cpjpr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassParentJobPercentageRpt();
                cpjpr.ShowDialog();
            };

            // 學生類別統計
            MenuButton rbClassStudentTagCountItem = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            rbClassStudentTagCountItem["學生類別統計"].Enable = User.Acl["JHSchool.Class.Report0160"].Executable;
            rbClassStudentTagCountItem["學生類別統計"].Click += delegate
            {
                JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentTagCountRpt cstcr = new JHSchool.Permrec.ClassExtendControls.Reports.ClassStudentTagCountRpt();
                cstcr.ShowDialog();
            };

            JHSchool.Class.Instance.SelectedListChanged += delegate
            {
                rbClassStudentListRptItem["班級名條"].Enable = (JHSchool.Class.Instance.SelectedKeys.Count > 0);
            };

            /*在班級新增報表*/
            MenuButton countGenderRecord = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];

            // 因討論先註解
            //countGenderRecord["學生男女統計表"].Enable = false;
            //countGenderRecord["學生男女統計表"].Enable = User.Acl["JHSchool.Class.Report0010"].Executable;
            //countGenderRecord["學生男女統計表"].Click += delegate
            //{

            //  // countGenderRecord["學生男女統計表"].Enable = (JHSchool.Class.Instance.SelectedKeys.Count > 0);
            //    new JHSchool.Permrec.ClassExtendControls.GenderCount().ShowDialog();
            //};

            #region 成績的東西,註解掉
            //MenuButton classExamPrint = Class.Instance.RibbonBarItems["資料統計"]["報表"]["成績相關報表"];
            // classExamPrint["班級考試成績單"].Enable = User.Acl["JHSchool.Class.Report0011"].Executable;
            //MenuButton btnSelectExamPrint = classExamPrint["班級考試成績單"];
            //btnSelectExamPrint.Image = Properties.Resources.schedule_64;
            //btnSelectExamPrint.Click += delegate
            //{
            //    new JHSchool.Permrec.ClassExtendControls.SelectExamPrint().ShowDialog();
            //};

            // classExamPrint["班級考試成績單"].Enable = User.Acl["JHSchool.Class.Report0011"].Executable;
            //classExamPrint["班級學期領域成績一覽表"].Click += delegate
            //{
            //    new JHSchool.Permrec.ClassExtendControls.PrintClassDomainSemesterScore().ShowDialog();
            //};
            //classExamPrint["班級學期科目成績一覽表"].Click += delegate
            //{
            //    new JHSchool.Permrec.ClassExtendControls.PrintClassSubjectSemesterScore().ShowDialog();
            //};


            //classExamPrint["班級考試成績單"].Enable = false;
            //classExamPrint["班級學期領域成績一覽表"].Enable = false;
            //classExamPrint["班級學期科目成績一覽表"].Enable = false ;

            //當有被選取的班級時,才能執行 ...
            //JHSchool.Class.Instance.SelectedListChanged += delegate
            //{
            //    classExamPrint["班級考試成績單"].Enable = (JHSchool.Class.Instance.SelectedKeys.Count > 0);
            //    classExamPrint["班級學期領域成績一覽表"].Enable = (JHSchool.Class.Instance.SelectedKeys.Count > 0);
            //    //classExamPrint["班級學期科目成績一覽表"].Enable = (JHSchool.Class.Instance.SelectedKeys.Count > 0);
            //};
            #endregion

            /*在學生中新增報表*/


            Student.Instance.RibbonBarItems["資料統計"]["報表"].Image = Properties.Resources.paste_64;
            Student.Instance.RibbonBarItems["資料統計"]["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            Class.Instance.RibbonBarItems["資料統計"]["報表"].Image   = Properties.Resources.paste_64;
            Class.Instance.RibbonBarItems["資料統計"]["報表"].Size    = RibbonBarButton.MenuButtonSize.Large;
            Course.Instance.RibbonBarItems["資料統計"]["報表"].Image  = Properties.Resources.paste_64;
            Course.Instance.RibbonBarItems["資料統計"]["報表"].Size   = RibbonBarButton.MenuButtonSize.Large;

            MenuButton studentIdDocument = Student.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];
            MenuButton studentidClass    = Class.Instance.RibbonBarItems["資料統計"]["報表"]["學籍相關報表"];

            ////因為順序問題,所以放在這裡。
            //LogViewfinder.PluginMain.RegisterEntityRibbon();

            // 學生證給新竹舊式用
            if (ModuleType == ModuleFlag.HsinChu)
            {
                studentIdDocument["學生證(舊)"].Enable = User.Acl["JHSchool.Student.Report0071"].Executable;
                studentIdDocument["學生證(舊)"].Click += delegate
                {
                    if (Student.Instance.SelectedList.Count >= 1)
                    {
                        JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld sidf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld(JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld.UseModuleType.學生);
                        sidf.ShowDialog();
                    }
                    else
                    {
                        MsgBox.Show("請選擇學生");
                    }
                };

                studentidClass["學生證(舊)"].Enable = User.Acl["JHSchool.Class.Report0121"].Executable;
                studentidClass["學生證(舊)"].Click += delegate
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld sidfC = new JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld(JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardFormOld.UseModuleType.班級);
                    sidfC.ShowDialog();
                };
            }


            studentIdDocument["學生證"].Enable = User.Acl["JHSchool.Student.Report0070"].Executable;
            studentIdDocument["學生證"].Click += delegate
            {
                if (Student.Instance.SelectedList.Count >= 1)
                {
                    JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm sidf = new JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm(JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm.UseModuleType.學生);
                    sidf.ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇學生");
                }
            };

            studentidClass["學生證"].Enable = User.Acl["JHSchool.Class.Report0120"].Executable;
            studentidClass["學生證"].Click += delegate
            {
                JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm sidfC = new JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm(JHSchool.Permrec.StudentExtendControls.Reports.StudentIDCardForm.UseModuleType.班級);
                sidfC.ShowDialog();
            };


            // 匯出匯入異動
            //由類別模組提供
            RibbonBarButton rbUpdateRecordExport = Student.Instance.RibbonBarItems["資料統計"]["匯出"];
            //rbUpdateRecordExport["學籍相關匯出"]["匯出學生類別"].Enable = User.Acl["JHSchool.Student.Ribbon0300"].Executable;
            //rbUpdateRecordExport["學籍相關匯出"]["匯出學生類別"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Permrec.ImportExport.StudentTag.ExportStudentTag();
            //    JHSchool.Permrec.ImportExport.ExportStudentV2 wizard = new JHSchool.Permrec.ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();

            //};

            RibbonBarButton rbUpdateRecordImport = Student.Instance.RibbonBarItems["資料統計"]["匯入"];

            //由類別模組提供
            //rbUpdateRecordImport["學籍相關匯入"]["匯入學生類別"].Enable = User.Acl["JHSchool.Student.ImportExport.StudentTag.ImportStudentTag"].Executable;
            //rbUpdateRecordImport["學籍相關匯入"]["匯入學生類別"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer Importer = new JHSchool.Permrec.ImportExport.StudentTag.ImportStudentTag();
            //    JHSchool.Permrec.ImportExport.ImportStudentV2 wizard = new JHSchool.Permrec.ImportExport.ImportStudentV2(Importer.Text, Importer.Image);
            //    Importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};



            RibbonBarButton rbTeacherTagRecordIE = Teacher.Instance.RibbonBarItems["資料統計"]["匯出"];
            //由類別模組提供
            //rbTeacherTagRecordIE["匯出教師類別"].Enable = User.Acl["JHSchool.Teacher.Ribbon0300"].Executable;
            //rbTeacherTagRecordIE["匯出教師類別"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new JHSchool.Permrec.ImportExport.TeacherTag.ExportTeacherTag();
            //    JHSchool.Permrec.ImportExport.ExportTeacherV2 wizard = new JHSchool.Permrec.ImportExport.ExportTeacherV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};

            RibbonBarItem rbStudBatchAddressLatitude = Student.Instance.RibbonBarItems["其它"];
            rbStudBatchAddressLatitude["查詢經緯度"].Image  = Properties.Resources.world_zoom_64;
            rbStudBatchAddressLatitude["查詢經緯度"].Enable = User.Acl["JHSchool.Student.RibbonBatchAddressLatitude"].Executable;
            rbStudBatchAddressLatitude["查詢經緯度"].Click += delegate
            {
                JHSchool.Permrec.StudentExtendControls.Ribbon.BatchAddressLatitudeForm balf = new JHSchool.Permrec.StudentExtendControls.Ribbon.BatchAddressLatitudeForm();
                balf.ShowDialog();
            };

            // 匯出匯入畢業資訊
            RibbonBarButton rbGraduateInfoExport = Student.Instance.RibbonBarItems["資料統計"]["匯出"];
            rbGraduateInfoExport["學籍相關匯出"]["匯出畢業資訊"].Enable = User.Acl["JHSchool.Permrec.ImportExport.GraduateInfo.ExportGraduateInfo"].Executable;
            rbGraduateInfoExport["學籍相關匯出"]["匯出畢業資訊"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter        exporterGradInfo = new JHSchool.Permrec.ImportExport.GraduateInfo.ExportGraduateInfo();
                JHSchool.Permrec.ImportExport.ExportStudentV2 wizardGradInfo   = new JHSchool.Permrec.ImportExport.ExportStudentV2(exporterGradInfo.Text, exporterGradInfo.Image);
                exporterGradInfo.InitializeExport(wizardGradInfo);
                wizardGradInfo.ShowDialog();
            };

            RibbonBarButton rbGraduateInfoImport = Student.Instance.RibbonBarItems["資料統計"]["匯入"];

            rbGraduateInfoImport["學籍相關匯入"]["匯入畢業資訊"].Enable = User.Acl["JHSchool.Permrec.ImportExport.GraduateInfo.ImportGraduateInfo"].Executable;
            rbGraduateInfoImport["學籍相關匯入"]["匯入畢業資訊"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer        Importer = new JHSchool.Permrec.ImportExport.GraduateInfo.ImportGraduateInfo();
                JHSchool.Permrec.ImportExport.ImportStudentV2 wizard   = new JHSchool.Permrec.ImportExport.ImportStudentV2(Importer.Text, Importer.Image);
                Importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };



            #region 註冊權限管理
            //學生
            Catalog detail = RoleAclSource.Instance["學生"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.DiplomaInfoPalmerworm)));
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.AddressPalmerwormItem)));
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.ParentInfoPalmerwormItem)));
            // 學生電話功能先移除
            //detail.Add(new DetailItemFeature(typeof(StudentExtendControls.PhonePalmerwormItem)));

            detail.Add(new DetailItemFeature(typeof(JHSchool.Permrec.StudentExtendControls.ClassItem)));
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.BeforeEnrollmentItem)));

            detail.Add(new DetailItemFeature(typeof(JHSchool.Permrec.StudentExtendControls.SemesterHistoryDetail)));

            Catalog studReportRoleAcl = RoleAclSource.Instance["學生"]["報表"];
            studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0070", "學生證"));

            if (ModuleType == ModuleFlag.HsinChu)
            {
                studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0071", "學生證(舊)"));
            }

            studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0080", "轉出回條"));
            studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0090", "在學證明書(無成績)"));
            studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0100", "畢修業證明書相關資料"));
            studReportRoleAcl.Add(new ReportFeature("JHSchool.Student.Report0110", "轉學證明書"));

            if (ModuleType == ModuleFlag.KaoHsiung)
            {
                studReportRoleAcl.Add(new ReportFeature("JHSchool.Permrec.StudentExtendControls.Reports.StudentLeaveForm", "休學證明書"));
            }

            studReportRoleAcl.Add(new ReportFeature("JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateFormA", "畢業證明書"));
            studReportRoleAcl.Add(new ReportFeature("JHSchool.Permrec.StudentExtendControls.Reports.StudGraduateCertficateForm", "畢業證書"));

            Catalog StudFunctionButtonRoleAcl = RoleAclSource.Instance["學生"]["功能按鈕"];
            //StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.Ribbon0120", "匯出照片"));
            //StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.Ribbon0130", "匯入照片"));
            StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.Ribbon0140", "產生教育程度資料"));
            //StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.Ribbon0300", "匯出學生類別"));
            StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.RibbonBatchAddressLatitude", "查詢經緯度"));
            //StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Student.ImportExport.StudentTag.ImportStudentTag", "匯入學生類別"));

            StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Permrec.ImportExport.GraduateInfo.ExportGraduateInfo", "匯出畢業資訊"));
            StudFunctionButtonRoleAcl.Add(new RibbonFeature("JHSchool.Permrec.ImportExport.GraduateInfo.ImportGraduateInfo", "匯入畢業資訊"));

            // 教師
            Catalog TeacherFuncButtonRoleAcl = RoleAclSource.Instance["教師"]["功能按鈕"];
            //TeacherFuncButtonRoleAcl.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0300", "匯出教師類別"));

            //班級
            detail = RoleAclSource.Instance["班級"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(JHSchool.Permrec.ClassExtendControls.ClassStudentItem)));

            Catalog report = RoleAclSource.Instance["班級"]["報表"];
            report.Add(new ReportFeature("JHSchool.Class.Report0000", "班級名條"));
            report.Add(new ReportFeature("JHSchool.Class.Report0120", "學生證"));

            if (ModuleType == ModuleFlag.HsinChu)
            {
                report.Add(new ReportFeature("JHSchool.Class.Report0121", "學生證(舊)"));
            }

            report.Add(new ReportFeature("JHSchool.Class.Report0130", "學生男女比例"));
            report.Add(new ReportFeature("JHSchool.Class.Report0140", "學生里鄰統計"));
            report.Add(new ReportFeature("JHSchool.Class.Report0150", "學生年齡統計"));
            report.Add(new ReportFeature("JHSchool.Class.Report0160", "學生父母職業統計"));

            //教務作業
            Catalog ribbon = RoleAclSource.Instance["教務作業"];
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon0110", "班級升級"));
            ribbon.Add(new RibbonFeature("JHSchool.EduAdmin.Ribbon00801", "產生異業證書字號"));

            #endregion

            Dictionary <string, string> _PermanentTelDic = new Dictionary <string, string>();
            Dictionary <string, string> _ContactTelDic   = new Dictionary <string, string>();

            #region 戶籍電話欄位
            FISCA.Presentation.ListPaneField PermanentTelField = new ListPaneField("戶籍電話");
            PermanentTelField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_PermanentTelDic.ContainsKey(e.Key))
                {
                    e.Value = _PermanentTelDic[e.Key];
                }
                else
                {
                    e.Value = string.Empty;
                }
            };

            PermanentTelField.PreloadVariableBackground += delegate(object sender, PreloadVariableEventArgs e)
            {
                _PermanentTelDic.Clear();
                foreach (JHSchool.Data.JHPhoneRecord PhoneRec in JHSchool.Data.JHPhone.SelectByStudentIDs(e.Keys))
                {
                    if (!_PermanentTelDic.ContainsKey(PhoneRec.RefStudentID))
                    {
                        _PermanentTelDic.Add(PhoneRec.RefStudentID, PhoneRec.Permanent);
                    }
                }
            };
            //Student.Instance.AddListPaneField(PermanentTelField);
            // 加入戶籍電話權限管理
            if (User.Acl["Student.Field.戶籍電話"].Executable)
            {
                Student.Instance.AddListPaneField(PermanentTelField);
            }
            Catalog ribbonField = RoleAclSource.Instance["學生"]["清單欄位"];
            ribbonField.Add(new RibbonFeature("Student.Field.戶籍電話", "戶籍電話"));

            //AsyncFieldLoader<Phone, PhoneRecord> field = new AsyncFieldLoader<Phone, PhoneRecord>(Phone.Instance, "戶籍電話");
            //field.GetValue += delegate(object sender, GetValueEventArgs e)
            //{
            //    if (Phone.Instance[e.Key] != null)
            //        e.Value = Phone.Instance[e.Key].Permanent;
            //    else
            //        e.Value = string.Empty;
            //};
            //Student.Instance.AddListPaneField(field.Field);
            #endregion

            #region 聯絡電話
            FISCA.Presentation.ListPaneField ContactTelField = new ListPaneField("聯絡電話");
            ContactTelField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_ContactTelDic.ContainsKey(e.Key))
                {
                    e.Value = _ContactTelDic[e.Key];
                }
                else
                {
                    e.Value = string.Empty;
                }
            };

            ContactTelField.PreloadVariableBackground += delegate(object sender, PreloadVariableEventArgs e)
            {
                _ContactTelDic.Clear();
                foreach (JHSchool.Data.JHPhoneRecord PhoneRec in JHSchool.Data.JHPhone.SelectByStudentIDs(new List <string>(e.Keys)))
                {
                    if (!_ContactTelDic.ContainsKey(PhoneRec.RefStudentID))
                    {
                        _ContactTelDic.Add(PhoneRec.RefStudentID, PhoneRec.Contact);
                    }
                }
            };
            //Student.Instance.AddListPaneField(ContactTelField);
            // 加入聯絡電話權限管理
            if (User.Acl["Student.Field.聯絡電話"].Executable)
            {
                Student.Instance.AddListPaneField(ContactTelField);
            }
            ribbonField = RoleAclSource.Instance["學生"]["清單欄位"];
            ribbonField.Add(new RibbonFeature("Student.Field.聯絡電話", "聯絡電話"));


            //AsyncFieldLoader<Phone, PhoneRecord> telfield1 = new AsyncFieldLoader<Phone, PhoneRecord>(Phone.Instance, "聯絡電話");
            //telfield1.GetValue += delegate(object sender, GetValueEventArgs e)
            //{
            //    if (Phone.Instance[e.Key] != null)
            //        e.Value = Phone.Instance[e.Key].Contact;
            //    else
            //        e.Value = string.Empty;
            //};
            //Student.Instance.AddListPaneField(telfield1.Field);

            #endregion

            #region 監護人
            Dictionary <string, string> _CustodianFieldDic = new Dictionary <string, string>();
            CustodianField              = new ListPaneField("監護人");
            CustodianField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_CustodianFieldDic.ContainsKey(e.Key))
                {
                    e.Value = _CustodianFieldDic[e.Key];
                }
                else
                {
                    e.Value = string.Empty;
                }
            };

            CustodianField.PreloadVariableBackground += delegate(object sender, PreloadVariableEventArgs e)
            {
                _CustodianFieldDic.Clear();
                foreach (JHSchool.Data.JHParentRecord ParentRec in JHSchool.Data.JHParent.SelectByStudentIDs(new List <string>(e.Keys)))
                {
                    if (!_CustodianFieldDic.ContainsKey(ParentRec.RefStudentID))
                    {
                        _CustodianFieldDic.Add(ParentRec.RefStudentID, ParentRec.Custodian.Name);
                    }
                }
            };
            Student.Instance.AddListPaneField(CustodianField);
            //AsyncFieldLoader<Parent, ParentRecord> parent1 = new AsyncFieldLoader<Parent, ParentRecord>(Parent.Instance, "監護人");
            //parent1.GetValue += delegate(object sender, GetValueEventArgs e)
            //{
            //    if (Parent.Instance[e.Key] != null)
            //        e.Value = Parent.Instance[e.Key].Custodian.Name;
            //    else
            //        e.Value = string.Empty;
            //};
            //Student.Instance.AddListPaneField(parent1.Field);
            #endregion

            #region 畢業國小
            // 新寫法
            Dictionary <string, string>      _BeforeInfoFieldDic = new Dictionary <string, string>();
            FISCA.Presentation.ListPaneField BeforeInfoField     = new ListPaneField("畢業國小");
            BeforeInfoField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_BeforeInfoFieldDic.ContainsKey(e.Key))
                {
                    e.Value = _BeforeInfoFieldDic[e.Key];
                }
                else
                {
                    e.Value = string.Empty;
                }
            };

            BeforeInfoField.PreloadVariableBackground += delegate(object sender, PreloadVariableEventArgs e)
            {
                _BeforeInfoFieldDic.Clear();
                foreach (JHSchool.Data.JHBeforeEnrollmentRecord be in JHSchool.Data.JHBeforeEnrollment.SelectByStudentIDs(e.Keys))
                {
                    if (!_BeforeInfoFieldDic.ContainsKey(be.RefStudentID))
                    {
                        _BeforeInfoFieldDic.Add(be.RefStudentID, be.School);
                    }
                }
            };

            Student.Instance.AddListPaneField(BeforeInfoField);
            //AsyncFieldLoader<BeforeInfoRec, JHSchool.Data.JHBeforeEnrollmentRecord> grad = new AsyncFieldLoader<BeforeInfoRec, JHSchool.Data.JHBeforeEnrollmentRecord>(BeforeInfoRec.Instance, "畢業國小");
            //grad.GetValue += delegate(object sender, GetValueEventArgs e)
            //{

            //    if (BeforeInfoRec.Instance[e.Key] != null)
            //        e.Value = BeforeInfoRec.Instance[e.Key].School;
            //    else
            //        e.Value = string.Empty;

            //};
            //Student.Instance.AddListPaneField(grad.Field);
            #endregion

            #region 搜尋(畢業國小)
            //TODO 因為 Presentation 不支援非同步搜尋,所以先拿掉。
            //ConfigData cd = User.Configuration["StudentSearchOptionPreference"];

            //SearchGraduateSchool = Student.Instance.SearchConditionMenu["畢業國小"];
            //SearchGraduateSchool.AutoCheckOnClick = true;
            //SearchGraduateSchool.AutoCollapseOnClick = false;
            //SearchGraduateSchool.Checked = cd.GetBoolean("SearchGraduateSchool", false); //預設不要尋找這種的。
            //SearchGraduateSchool.Click += delegate
            //{
            //    cd.SetBoolean("SearchGraduateSchool", SearchGraduateSchool.Checked);
            //    BackgroundWorker async = new BackgroundWorker();
            //    async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
            //    async.RunWorkerAsync(cd);
            //};

            //TODO 新的 Presentation 不支援這種的。
            //Student.Instance.SearchAsync += new EventHandler<SearchEventArgs>(Instance_SearchAsync);
            #endregion

            //Student.Instance.RibbonBarItems["測試"]["測"].Click += delegate
            //{
            //    List<string> keys = Class.Instance.SelectedList[0].Students.AsKeyList();

            //    BackgroundWorker worker = new BackgroundWorker();
            //    worker.DoWork += delegate
            //    {
            //        for (int i = 0; i < keys.Count; i++)
            //        {
            //            List<UpdateRecordRecord> r1 = UpdateRecord.Instance[keys[i]];
            //        }
            //    };
            //    worker.RunWorkerAsync();

            //    for (int i = 0; i < keys.Count; i++)
            //    {
            //        List<UpdateRecordRecord> r2 = UpdateRecord.Instance[keys[i]];
            //    }
            //};
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 設定使用者介面
        /// </summary>
        public void SetupPresentation()
        {
            if (_initialized)
            {
                return;
            }

            #region 課程加入授課教師
            Course.Instance.SelectedListChanged += delegate { assignTeacherButton.Enable = (Course.Instance.SelectedList.Count > 0 && Teacher.Instance.TemporaList.Count > 0); };
            Teacher.Instance.TemporaListChanged += delegate { assignTeacherButton.Enable = (Course.Instance.SelectedList.Count > 0 && Teacher.Instance.TemporaList.Count > 0); };

            assignTeacherButton        = Course.Instance.RibbonBarItems["指定"]["評分教師"];
            assignTeacherButton.Enable = false;
            assignTeacherButton.Image  = Properties.Resources.teacher_64;
            MenuButton loadingMenuButton = assignTeacherButton["載入中…"];
            assignTeacherButton.PopupOpen += delegate(object sender, PopupOpenEventArgs e)
            {
                if (Teacher.Instance.TemporaList.Count <= 0)
                {
                    return;
                }
                if (Course.Instance.SelectedList.Count <= 0)
                {
                    return;
                }

                loadingMenuButton.Visible = false;

                foreach (var item in Teacher.Instance.TemporaList)
                {
                    MenuButton mb = e.VirtualButtons[item.Name];
                    mb.Tag    = item;
                    mb.Click += new EventHandler(MenuButton_Click);
                }
            };
            #endregion

            #region 授課教師 ListPanelField
            teacherField              = new ListPaneField("授課教師");
            teacherField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                string teacherName = "";
                if (TCInstruct.Instance.Loaded)
                {
                    TeacherRecord teacher1 = Course.Instance[e.Key].GetFirstTeacher();
                    if (teacher1 != null)
                    {
                        teacherName += teacher1.FullName;
                    }

                    TeacherRecord teacher2 = Course.Instance[e.Key].GetSecondTeacher();
                    if (teacher2 != null)
                    {
                        if (teacherName.Length > 0)
                        {
                            teacherName += "," + teacher2.FullName;
                        }
                        else
                        {
                            teacherName += teacher2.FullName;
                        }
                    }
                    TeacherRecord teacher3 = Course.Instance[e.Key].GetThirdTeacher();
                    if (teacher3 != null)
                    {
                        if (teacherName.Length > 0)
                        {
                            teacherName += "," + teacher3.FullName;
                        }
                        else
                        {
                            teacherName += teacher3.FullName;
                        }
                    }
                    if (teacherName.Length > 0)
                    {
                        e.Value = teacherName;
                    }
                    else
                    {
                        e.Value = string.Empty;
                    }
                }
                else
                {
                    e.Value = "Loading...";
                }
            };

            Course.Instance.AddListPaneField(teacherField);
            #endregion

            _initialized = true;
        }
Ejemplo n.º 10
0
        public GraduationAdmin()
        {
            //畢業生檔案檢索
            Group = "畢業";

            GraduationEvents.GraduationChanged += new EventHandler(GraduationEvents_GraduationChanged);

            BGW.DoWork             += new DoWorkEventHandler(BGW_DoWork);
            BGW.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGW_RunWorkerCompleted);

            #region 班級
            Field1              = new ListPaneField("班級");
            Field1.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].ClassName;
                }
            };
            this.AddListPaneField(Field1);
            #endregion
            #region 座號
            Field2 = new ListPaneField("座號");
            //Field2.CompareValue += new EventHandler<CompareValueEventArgs>(Field2_CompareValue);
            Field2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].SeatNo;
                }
            };
            this.AddListPaneField(Field2);
            #endregion
            #region 姓名
            Field3              = new ListPaneField("姓名");
            Field3.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].Name;
                }
            };
            this.AddListPaneField(Field3);
            #endregion
            #region 學號
            Field4              = new ListPaneField("學號");
            Field4.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].StudentNumber;
                }
            };
            this.AddListPaneField(Field4);
            #endregion
            #region 姓別
            Field5              = new ListPaneField("姓別");
            Field5.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].Gender;
                }
            };
            this.AddListPaneField(Field5);
            #endregion
            #region 身分證號
            Field6              = new ListPaneField("身分證號");
            Field6.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].IDNumber;
                }
            };
            this.AddListPaneField(Field6);
            #endregion
            #region 戶籍地址
            Field7              = new ListPaneField("戶籍地址");
            Field7.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].PermanentAddress;
                }
            };
            this.AddListPaneField(Field7);
            #endregion
            #region 聯絡地址
            Field8              = new ListPaneField("聯絡地址");
            Field8.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].MailingAddress;
                }
            };
            this.AddListPaneField(Field8);
            #endregion
            #region 其它地址
            Field9              = new ListPaneField("其它地址");
            Field9.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].OtherAddresses;
                }
            };
            this.AddListPaneField(Field9);
            #endregion
            #region 備註
            Field10              = new ListPaneField("備註");
            Field10.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (TestDic.ContainsKey(e.Key))
                {
                    e.Value = TestDic[e.Key].Remarks;
                }
            };
            this.AddListPaneField(Field10);
            #endregion

            #region 學年度篩選
            FilterMenu.Visible = false;
            //FilterMenu.SupposeHasChildern = true;
            //FilterMenu.PopupOpen += delegate(object sender, PopupOpenEventArgs e)
            //{
            //foreach (string item in SemesterCourse.Keys)
            //{
            //    MenuButton mb = e.VirtualButtons[item];
            //    mb.AutoCheckOnClick = true;
            //    mb.AutoCollapseOnClick = true;
            //    mb.Checked = (item == FiltedSemester);
            //    mb.Tag = item;
            //    mb.CheckedChanged += delegate(object sender1, EventArgs e1)
            //    {
            //        MenuButton mb1 = sender1 as MenuButton;
            //        SetFilterSource(mb1.Text);
            //        FiltedSemester = FilterMenu.Text = mb1.Text;
            //        mb1.Checked = true;
            //    };
            //}
            //};

            #endregion

            //BGW.RunWorkerAsync(); //取得各項資料課程

            //預設選擇上一學年度畢業班級
            //int defSchool = int.Parse(School.DefaultSchoolYear) - 1;
            //FiltedSemester = defSchool + "學年度畢業班級";
            //FilterMenu.Text = FiltedSemester;
            //SetFilterSource(FiltedSemester);

            #region 搜尋
            Campus.Configuration.ConfigData cd = Campus.Configuration.Config.User["AssociationSearchOptionPreference"];
            SearchStudentName = SearchConditionMenu["姓名"];
            SearchStudentName.AutoCheckOnClick    = true;
            SearchStudentName.AutoCollapseOnClick = false;
            SearchStudentName.Checked             = CheckBool(cd["SearchGraduateStudentName"]);
            SearchStudentName.Click += delegate
            {
                cd["SearchGraduateStudentName"] = SearchStudentName.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentNumber = SearchConditionMenu["學號"];
            SearchStudentNumber.AutoCheckOnClick    = true;
            SearchStudentNumber.AutoCollapseOnClick = false;
            SearchStudentNumber.Checked             = CheckBool(cd["SearchGraduateStudentNumber"]);
            SearchStudentNumber.Click += delegate
            {
                cd["SearchGraduateStudentNumber"] = SearchStudentNumber.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchIDNumber = SearchConditionMenu["身分證號"];
            SearchIDNumber.AutoCheckOnClick    = true;
            SearchIDNumber.AutoCollapseOnClick = false;
            SearchIDNumber.Checked             = CheckBool(cd["SearchGraduateIDNumber"]);
            SearchIDNumber.Click += delegate
            {
                cd["SearchGraduateIDNumber"] = SearchIDNumber.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchClassName = SearchConditionMenu["畢業班級"];
            SearchClassName.AutoCheckOnClick    = true;
            SearchClassName.AutoCollapseOnClick = false;
            SearchClassName.Checked             = CheckBool(cd["SearchGraduateClass"]);
            SearchClassName.Click += delegate
            {
                cd["SearchGraduateClass"] = SearchClassName.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchAddress = SearchConditionMenu["地址"];
            SearchAddress.AutoCheckOnClick    = true;
            SearchAddress.AutoCollapseOnClick = false;
            SearchAddress.Checked             = CheckBool(cd["SearchGraduateAddress"]);
            SearchAddress.Click += delegate
            {
                cd["SearchGraduateAddress"] = SearchAddress.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchRemarks = SearchConditionMenu["備註"];
            SearchRemarks.AutoCheckOnClick    = true;
            SearchRemarks.AutoCollapseOnClick = false;
            SearchRemarks.Checked             = CheckBool(cd["SearchGraduateRemarks"]);
            SearchRemarks.Click += delegate
            {
                cd["SearchGraduateRemarks"] = SearchRemarks.Checked.ToString();
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as Campus.Configuration.ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            #endregion

            this.Search += new EventHandler <SearchEventArgs>(GraduationAdmin_Search);
        }
Ejemplo n.º 11
0
        public ClubAdmin()
        {
            Group = "社團";

            #region 事件

            BGW.DoWork             += new DoWorkEventHandler(BGW_DoWork);
            BGW.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGW_RunWorkerCompleted);

            //社團自我更新事件
            ClubEvents.ClubChanged += new EventHandler(ClubEvents_ClubChanged);

            #endregion

            #region 社團系統編號
            Field0_0              = new ListPaneField("社團系統編號");
            Field0_0.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].UID;
                }
            };
            this.AddListPaneField(Field0_0);
            #endregion
            #region 代碼
            Field0              = new ListPaneField("代碼");
            Field0.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubNumber;
                }
            };
            this.AddListPaneField(Field0);
            #endregion
            #region 學年度
            Field1_1              = new ListPaneField("學年度");
            Field1_1.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].SchoolYear;
                }
            };
            this.AddListPaneField(Field1_1);
            #endregion
            #region 學期
            Field1_2              = new ListPaneField("學期");
            Field1_2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].Semester;
                }
            };
            this.AddListPaneField(Field1_2);
            #endregion
            #region  稱
            Field1              = new ListPaneField("名稱");
            Field1.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubName;
                }
            };
            this.AddListPaneField(Field1);
            #endregion
            #region 類型
            Field12              = new ListPaneField("類型");
            Field12.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubCategory;
                }
            };
            this.AddListPaneField(Field12);
            #endregion
            #region 老師
            Field2              = new ListPaneField("老師1");
            Field2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2);

            Field2_2              = new ListPaneField("老師2");
            Field2_2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID2))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID2].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2_2);

            Field2_3              = new ListPaneField("老師3");
            Field2_3.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID3))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID3].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2_3);
            #endregion
            #region 場地
            Field3              = new ListPaneField("場地");
            Field3.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].Location;
                }
            };
            this.AddListPaneField(Field3);
            #endregion
            #region 社長
            Field4              = new ListPaneField("社長");
            Field4.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //需取得社員資料
                    //對照出社長姓名
                    if (StudentDic.ContainsKey(AllClubDic[e.Key].President))
                    {
                        e.Value = StudentDic[AllClubDic[e.Key].President].StudentName;
                    }
                }
            };
            this.AddListPaneField(Field4);
            #endregion
            #region 副社長
            Field5              = new ListPaneField("副社長");
            Field5.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //需取得副社員資料
                    //對照出副社長姓名
                    if (StudentDic.ContainsKey(AllClubDic[e.Key].VicePresident))
                    {
                        e.Value = StudentDic[AllClubDic[e.Key].VicePresident].StudentName;
                    }
                }
            };
            this.AddListPaneField(Field5);
            #endregion
            #region 性別條件
            Field6              = new ListPaneField("性別條件");
            Field6.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].GenderRestrict;
                }
            };
            this.AddListPaneField(Field6);
            #endregion
            #region 科別限制
            Field7              = new ListPaneField("科別限制");
            Field7.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (AllClubDic[e.Key].DeptRestrict != "")
                    {
                        List <string> list = new List <string>();
                        XmlElement    xml  = DSXmlHelper.LoadXml(AllClubDic[e.Key].DeptRestrict);
                        foreach (XmlElement mini in xml.SelectNodes("Dept"))
                        {
                            list.Add(mini.InnerText);
                        }
                        string deptString = string.Join(",", list);
                        e.Value = deptString;
                    }
                }
            };
            this.AddListPaneField(Field7);
            #endregion
            #region 一年級人數限制
            Field8              = new ListPaneField("一年級人數/上限");
            Field8.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //1年級的人數??
                    int count1 = 0;

                    if (ClubCountSCJoin.ContainsKey(e.Key))
                    {
                        count1 = ClubCountSCJoin[e.Key].一年級人數;
                    }

                    //人數上限
                    string count2 = AllClubDic[e.Key].Grade1Limit.HasValue ? AllClubDic[e.Key].Grade1Limit.Value.ToString() : "";
                    if (string.IsNullOrEmpty(count2))
                    {
                        e.Value = count1 + "/無限制";
                    }
                    else
                    {
                        e.Value = count1 + "/" + count2;
                    }
                }
            };
            this.AddListPaneField(Field8);
            #endregion
            #region 二年級人數限制
            Field9              = new ListPaneField("二年級人數/上限");
            Field9.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //2年級的人數??
                    int count1 = 0;

                    if (ClubCountSCJoin.ContainsKey(e.Key))
                    {
                        count1 = ClubCountSCJoin[e.Key].二年級人數;
                    }

                    //人數上限
                    string count2 = AllClubDic[e.Key].Grade2Limit.HasValue ? AllClubDic[e.Key].Grade2Limit.Value.ToString() : "";
                    if (string.IsNullOrEmpty(count2))
                    {
                        e.Value = count1 + "/無限制";
                    }
                    else
                    {
                        e.Value = count1 + "/" + count2;
                    }
                }
            };
            this.AddListPaneField(Field9);
            #endregion
            #region  年級人數限制
            Field10              = new ListPaneField("三年級人數/上限");
            Field10.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //3年級的人數??
                    int count1 = 0;

                    if (ClubCountSCJoin.ContainsKey(e.Key))
                    {
                        count1 = ClubCountSCJoin[e.Key].年級人數;
                    }

                    //人數上限
                    string count2 = AllClubDic[e.Key].Grade3Limit.HasValue ? AllClubDic[e.Key].Grade3Limit.Value.ToString() : "";
                    if (string.IsNullOrEmpty(count2))
                    {
                        e.Value = count1 + "/無限制";
                    }
                    else
                    {
                        e.Value = count1 + "/" + count2;
                    }
                }
            };
            this.AddListPaneField(Field10);
            #endregion
            #region 目前人數 / 社團人數上限
            Field11              = new ListPaneField("目前總人數/上限");
            Field11.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //count出本社團的SCJoin數量
                    //就是人數
                    int count1 = 0;

                    if (ClubCountSCJoin.ContainsKey(e.Key))
                    {
                        count1 = ClubCountSCJoin[e.Key].社團人數;
                    }

                    string count2 = AllClubDic[e.Key].Limit.HasValue ? AllClubDic[e.Key].Limit.Value.ToString() : "";
                    if (string.IsNullOrEmpty(count2))
                    {
                        e.Value = count1 + "/無限制";
                    }
                    else
                    {
                        e.Value = count1 + "/" + count2;
                    }
                }
            };
            this.AddListPaneField(Field11);
            #endregion


            FilterMenu.SupposeHasChildern = true;
            FilterMenu.PopupOpen         += new EventHandler <PopupOpenEventArgs>(FilterMenu_PopupOpen);
            //目前預設學年期設為標題
            FilterMenu.Text = FiltedSemester;

            //設定預設學年期
            //SetClubList(FiltedSemester);

            #region Search

            Campus.Configuration.ConfigData cd = Campus.Configuration.Config.User["ClubSearchOptionPreference"];

            SearchClubName    = SetSearchButton("名稱", "SearchClubName", cd);
            SearchClubTeacher = SetSearchButton("老師", "SearchClubTeacher", cd);
            SearchStudentName = SetSearchButton("參與學生", "SearchClubStudentName", cd);
            SearchAddress     = SetSearchButton("場地", "SearchClubAddress", cd);
            #endregion

            this.Search += new EventHandler <SearchEventArgs>(ClubAdmin_Search);

            //取得社團基本資料
            BGW.RunWorkerAsync();
        }
Ejemplo n.º 12
0
 public void AddListPaneField(ListPaneField field)
 {
     Present.AddListPaneField(field);
 }
Ejemplo n.º 13
0
        public void SetupPresentation()
        {
            //CourseSyncAllBackground
            //2013/4/22 - 提供轉學模組更新學生清單
            FISCA.Features.Register("StudentSyncAllBackground", x =>
            {
                this.SyncAllBackground();
            });

            Student.Instance.RibbonBarItems["編輯"].Index   = 0;
            Student.Instance.RibbonBarItems["資料統計"].Index = 1;
            Student.Instance.RibbonBarItems["指定"].Index   = 2;
            Student.Instance.RibbonBarItems["教務"].Index   = 3;
            Student.Instance.RibbonBarItems["學務"].Index   = 4;

            #region RibbonBar 學生/編輯
            RibbonBarItem rbItem = Student.Instance.RibbonBarItems["編輯"];
            rbItem["新增"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["新增"].Image  = StudentExtendControls.Ribbon.Resources.btnAddStudent_Image;
            rbItem["新增"].Enable = User.Acl["JHSchool.Student.Ribbon0000"].Executable;
            rbItem["新增"].Click += delegate
            {
                IRewriteAPI_JH.IStudentAddStudentAPI item = FISCA.InteractionService.DiscoverAPI <IRewriteAPI_JH.IStudentAddStudentAPI>();
                if (item != null)
                {
                    item.CreateForm().ShowDialog();
                }
                else
                {
                    new JHSchool.StudentExtendControls.Ribbon.AddStudent().ShowDialog();
                }
            };

            rbItem["刪除"].Image  = StudentExtendControls.Ribbon.Resources.btnDeleteStudent_Image;
            rbItem["刪除"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["刪除"].Enable = User.Acl["JHSchool.Student.Ribbon0010"].Executable;
            rbItem["刪除"].Click += delegate
            {
                if (SelectedList.Count == 1)
                {
                    PermRecLogProcess             prlp    = new PermRecLogProcess();
                    JHSchool.Data.JHStudentRecord studRec = JHSchool.Data.JHStudent.SelectByID(SelectedList[0].ID);
                    string msg = string.Format("確定要刪除「{0}」?", studRec.Name);
                    if (FISCA.Presentation.Controls.MsgBox.Show(msg, "刪除學生", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        // 檢查刪除狀態是否有同學號或身分證號,空白可刪
                        List <string> tmpSnumList         = new List <string>();
                        List <string> tmpStudIDNumberList = new List <string>();
                        foreach (JHSchool.Data.JHStudentRecord checkStudRec in JHSchool.Data.JHStudent.SelectAll())
                        {
                            if (checkStudRec.Status == K12.Data.StudentRecord.StudentStatus.刪除)
                            {
                                if (!string.IsNullOrEmpty(checkStudRec.StudentNumber))
                                {
                                    tmpSnumList.Add(checkStudRec.StudentNumber);
                                }
                                if (!string.IsNullOrEmpty(checkStudRec.IDNumber))
                                {
                                    tmpStudIDNumberList.Add(checkStudRec.IDNumber);
                                }
                            }
                        }

                        if (tmpSnumList.Contains(studRec.StudentNumber) || tmpSnumList.Contains(studRec.IDNumber))
                        {
                            MsgBox.Show("刪除狀態有重複學號或身分證號,請先修改後再刪除!");
                            return;
                        }

                        // 修改學生狀態 delete
                        studRec.Status = K12.Data.StudentRecord.StudentStatus.刪除;
                        JHSchool.Data.JHStudent.Update(studRec);
                        Student.Instance.SyncDataBackground(studRec.ID);
                        prlp.SaveLog("學籍學生", "刪除學生", "刪除學生,姓名:" + studRec.Name + ",學號:" + studRec.StudentNumber);
                    }
                    else
                    {
                        return;
                    }
                }
            };

            #endregion

            #region RibbonBar 學生/匯入匯出
            rbItem = Student.Instance.RibbonBarItems["資料統計"];

            rbItem["匯出"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯出"].Image = Properties.Resources.Export_Image;
            //rbItem["匯出"]["學籍相關匯出"]["匯出學生基本資料"].Enable = User.Acl["JHSchool.Student.Ribbon0030"].Executable;
            //rbItem["匯出"]["學籍相關匯出"]["匯出學生基本資料"].Click += delegate
            //{
            //        new StudentExportWizard().ShowDialog();

            //};

            rbItem["匯入"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯入"].Image = Properties.Resources.Import_Image;
            //rbItem["匯入"]["學籍相關匯入"]["匯入學生基本資料"].Enable = User.Acl["JHSchool.Student.Ribbon0020"].Executable;
            //rbItem["匯入"]["學籍相關匯入"]["匯入學生基本資料"].Click += delegate
            //{
            //    IRewriteAPI_JH.IStudentImportWizardAPI item = FISCA.InteractionService.DiscoverAPI<IRewriteAPI_JH.IStudentImportWizardAPI>();
            //    if (item != null)
            //    {
            //        item.CreateForm().ShowDialog();
            //    }
            //    else
            //    {
            //        new StudentImportWizard().ShowDialog();
            //    }

            //};
            #endregion

            //報表,是以常態呈現
            rbItem["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["報表"].Image = Properties.Resources.paste_64;
            rbItem["報表"].SupposeHasChildern = true;

            #region RibbonBar 學生/指定
            //由類別模組提供。
            //rbItem = Student.Instance.RibbonBarItems["指定"];
            //rbItem["類別"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["類別"].Image = InternalExtendControls.Tagging.Resources.ctxTag_Image;
            //rbItem["類別"].SupposeHasChildern = true;
            //rbItem["類別"].PopupOpen += new EventHandler<PopupOpenEventArgs>(
            //    new TaggingMenu("JHSchool.Student.Ribbon0040", "JHSchool.Student.Ribbon0050").MenuOpen);
            #endregion

            // 要放:班級、座號、姓名、性別、學號、聯絡電話、戶籍電話、聯絡地址、戶籍地址、出生年月日、監護人、課程規劃、帳號。

            #region List Panel Fields

            ListPaneField classNameField = new ListPaneField("班級");
            classNameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    var classRec = Student.Instance.Items[e.Key].Class;
                    e.Value = (classRec == null ? "" : classRec.Name);
                }
            };
            Student.Instance.AddListPaneField(classNameField);

            ListPaneField seatNoField = new ListPaneField("座號");
            seatNoField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].SeatNo;
                }
            };

            seatNoField.CompareValue += delegate(object sender, CompareValueEventArgs e)
            {
                int x, y;

                if (!int.TryParse(e.Value1.ToString(), out x))
                {
                    x = int.MaxValue;
                }

                if (!int.TryParse(e.Value2.ToString(), out y))
                {
                    y = int.MaxValue;
                }

                e.Result = x.CompareTo(y);
            };

            Student.Instance.AddListPaneField(seatNoField);

            ListPaneField nameField = new ListPaneField("姓名");
            nameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Name;
                }
            };
            Student.Instance.AddListPaneField(nameField);

            ListPaneField genderField = new ListPaneField("性別");
            genderField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].Gender;
                }
            };
            Student.Instance.AddListPaneField(genderField);

            ListPaneField studnumberField = new ListPaneField("學號");
            studnumberField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].StudentNumber;
                }
            };
            Student.Instance.AddListPaneField(studnumberField);

            ListPaneField birthday = new ListPaneField("生日");
            birthday.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].Birthday;
                }
            };
            Student.Instance.AddListPaneField(birthday);

            ListPaneField IDNumber = new ListPaneField("身分證號");
            IDNumber.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Student.Instance.Items[e.Key] != null)
                {
                    e.Value = Student.Instance.Items[e.Key].IDNumber;
                }
            };
            if (User.Acl["Student.Field.身分證號"].Executable)
            {
                Student.Instance.AddListPaneField(IDNumber);
            }

            #endregion

            #region Student Views
            Student.Instance.AddView(new JHSchool.StudentExtendControls.GradeYear_Class_View());
            //Student.Instance.AddView(new JHSchool.StudentExtendControls.CategoryView());
            #endregion

            #region 學生基本資料(20140429)

            IRewriteAPI_JH.IStudentDetailItemAPI itemB = FISCA.InteractionService.DiscoverAPI <IRewriteAPI_JH.IStudentDetailItemAPI>();
            if (itemB != null)
            {
                Student.Instance.AddDetailBulider(itemB.CreateBasicInfo());
            }
            else
            {
                Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.StudentExtendControls.BaseInfoPalmerwormItem>());
            }
            #endregion

            //            Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.BaseInfoPalmerwormItem>());
            //            Student.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider<JHSchool.StudentExtendControls.SemesterHistoryDetail>());
            //Student.Instance.AddDetailBulider(new DetailBulider<JHSchool.StudentExtendControls.ClassItem>());
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.ClassInfoPalmerwormItem>());
            //文字評量(jenyu)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.WordCommentPalmerworm>());


            // 電子報表(因相關功能未完成先註)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.ElectronicPaperPalmerworm>());

            #region Search Conditions
            ConfigData cd = User.Configuration["StudentSearchOptionPreference"];

            SearchName = SearchConditionMenu["姓名"];
            SearchName.AutoCheckOnClick    = true;
            SearchName.AutoCollapseOnClick = false;
            SearchName.Checked             = cd.GetBoolean("SearchName", true);
            SearchName.Click += delegate
            {
                cd.SetBoolean("SearchName", SearchName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            // 因用班級 Search 未用到先註 2009/9/30
            //SearchClass = SearchConditionMenu["班級"];
            //SearchClass.AutoCheckOnClick = true;
            //SearchClass.AutoCollapseOnClick = false;
            //SearchClass.Checked = cd.GetBoolean("SearchClass", true);
            //SearchClass.Click += delegate
            //{
            //    cd.SetBoolean("SearchClass", SearchClass.Checked);

            //    BackgroundWorker async = new BackgroundWorker();
            //    async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
            //    async.RunWorkerAsync(cd);
            //};

            SearchStudentNumber = SearchConditionMenu["學號"];
            SearchStudentNumber.AutoCheckOnClick    = true;
            SearchStudentNumber.AutoCollapseOnClick = false;
            SearchStudentNumber.Checked             = cd.GetBoolean("SearchStudentNumber", true);
            SearchStudentNumber.Click += delegate
            {
                cd.SetBoolean("SearchStudentNumber", SearchStudentNumber.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentIDNumber = SearchConditionMenu["身分證號"];
            SearchStudentIDNumber.AutoCheckOnClick    = true;
            SearchStudentIDNumber.AutoCollapseOnClick = false;
            SearchStudentIDNumber.Checked             = cd.GetBoolean("SearchStudentIDNumber", true);
            SearchStudentIDNumber.Click += delegate
            {
                cd.SetBoolean("SearchStudentIDNumber", SearchStudentIDNumber.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentParent = SearchConditionMenu["父母監護人"];
            SearchStudentParent.AutoCheckOnClick    = true;
            SearchStudentParent.AutoCollapseOnClick = false;
            SearchStudentParent.Checked             = cd.GetBoolean("SearchStudentParent", false);
            SearchStudentParent.Click += delegate
            {
                cd.SetBoolean("SearchStudentParent", SearchStudentParent.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchStudentLoginID = SearchConditionMenu["登入帳號"];
            SearchStudentLoginID.AutoCheckOnClick    = true;
            SearchStudentLoginID.AutoCollapseOnClick = false;
            SearchStudentLoginID.Checked             = cd.GetBoolean("SearchStudentLoginID", false);
            SearchStudentLoginID.Click += delegate
            {
                cd.SetBoolean("SearchStudentLoginID", SearchStudentLoginID.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchEnglishName = SearchConditionMenu["英文姓名"];
            SearchEnglishName.AutoCheckOnClick    = true;
            SearchEnglishName.AutoCollapseOnClick = false;
            SearchEnglishName.Checked             = cd.GetBoolean("SearchEnglishName", false);
            SearchEnglishName.Click += delegate
            {
                cd.SetBoolean("SearchEnglishName", SearchEnglishName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            Present.Search += new EventHandler <SearchEventArgs>(Student_Search);
            #endregion

            //缺曠記錄(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.AbsencePalmerwormItem>());
            //懲戒資料(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.DemeritPalmerwormItem>());
            //獎勵資料(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<StudentExtendControls.MeritPalmerwormItem>());
            //測試的先註解了(dylan)
            //Student.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<CriticalSection.Dylan_Test_Item>());

            Present.NavPaneContexMenu.GetChild("重新整理").Click += delegate { this.SyncAllBackground(); };

            Present.Picture = Properties.Resources.StudentIcon;

            //由類別模組提供
            //Present.SetDescriptionPaneBulider(new DescriptionPaneBulider<StudentExtendControls.StudentDescription>());

            //Student.Instance.RequiredDescription += delegate(object sender, RequiredDescriptionEventArgs e)
            //{
            //    if (string.IsNullOrEmpty(e.PrimaryKey)) return;

            //    var studentRec = Student.Instance.Items[e.PrimaryKey];
            //    e.Result = studentRec.GetDescription();
            //};

            //var defaultContentBulider = new DetailBulider<StudentControls.DetailContent>();
            //defaultContentBulider.ContentBulided += delegate(object sender, ContentBulidedEventArgs<K12.StudentControls.DetailContent> e)
            //{
            //    _DetialContents.Add(e.Content);
            //    e.Content.Visible = UseDefaultDetailContent;
            //    e.Content.Disposed += delegate(object sender2, EventArgs e2)
            //    {
            //        _DetialContents.Remove((StudentControls.DetailContent)sender2);
            //    };
            //};
            //this.AddDetailBulider(defaultContentBulider);

            #region  限管理
            Catalog ribbon = RoleAclSource.Instance["學生"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0000", "新增學生"));
            ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0010", "刪除學生"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0020", "匯入學籍資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0030", "匯出學籍資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0040", "指定學生類別"));
            //ribbon.Add(new RibbonFeature("JHSchool.Student.Ribbon0050", "管理學生類別清單"));

            Catalog detail = RoleAclSource.Instance["學生"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(StudentExtendControls.BaseInfoPalmerwormItem)));
            //detail.Add(new DetailItemFeature(typeof(JHSchool.StudentExtendControls.SemesterHistoryDetail)));
            //電子報表(因相關功能未完成先註)
            //detail.Add(new DetailItemFeature(typeof(StudentExtendControls.ElectronicPaperPalmerworm)));

            //Student.Field.身分證號
            ribbon = RoleAclSource.Instance["學生"]["清單欄位"];
            ribbon.Add(new RibbonFeature("Student.Field.身分證號", "身分證號"));
            #endregion

            //#region 待刪除畢業及離校
            //GraduateList = new List<string>();
            //GraduateLeaveInfoU = getAllStudGraduateIDs("畢業", "學年度畢業");
            //GraduateLeaveInfoD = getAllStudGraduateIDs("修業", "學年度修業");
            //GraduateLeaveInfoAll = getAllStudGraduateIDByStatus("畢業或離校");

            //foreach (string str in GraduateLeaveInfoU.Keys)
            //    if (!GraduateList.Contains(str))
            //        GraduateList.Add(str);

            //foreach (string str in GraduateLeaveInfoD.Keys)
            //    if (!GraduateList.Contains(str))
            //        GraduateList.Add(str);

            //GraduateList.Add("離校(非畢修業)");

            //GraduateList.Sort();
            //#endregion

            foreach (string each in AllStatus)
            {
                CreateFilterItem(each);
            }


            //#region 待刪除畢業及離校

            //JHSchool.Data.JHStudent.AfterUpdate += delegate
            //{
            //    GraduateLeaveInfoAll = null;
            //    GraduateLeaveInfoD = null;
            //    GraduateLeaveInfoU = null;
            //    GraduateList = null;
            //    GraduateList = new List<string>();
            //    GraduateLeaveInfoU = getAllStudGraduateIDs("畢業", "學年度畢業");
            //    GraduateLeaveInfoD = getAllStudGraduateIDs("修業", "學年度修業");
            //    GraduateLeaveInfoAll = getAllStudGraduateIDByStatus("畢業或離校");
            //    foreach (string str in GraduateLeaveInfoU.Keys)
            //        if (!GraduateList.Contains(str))
            //            GraduateList.Add(str);

            //    foreach (string str in GraduateLeaveInfoD.Keys)
            //        if (!GraduateList.Contains(str))
            //            GraduateList.Add(str);

            //    GraduateList.Add("離校(非畢修業)");

            //    GraduateList.Sort();

            //    FillFilter();
            //};
            //#endregion

            bool havedef = false;
            foreach (string each in AllStatus)
            {
                havedef |= FilterMenu[each].Checked;
            }

            if (!havedef)
            {
                FilterMenu["一般"].Checked = true;
            }

            UseFilter = true;

            MotherForm.AddPanel(K12.Presentation.NLDPanels.Student);
            _Initilized = true;
            FillFilter();
        }
        public ClubAdmin()
        {
            Group = "拓展性课程";

            #region 事件

            BGW.DoWork += new DoWorkEventHandler(BGW_DoWork);
            BGW.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BGW_RunWorkerCompleted);

            //社團自我更新事件
            ClubEvents.ClubChanged += new EventHandler(ClubEvents_ClubChanged);

            #endregion

            #region 社團系統編號
            Field0_0 = new ListPaneField("课程系统编号");
            Field0_0.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].UID;
                }
            };
            this.AddListPaneField(Field0_0);
            #endregion
            #region 代碼
            Field0 = new ListPaneField("代码");
            Field0.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubNumber;
                }
            };
            this.AddListPaneField(Field0);
            #endregion
            #region 學年度
            Field1_1 = new ListPaneField("学年度");
            Field1_1.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].SchoolYear;
                }
            };
            this.AddListPaneField(Field1_1);
            #endregion
            #region 學期
            Field1_2 = new ListPaneField("学期");
            Field1_2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].Semester;
                }
            };
            this.AddListPaneField(Field1_2);
            #endregion
            #region 領域
            {
                var field = new ListPaneField("课程领域");
                field.GetVariable += delegate(object sender, GetVariableEventArgs e)
                {
                    if (AllClubDic.ContainsKey(e.Key))
                    {
                        e.Value = AllClubDic[e.Key].Domain;
                    }
                };
                this.AddListPaneField(field);
            }
            #endregion
            #region 名稱
            Field1 = new ListPaneField("名称");
            Field1.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubName;
                }
            };
            this.AddListPaneField(Field1);
            #endregion
            #region 老師
            Field2 = new ListPaneField("老师1");
            Field2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2);

            Field2_2 = new ListPaneField("老师2");
            Field2_2.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID2))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID2].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID2].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2_2);

            Field2_3 = new ListPaneField("老师3");
            Field2_3.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    if (TeacherDic.ContainsKey(AllClubDic[e.Key].RefTeacherID3))
                    {
                        if (string.IsNullOrEmpty(TeacherDic[AllClubDic[e.Key].RefTeacherID3].Nickname))
                        {
                            e.Value = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Name;
                        }
                        else
                        {
                            string terName = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Name;
                            string Nicname = TeacherDic[AllClubDic[e.Key].RefTeacherID3].Nickname;
                            e.Value = terName + "(" + Nicname + ")";
                        }
                    }
                }
            };
            this.AddListPaneField(Field2_3);
            #endregion
            #region 類型
            Field12 = new ListPaneField("类型");
            Field12.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].ClubCategory;
                }
            };
            this.AddListPaneField(Field12);
            #endregion
            #region 长短课程
            {
                var field = new ListPaneField("长短课程");
                field.GetVariable += delegate(object sender, GetVariableEventArgs e)
                {
                    if (AllClubDic.ContainsKey(e.Key))
                    {
                        e.Value = AllClubDic[e.Key].FullPhase == true ? "长课程" : "";
                    }
                };
                this.AddListPaneField(field);
            }
            #endregion
            #region 場地
            Field3 = new ListPaneField("场地");
            Field3.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    e.Value = AllClubDic[e.Key].Location;
                }
            };
            this.AddListPaneField(Field3);
            #endregion
            #region 社長
            Field4 = new ListPaneField("社长");
            Field4.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //需取得社員資料
                    //對照出社長姓名
                    if (StudentDic.ContainsKey(AllClubDic[e.Key].President))
                    {
                        e.Value = StudentDic[AllClubDic[e.Key].President].StudentName;
                    }
                }
            };
            this.AddListPaneField(Field4);
            #endregion
            #region 副社長
            Field5 = new ListPaneField("副社长");
            Field5.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (AllClubDic.ContainsKey(e.Key))
                {
                    //需取得副社員資料
                    //對照出副社長姓名
                    if (StudentDic.ContainsKey(AllClubDic[e.Key].VicePresident))
                    {
                        e.Value = StudentDic[AllClubDic[e.Key].VicePresident].StudentName;
                    }
                }
            };
            this.AddListPaneField(Field5);
            #endregion
            #region 第一階段
            {
                var field = new ListPaneField("第一阶段");
                field.GetVariable += delegate(object sender, GetVariableEventArgs e)
                {
                    if (AllClubDic.ContainsKey(e.Key))
                    {
                        //count出本社團的SCJoin數量
                        //就是人數
                        int count1 = 0;

                        if (ClubCountSCJoin.ContainsKey(e.Key + "_1"))
                        {
                            count1 = ClubCountSCJoin[e.Key + "_1"].社團人數;
                        }

                        e.Value = count1;
                    }
                };
                this.AddListPaneField(field);
            }
            #endregion
            #region 第二階段
            {
                var field = new ListPaneField("第二阶段");
                field.GetVariable += delegate(object sender, GetVariableEventArgs e)
                {
                    if (AllClubDic.ContainsKey(e.Key))
                    {
                        //count出本社團的SCJoin數量
                        //就是人數
                        int count1 = 0;

                        if (ClubCountSCJoin.ContainsKey(e.Key + "_2"))
                        {
                            count1 = ClubCountSCJoin[e.Key + "_2"].社團人數;
                        }

                        e.Value = count1;
                    }
                };
                this.AddListPaneField(field);
            }
            #endregion

            #region 目前人數
            //Field11 = new ListPaneField("目前人数");
            //Field11.GetVariable += delegate(object sender, GetVariableEventArgs e)
            //{
            //    if (AllClubDic.ContainsKey(e.Key))
            //    {
            //        //count出本社團的SCJoin數量
            //        //就是人數
            //        int count1 = 0;

            //        if (ClubCountSCJoin.ContainsKey(e.Key))
            //        {
            //            count1 = ClubCountSCJoin[e.Key].社團人數;
            //        }

            //        e.Value = count1;
            //    }

            //};
            //this.AddListPaneField(Field11);
            #endregion


            FilterMenu.SupposeHasChildern = true;
            FilterMenu.PopupOpen += new EventHandler<PopupOpenEventArgs>(FilterMenu_PopupOpen);
            //目前預設學年期設為標題
            FilterMenu.Text = FiltedSemester;

            //設定預設學年期
            //SetClubList(FiltedSemester);

            #region Search

            Campus.Configuration.ConfigData cd = Campus.Configuration.Config.User["AssociationSearchOptionPreference"];

            SearchClubName = SetSearchButton("名称", "SearchClubName", cd);
            SearchClubTeacher = SetSearchButton("老师", "SearchClubTeacher", cd);
            SearchStudentName = SetSearchButton("学生", "SearchStudentName", cd);
            SearchAddress = SetSearchButton("场地", "SearchAddress", cd);
            #endregion

            this.Search += new EventHandler<SearchEventArgs>(ClubAdmin_Search);

            //取得社團基本資料
            BGW.RunWorkerAsync();
        }
Ejemplo n.º 15
0
        public RetakeAdmin()
        {
            Group = "重補修";
            UDTTimeListDef dd = UDTTransfer.UDTTimeListGetActiveTrue1();
            FilterCourseItem = dd.SchoolYear + " " + dd.Semester + " 第" + dd.Month + "梯次";

            _bgWorker.DoWork += new DoWorkEventHandler(_bgWorker_DoWork);
            _bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bgWorker_RunWorkerCompleted);
            // 註冊重補修事件
            RetakeEvents.RetakeChanged += new EventHandler(RetakeEvents_RetakeChanged);

            ListPaneField Field01 = new ListPaneField("課程名稱");
            Field01.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    e.Value = _AllCourseDict[e.Key].CourseName;
            };
            this.AddListPaneField(Field01);

            ListPaneField Field02 = new ListPaneField("科目名稱");
            Field02.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                {
                    if (_AllCourseDict[e.Key].SubjectLevel.HasValue)
                        e.Value = _AllCourseDict[e.Key].SubjectName + QueryData.GetNumber(_AllCourseDict[e.Key].SubjectLevel.Value.ToString());
                    else
                        e.Value = _AllCourseDict[e.Key].SubjectName;
                    
                }
            };
            this.AddListPaneField(Field02);

            ListPaneField Field03 = new ListPaneField("級別");
            Field03.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    if (_AllCourseDict[e.Key].SubjectLevel.HasValue)
                        e.Value = _AllCourseDict[e.Key].SubjectLevel.Value;
                    else
                        e.Value = "";
            };
            this.AddListPaneField(Field03);

            ListPaneField Field04 = new ListPaneField("學分數");
            Field04.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    e.Value = _AllCourseDict[e.Key].Credit;
            };
            this.AddListPaneField(Field04);

            ListPaneField Field05 = new ListPaneField("科目類別");
            Field05.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    e.Value = _AllCourseDict[e.Key].SubjectType;
            };
            this.AddListPaneField(Field05);

            ListPaneField Field06 = new ListPaneField("科別");
            Field06.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    e.Value = _AllCourseDict[e.Key].DeptName;
            };
            this.AddListPaneField(Field06);

            ListPaneField Field07 = new ListPaneField("授課教師名稱");
            Field07.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_AllCourseDict.ContainsKey(e.Key))
                    if(Global._TeacherIDNameDict.ContainsKey(_AllCourseDict[e.Key].RefTeacherID))
                        e.Value = Global._TeacherIDNameDict[_AllCourseDict[e.Key].RefTeacherID];
            };
            this.AddListPaneField(Field07);

            // 設定搜尋欄位
            ConfigData cd = Config.User["K12.Retake.Shinmin.SearchOption"];
           SearchCourseName = SetSearchButton("課程名稱", "SearchCourseName", cd);
           SearchSubjectName = SetSearchButton("科目名稱","SearchSubjectName", cd);
           SearchSubjectType = SetSearchButton("科目類別", "SearchSubjectType", cd);

            FilterMenu.SupposeHasChildern = true;
            FilterMenu.PopupOpen += new EventHandler<PopupOpenEventArgs>(FilterMenu_PopupOpen);
            FilterMenu.Text = FilterCourseItem;
            this.Search += new EventHandler<SearchEventArgs>(RetakeAdmin_Search);
            _bgWorker.RunWorkerAsync();
        }
Ejemplo n.º 16
0
        public void SetupPresentation()
        {
            Class.Instance.RibbonBarItems["編輯"].Index   = 0;
            Class.Instance.RibbonBarItems["資料統計"].Index = 1;
            Class.Instance.RibbonBarItems["指定"].Index   = 2;
            Class.Instance.RibbonBarItems["教務"].Index   = 3;
            Class.Instance.RibbonBarItems["學務"].Index   = 4;

            #region RibbonBar 班級/編輯
            RibbonBarItem rbItem = Class.Instance.RibbonBarItems["編輯"];
            rbItem["新增"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["新增"].Enable = User.Acl["JHSchool.Class.Ribbon0000"].Executable;
            rbItem["新增"].Image  = ClassExtendControls.Ribbon.Resources.btnAddClass;
            rbItem["新增"].Click += delegate
            {
                new JHSchool.ClassExtendControls.Ribbon.AddClass().ShowDialog();
            };

            rbItem["刪除"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["刪除"].Image  = ClassExtendControls.Ribbon.Resources.btnDeleteClass;
            rbItem["刪除"].Enable = User.Acl["JHSchool.Class.Ribbon0010"].Executable;
            rbItem["刪除"].Click += delegate
            {
                if (SelectedList.Count == 1)
                {
                    JHSchool.Data.JHClassRecord record = JHSchool.Data.JHClass.SelectByID(SelectedList[0].ID);
                    string msg;
                    // 當有學生
                    if (record.Students.Count > 0)
                    {
                        msg = string.Format("確定要刪除「{0}」?班上" + record.Students.Count + "位學生將移到未分年級未分班級.", record.Name);
                    }
                    else
                    {
                        msg = string.Format("確定要刪除「{0}」?", record.Name);
                    }

                    if (FISCA.Presentation.Controls.MsgBox.Show(msg, "刪除班級", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        JHSchool.Data.JHClassRecord classRec = JHSchool.Data.JHClass.SelectByID(record.ID);

                        PermRecLogProcess prlp = new PermRecLogProcess();
                        prlp.SaveLog("學籍.班級", "刪除班級", "刪除班級資料,班級名稱:" + classRec.Name);
                        JHSchool.Data.JHClass.Delete(classRec);
                        Class.Instance.SyncDataBackground(record.ID);
                    }
                    else
                    {
                        return;
                    }
                }
            };
            #endregion

            #region RibbonBar 學生/匯入匯出

            rbItem             = Class.Instance.RibbonBarItems["資料統計"];
            rbItem["匯出"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯出"].Image = Properties.Resources.Export_Image;
            rbItem["匯出"]["匯出班級基本資料"].Enable = User.Acl["JHSchool.Class.Ribbon0030"].Executable;
            rbItem["匯出"]["匯出班級基本資料"].Click += delegate
            {
                new JHSchool.ClassExtendControls.Ribbon.ClassExportWizard().ShowDialog();
            };

            rbItem["匯入"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯入"].Image = Properties.Resources.Import_Image;
            rbItem["匯入"]["匯入班級基本資料"].Enable = User.Acl["JHSchool.Class.Ribbon0020"].Executable;
            rbItem["匯入"]["匯入班級基本資料"].Click += delegate
            {
                new JHSchool.ClassExtendControls.Ribbon.ClassImportWizard().ShowDialog();
            };
            #endregion

            //報表,是以常態呈現
            rbItem["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["報表"].Image = Properties.Resources.paste_64;
            rbItem["報表"].SupposeHasChildern = true;

            #region RibbonBar 班級/學務作業
            //rbItem = Class.Instance.RibbonBarItems["學務作業"];
            //rbItem["德行加減分"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["德行加減分"].Image = ClassExtendControls.Ribbon.Resources.btnAdjust_Image;
            //rbItem["德行加減分"].Click += delegate
            //{

            //};

            //rbItem["文字評量"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["文字評量"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 班級/教務作業
            //rbItem = Class.Instance.RibbonBarItems["教務作業"];
            //rbItem["班級升級"].Image = ClassExtendControls.Ribbon.Resources.btnUpgrade_Image;
            //rbItem["班級升級"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 班級/指定
            rbItem = Class.Instance.RibbonBarItems["指定"];
            //rbItem["類別"].Image = InternalExtendControls.Tagging.Resources.ctxTag_Image;
            //rbItem["類別"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["類別"].SupposeHasChildern = true;
            //rbItem["類別"].PopupOpen += new EventHandler<PopupOpenEventArgs>(
            //    new TaggingMenu("JHSchool.Class.Ribbon0040", "JHSchool.Class.Ribbon0050").MenuOpen);

            //rbItem = Class.Instance.RibbonBarItems["指定"];
            //rbItem["學生"].Size = RibbonBarButton.MenuButtonSize.Small;
            //rbItem["學生"].Image = ClassExtendControls.Ribbon.Resources.btnAssignStudent_Image;
            //rbItem["學生"].Click += delegate
            //{

            //};

            //rbItem["課程規劃"].Size = RibbonBarButton.MenuButtonSize.Small;
            //rbItem["課程規劃"].Image = ClassExtendControls.Ribbon.Resources.btnPlan_Image;
            //rbItem["課程規劃"].Click += delegate
            //{

            //};

            //rbItem["計算規則"].Size = RibbonBarButton.MenuButtonSize.Small;
            //rbItem["計算規則"].Image = ClassExtendControls.Ribbon.Resources.btnCalcRule_Image;
            //rbItem["計算規則"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 班級/統計報表0
            //rbItem = Class.Instance.RibbonBarItems["統計報表"];
            //rbItem["統計"].Image = ClassExtendControls.Ribbon.Resources.btnStatistics_Image;
            //rbItem["統計"].Click += delegate
            //{

            //};

            //rbItem["報表"].Image = ClassExtendControls.Ribbon.Resources.btnReport_Image;
            //rbItem["報表"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 班級/其它
            //rbItem = Class.Instance.RibbonBarItems["其它"];
            //rbItem["修改歷程"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["修改歷程"].Image = ClassExtendControls.Ribbon.Resources.btnHistory_Image;
            //rbItem["修改歷程"].Click += delegate
            //{

            //};

            //rbItem["問卷"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["問卷"].Image = ClassExtendControls.Ribbon.Resources.btnSurvey_Image;
            //rbItem["問卷"].Click += delegate
            //{

            //};
            #endregion

            //ListPaneField idField = new ListPaneField("ID");
            //idField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            //{
            //    e.Value = e.Key;
            //};

            //#region 排序班級ID
            //idField.CompareValue += delegate(object sender, CompareValueEventArgs e)
            //{
            //    int x, y;

            //    if (!int.TryParse(e.Value1.ToString(), out x))
            //        x = int.MaxValue;

            //    if (!int.TryParse(e.Value2.ToString(), out y))
            //        y = int.MaxValue;

            //    e.Result = x.CompareTo(y);
            //};
            //#endregion
            //this.AddListPaneField(idField);

            ListPaneField gradeYearField = new ListPaneField("年級");
            gradeYearField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].GradeYear;
                }
            };
            this.AddListPaneField(gradeYearField);


            ListPaneField nameField = new ListPaneField("名稱");
            nameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Name;
                }
            };

            this.AddListPaneField(nameField);

            ListPaneField classTeacherField = new ListPaneField("班導師");
            classTeacherField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    if (Items[e.Key].Teacher != null)
                    {
                        e.Value = Items[e.Key].Teacher.FullName;
                    }
                }
            };
            this.AddListPaneField(classTeacherField);

            ListPaneField classStudentCountField = new ListPaneField("人數");
            classStudentCountField.CompareValue += new EventHandler <CompareValueEventArgs>(class_CompareValue);
            classStudentCountField.GetVariable  += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].Students.Count;
                }
            };
            this.AddListPaneField(classStudentCountField);


            ListPaneField classIndexField = new ListPaneField("排列序號");
            classIndexField.CompareValue += new EventHandler <CompareValueEventArgs>(class_CompareValue);
            classIndexField.GetVariable  += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    if (Items[e.Key].DisplayOrder != "")
                    {
                        e.Value = Items[e.Key].DisplayOrder;
                    }
                    else
                    {
                        e.Value = "";
                    }
                }
            };
            this.AddListPaneField(classIndexField);

            ListPaneField classNamingRuleField = new ListPaneField("班級命名規則");
            classNamingRuleField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (Items[e.Key] != null)
                {
                    e.Value = Items[e.Key].NamingRule;
                }
            };
            this.AddListPaneField(classNamingRuleField);

            //Class.Instance.AddView(new AllItemView());

            Class.Instance.AddView(new JHSchool.StudentExtendControls.Class_View());
            //Class.Instance.AddView(new JHSchool.ClassExtendControls.SubjectView()); //由類別模組提供

            // 班級基本資料
            Class.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.ClassExtendControls.ClassBaseInfoItem>());

            //Class.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<ClassExtendControls.ClassBaseInfoItem>());

            Present.NavPaneContexMenu.GetChild("重新整理").Click += delegate { this.SyncAllBackground(); };

            //Class.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<ClassExtendControls.ClassStudentItem>());
            //電子報表(因相關功能未完成先註)
            //Class.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<ClassExtendControls.ElectronicPaperPalmerworm>());

            //Class.Instance.AddDetailBulider(new JHSchool.CriticalSection.Test_classInfo());

            #region 註冊權限管理
            Catalog ribbon = RoleAclSource.Instance["班級"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0000", "新增班級"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0010", "刪除班級"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0020", "匯入班級資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0030", "匯出班級資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0040", "指定班級類別"));
            //ribbon.Add(new RibbonFeature("JHSchool.Class.Ribbon0050", "管理班級類別清單"));

            Catalog detail = RoleAclSource.Instance["班級"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(ClassExtendControls.ClassBaseInfoItem)));
            //電子報表(因相關功能未完成先註)
            //detail.Add(new DetailItemFeature(typeof(ClassExtendControls.ElectronicPaperPalmerworm)));
            #endregion

            #region 增加班級搜尋條件鈕

            ConfigData cd = User.Configuration["ClassSearchOptionPreference"];

            SearchClassName = SearchConditionMenu["班級名稱"];
            SearchClassName.AutoCheckOnClick    = true;
            SearchClassName.AutoCollapseOnClick = false;
            SearchClassName.Checked             = cd.GetBoolean("SearchClassName", true);
            SearchClassName.Click += delegate
            {
                cd.SetBoolean("SearchClassName", SearchClassName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchClassTeacher = SearchConditionMenu["班級導師"];
            SearchClassTeacher.AutoCheckOnClick    = true;
            SearchClassTeacher.AutoCollapseOnClick = false;
            SearchClassTeacher.Checked             = cd.GetBoolean("SearchClassTeacher", true);
            SearchClassTeacher.Click += delegate
            {
                cd.SetBoolean("SearchClassTeacher", SearchClassTeacher.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            Present.Search += new EventHandler <SearchEventArgs>(Class_Search);

            #endregion

            //由類別模組提供
            //Present.SetDescriptionPaneBulider(new DescriptionPaneBulider<JHSchool.ClassExtendControls.ClassDescription>());

            MotherForm.AddPanel(K12.Presentation.NLDPanels.Class);
            _Initilized = true;
            FillFilter();
        }
Ejemplo n.º 17
0
        public static void Main()
        {
            _bgLLoadUDT.DoWork             += _bgLLoadUDT_DoWork;
            _bgLLoadUDT.RunWorkerCompleted += _bgLLoadUDT_RunWorkerCompleted;
            _bgLLoadUDT.RunWorkerAsync();

            Dictionary <string, UDT_ClassLock> _UDT_ClassLockDict = UDTTransfer.GetClassLockNameIDDict();
            Dictionary <string, KH_HighConcernCalc.ClassStudent> _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();

            Catalog catalog01 = RoleAclSource.Instance["班級"]["功能按鈕"];

            catalog01.Add(new RibbonFeature("KH_HighConcern_ClassLock", "班級鎖定/解鎖"));
            catalog01.Add(new RibbonFeature("KH_HighConcern_AllClassUnLock", "全部班級解鎖"));
            catalog01.Add(new RibbonFeature("KH_HighConcern_SendClassDataView", "檢視傳送局端備查紀錄"));

            ListPaneField ClassLockStudentCountField = new ListPaneField("編班人數");

            ClassLockStudentCountField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_ClassStudentDict.ContainsKey(e.Key))
                {
                    if (_ClassStudentDict.ContainsKey(e.Key))
                    {
                        e.Value = _ClassStudentDict[e.Key].ClassStudentCountStr;
                    }
                }
            };
            K12.Presentation.NLDPanels.Class.AddListPaneField(ClassLockStudentCountField);


            ListPaneField ClassLockField = new ListPaneField("班級鎖定");

            ClassLockField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_UDT_ClassLockDict.ContainsKey(e.Key))
                {
                    // 當有鎖定再顯示
                    if (_UDT_ClassLockDict[e.Key].isLock)
                    {
                        if (_UDT_ClassLockDict[e.Key].UnAutoUnlock)
                        {
                            e.Value = "鎖定(不自動解鎖)";
                        }
                        else
                        {
                            e.Value = "鎖定";
                        }
                    }
                }
            };
            K12.Presentation.NLDPanels.Class.AddListPaneField(ClassLockField);

            ListPaneField ClassLockCommentField = new ListPaneField("鎖定備註");

            ClassLockCommentField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                // 只要有資料就顯示
                if (_UDT_ClassLockDict.ContainsKey(e.Key))
                {
                    e.Value = _UDT_ClassLockDict[e.Key].Comment;
                }
            };
            K12.Presentation.NLDPanels.Class.AddListPaneField(ClassLockCommentField);


            ListPaneField ClassLockSStudentCountField = new ListPaneField("特殊生人數");

            ClassLockSStudentCountField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                if (_ClassStudentDict.ContainsKey(e.Key))
                {
                    if (_ClassStudentDict.ContainsKey(e.Key))
                    {
                        e.Value = _ClassStudentDict[e.Key].ClassHStudentCount;
                    }
                }
            };
            K12.Presentation.NLDPanels.Class.AddListPaneField(ClassLockSStudentCountField);


            K12.Presentation.NLDPanels.Class.SelectedSourceChanged += delegate {
                // 檢查當有權限並只選一個班才可以使用
                K12.Presentation.NLDPanels.Class.ListPaneContexMenu["班級鎖定/解鎖"].Enable = UserAcl.Current["KH_HighConcern_ClassLock"].Executable && (K12.Presentation.NLDPanels.Class.SelectedSource.Count == 1);
            };

            //RibbonBarItem rbSendClassDataView = K12.Presentation.NLDPanels.Class.RibbonBarItems["其它"];
            //rbSendClassDataView["檢視傳送局端備查紀錄"].Enable = UserAcl.Current["KH_HighConcern_SendClassDataView"].Executable;
            //rbSendClassDataView["檢視傳送局端備查紀錄"].Click += delegate
            //{
            //    SendDataView sdv = new SendDataView();
            //    sdv.ShowDialog();
            //};

            RibbonBarItem rbiDelAll = K12.Presentation.NLDPanels.Class.RibbonBarItems["其它"];

            rbiDelAll["全部班級解鎖"].Enable = UserAcl.Current["KH_HighConcern_AllClassUnLock"].Executable;
            rbiDelAll["全部班級解鎖"].Click += delegate
            {
                MsgForm mf2 = new MsgForm();
                mf2.Text = "全部班級解鎖";
                mf2.SetMsg("將全部班級解鎖,按下「是」確認後,局端會留解鎖紀錄。");
                //if (FISCA.Presentation.Controls.MsgBox.Show("將全部班級解鎖,按下「是」確認後,局端會留解鎖紀錄。", "全部班級解鎖", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                if (mf2.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                {
                    // 全部解鎖
                    UDTTransfer.UnlockAllClass();

                    // 紀錄班級名稱條件:不自動解鎖false,鎖定 true
                    List <string> ClassNameList = (from data in _UDT_ClassLockDict.Values where data.UnAutoUnlock == false && data.isLock == true select data.ClassName).ToList();

                    foreach (UDT_ClassLock data in _UDT_ClassLockDict.Values)
                    {
                        if (data.UnAutoUnlock == false && data.isLock == true)
                        {
                            Utility.SendData(data.ClassName, "", "", "解除鎖定班級", data.DateStr, data.Comment, data.DocNo, data.EDoc, data.ClassID, "", "");
                        }
                    }

                    FISCA.Presentation.Controls.MsgBox.Show("全部班級解鎖");

                    // 重新整理
                    _UDT_ClassLockDict = UDTTransfer.GetClassLockNameIDDict();
                    ClassLockField.Reload();
                    ClassLockCommentField.Reload();
                    ClassLockStudentCountField.Reload();
                    ClassLockSStudentCountField.Reload();
                }
            };

            #region  步更新

            // 當高關懷特殊身分有更新
            FISCA.InteractionService.SubscribeEvent("KH_HighConcern_HighConcernContent", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            // 當變更學生狀態
            FISCA.InteractionService.SubscribeEvent("KH_StudentChangeStatus", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            // 當變更學生班級
            FISCA.InteractionService.SubscribeEvent("KH_StudentClassItemContent", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            // 當變更學生轉入
            FISCA.InteractionService.SubscribeEvent("KH_StudentTransferStudentBriefItem", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            // 當變更學生匯入
            FISCA.InteractionService.SubscribeEvent("KH_StudentImportWizard", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            // 當變更學生-轉入
            FISCA.InteractionService.SubscribeEvent("KH_StudentTransStudBase", (sender, args) =>
            {
                _ClassStudentDict = KH_HighConcernCalc.Calc.GetClassStudentAllIDDict();
                ClassLockStudentCountField.Reload();
                ClassLockSStudentCountField.Reload();
            });

            #endregion


            K12.Presentation.NLDPanels.Class.ListPaneContexMenu["班級鎖定/解鎖"].Click += delegate
            {
                string cid = K12.Presentation.NLDPanels.Class.SelectedSource[0];
                // 檢查並取得班級鎖定
                UDT_ClassLock        data     = UDTTransfer.GetClassLockByClassID(cid);
                K12.Data.ClassRecord classRec = K12.Data.Class.SelectByID(cid);

                List <JHClassTagRecord> recList = JHClassTag.SelectByClassID(cid);

                bool Class_Has_Standard_Category = false;


                string grYear = "";
                string SecondPriorityClassName = "", ThridPriorityClassName = "";
                if (classRec.GradeYear.HasValue)
                {
                    grYear = classRec.GradeYear.Value.ToString();
                }

                Dictionary <string, int> classCot = new Dictionary <string, int>();

                List <KH_HighConcernCalc.ClassStudent> ClassStudentList = KH_HighConcernCalc.Calc.GetClassStudentList(grYear);
                int idx = 1;
                foreach (KH_HighConcernCalc.ClassStudent cs in ClassStudentList)
                {
                    classCot.Add(cs.ClassName, cs.ClassStudentCount);
                    if (idx == 2)     // 第二順位
                    {
                        SecondPriorityClassName = cs.ClassName;
                    }

                    if (idx == 3)      // 第三順位
                    {
                        ThridPriorityClassName = cs.ClassName;
                    }
                    idx++;
                }

                //穎驊新增, 用來檢查,此班級 是否有高雄定義的標準班級分類, 其定義了十種標準子類別在 KH_HighConcern專案 Program 下面程式碼,
                // 定義了普通班、體育班、美術班、音樂班、舞蹈班、資優班、資源班、特教班、技藝專班、機構式非學校自學班,
                //2016/12 高雄局端,希望在所有班級鎖班之前,都必須要有標準"班級分類",以利作業。

                foreach (var rec in recList)
                {
                    if (rec.Prefix == "班級分類")
                    {
                        Class_Has_Standard_Category = true;
                    }
                }



                // 當已被鎖定,問是否解鎖
                if (data.isLock)
                {
                    MsgForm mf1 = new MsgForm();
                    mf1.Text = "班級解鎖";
                    mf1.SetMsg("「班級解鎖」,按下「是」確認後,局端會留解鎖紀錄。");
                    //if (FISCA.Presentation.Controls.MsgBox.Show("「班級解鎖」,按下「是」確認後,局端會留解鎖紀錄。", "班級解鎖", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Warning, System.Windows.Forms.MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
                    if (mf1.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                    {
                        // 已被鎖定解鎖
                        data.isLock       = false;
                        data.UnAutoUnlock = false;
                        string errMsg = Utility.SendData(classRec.Name, grYear, "", "解除鎖定班級", data.DateStr, data.Comment, data.DocNo, data.EDoc, data.ClassID, "", "");
                        if (errMsg != "")
                        {
                            FISCA.Presentation.Controls.MsgBox.Show(errMsg);
                        }
                        else
                        {
                            FISCA.Presentation.Controls.MsgBox.Show("已解鎖");
                        }
                        // 解鎖清除鎖定備註
                        data.Comment = "";
                    }
                }
                else
                {
                    if (Class_Has_Standard_Category)
                    {
                        // 未鎖定,問是否要鎖定
                        // 編班委員會會議日期
                        string strDate    = "";
                        string strComment = "";
                        string strDocNo   = "";
                        string strEDoc    = "";

                        SendDataForm sdf = new SendDataForm();
                        if (sdf.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                        {
                            strDate    = sdf.GetSendDate();
                            strComment = sdf.GetComment();
                            strDocNo   = sdf.GetDocNo();
                            strEDoc    = sdf.GetEDoc();
                            MsgForm mf = new MsgForm();
                            mf.Text = "班級鎖定";
                            mf.SetMsg("「班級鎖定」,按下「是」確認後,除集中式特殊班級,餘需函報教育局並由局端線上審核。");
                            //if (FISCA.Presentation.Controls.MsgBox.Show("「班級鎖定」,按下「是」確認後,除集中式特殊班級,餘需函報教育局並由局端線上審核。", "班級鎖定", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Warning, System.Windows.Forms.MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
                            if (mf.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                            {
                                // 寫入相對班級學生變動
                                int icid = int.Parse(cid);
                                UDTTransfer.UpdateUDTClassSepcByClassID(icid, classRec.Name, data.Comment, strComment);

                                data.ClassID      = cid;
                                data.ClassName    = classRec.Name;
                                data.Comment      = strComment;
                                data.DocNo        = strDocNo;
                                data.DateStr      = strDate;
                                data.EDoc         = strEDoc;
                                data.UnAutoUnlock = sdf.GetNUnLock();
                                data.isLock       = true;

                                string errMsg = Utility.SendData(classRec.Name, grYear, "", "鎖定班級", strDate, strComment, strDocNo, strEDoc, data.ClassID, SecondPriorityClassName, ThridPriorityClassName);

                                // 傳送檔案到局端
                                Utility.UploadFile(data.ClassID, sdf.GetBase64DataString(), sdf.GetFileName());

                                if (errMsg != "")
                                {
                                    FISCA.Presentation.Controls.MsgBox.Show(errMsg);
                                }
                                else
                                {
                                    if (data.UnAutoUnlock)
                                    {
                                        FISCA.Presentation.Controls.MsgBox.Show("已鎖定(不自動解鎖)");
                                    }
                                    else
                                    {
                                        FISCA.Presentation.Controls.MsgBox.Show("已鎖定");
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        FISCA.Presentation.Controls.MsgBox.Show("鎖班前,請將本班級先加入'班級分類:'中任一類別", "警告", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);

                        return;
                    }
                }
                // 儲存 UDT
                if (data != null)
                {
                    data.Save();
                    _UDT_ClassLockDict = UDTTransfer.GetClassLockNameIDDict();
                    ClassLockField.Reload();
                    ClassLockCommentField.Reload();
                    ClassLockStudentCountField.Reload();
                    ClassLockSStudentCountField.Reload();
                }
            };
        }
Ejemplo n.º 18
0
        public void SetupPresentation()
        {
            Teacher.Instance.RibbonBarItems["編輯"].Index   = 0;
            Teacher.Instance.RibbonBarItems["資料統計"].Index = 1;

            #region RibbonBar 教師/編輯
            RibbonBarItem rbItem = Teacher.Instance.RibbonBarItems["編輯"];
            rbItem["新增"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["新增"].Image  = TeacherExtendControls.Ribbon.Resources.btnAddTeacher;
            rbItem["新增"].Enable = User.Acl["JHSchool.Teacher.Ribbon0000"].Executable;
            rbItem["新增"].Click += delegate
            {
                new JHSchool.TeacherExtendControls.Ribbon.AddTeacher().ShowDialog();
            };

            rbItem["刪除"].Size   = RibbonBarButton.MenuButtonSize.Large;
            rbItem["刪除"].Image  = TeacherExtendControls.Ribbon.Resources.btnDeleteTeacher;
            rbItem["刪除"].Enable = User.Acl["JHSchool.Teacher.Ribbon0010"].Executable;
            rbItem["刪除"].Click += delegate
            {
                if (SelectedList.Count == 1)
                {
                    JHSchool.Data.JHTeacherRecord thRec = JHSchool.Data.JHTeacher.SelectByID(SelectedList[0].ID);
                    thRec.Status = K12.Data.TeacherRecord.TeacherStatus.刪除;

                    string msg = string.Format("確定要刪除「{0}」?", thRec.Name);
                    if (FISCA.Presentation.Controls.MsgBox.Show(msg, "刪除教師", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        JHSchool.Data.JHTeacher.Update(thRec);
                        Teacher.Instance.SyncDataBackground(thRec.ID);
                        PermRecLogProcess prlp = new PermRecLogProcess();
                        prlp.SaveLog("學籍.教師", "刪除教師", "刪除教師,姓名:" + thRec.Name);
                    }
                    else
                    {
                        return;
                    }
                }
            };


            #endregion

            #region RibbonBar 教師/匯入匯出
            rbItem = Teacher.Instance.RibbonBarItems["資料統計"];

            rbItem["匯出"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯出"].Image = Properties.Resources.Export_Image;
            rbItem["匯出"]["匯出教師基本資料"].Enable = User.Acl["JHSchool.Teacher.Ribbon0020"].Executable;
            rbItem["匯出"]["匯出教師基本資料"].Click += delegate
            {
                new JHSchool.TeacherExtendControls.Ribbon.TeacherExportWizard().ShowDialog();
            };

            rbItem["匯入"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["匯入"].Image = Properties.Resources.Import_Image;
            rbItem["匯入"]["匯入教師基本資料"].Enable = User.Acl["JHSchool.Teacher.Ribbon0030"].Executable;
            rbItem["匯入"]["匯入教師基本資料"].Click += delegate
            {
                new JHSchool.TeacherExtendControls.Ribbon.TeacherImportWizard().ShowDialog();
            };

            #endregion

            //報表,是以常態呈現
            rbItem["報表"].Size  = RibbonBarButton.MenuButtonSize.Large;
            rbItem["報表"].Image = Properties.Resources.paste_64;
            rbItem["報表"].SupposeHasChildern = true;

            #region RibbonBar 教師/指定
            rbItem = Teacher.Instance.RibbonBarItems["指定"];
            //rbItem["類別"].Image = InternalExtendControls.Tagging.Resources.ctxTag_Image;
            //rbItem["類別"].Size = RibbonBarButton.MenuButtonSize.Medium;
            //rbItem["類別"].SupposeHasChildern = true;
            //rbItem["類別"].PopupOpen += new EventHandler<PopupOpenEventArgs>(
            //    new TaggingMenu("JHSchool.Teacher.Ribbon0040", "JHSchool.Teacher.Ribbon0050").MenuOpen);

            //rbItem = Teacher.Instance.RibbonBarItems["指定"];
            //rbItem["授課"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["授課"].Image = TeacherExtendControls.Ribbon.Resources.btnAddTeacher_Image;
            //rbItem["授課"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 教師/統計報表
            //rbItem = Teacher.Instance.RibbonBarItems["統計報表"];
            //rbItem["報表"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["報表"].Image = TeacherExtendControls.Ribbon.Resources.btnReport_Image;
            //rbItem["報表"].Click += delegate
            //{

            //};
            #endregion

            #region RibbonBar 教師/其它
            //rbItem = Teacher.Instance.RibbonBarItems["其它"];
            //rbItem["修改歷程"].Size = RibbonBarButton.MenuButtonSize.Large;
            //rbItem["修改歷程"].Image = TeacherExtendControls.Ribbon.Resources.btnHistory_Image;
            //rbItem["修改歷程"].Click += delegate
            //{

            //};
            #endregion

            ListPaneField idField = new ListPaneField("ID");
            idField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = e.Key;
            };
            //this.AddListPaneField(idField);

            ListPaneField nameField = new ListPaneField("姓名");
            nameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].Name;
            };
            AddListPaneField(nameField);

            ListPaneField nicknameField = new ListPaneField("暱稱");
            nicknameField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].Nickname;
            };
            AddListPaneField(nicknameField);

            ListPaneField TeacherLoginName = new ListPaneField("登入帳號");
            TeacherLoginName.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].TALoginName;
            };
            AddListPaneField(TeacherLoginName);

            ListPaneField genderField = new ListPaneField("性別");
            genderField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].Gender;
            };
            AddListPaneField(genderField);


            ListPaneField superviseClassField = new ListPaneField("帶班班級");
            superviseClassField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                var superviseClass = "";
                foreach (var item in Class.Instance.GetTecaherSupervisedClass(Items[e.Key]))
                {
                    superviseClass += (superviseClass == "" ? "" : "、") + item.Name;
                }

                e.Value = superviseClass;
            };
            Teacher.Instance.AddListPaneField(superviseClassField);

            // 加入身分證號,聯絡電話的權限管理
            ListPaneField IDNumberField = new ListPaneField("身分證號");
            IDNumberField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].IDNumber;
            };
            if (User.Acl["Teacher.Field.身分證號"].Executable)
            {
                Present.AddListPaneField(IDNumberField);
            }

            Catalog ribbonField = RoleAclSource.Instance["教師"]["清單欄位"];
            ribbonField.Add(new RibbonFeature("Teacher.Field.身分證號", "身分證號"));

            ListPaneField telField = new ListPaneField("聯絡電話");
            telField.GetVariable += delegate(object sender, GetVariableEventArgs e)
            {
                e.Value = Items[e.Key].ContactPhone;
            };
            if (User.Acl["Teacher.Field.聯絡電話"].Executable)
            {
                Present.AddListPaneField(telField);
            }

            ribbonField = RoleAclSource.Instance["教師"]["清單欄位"];
            ribbonField.Add(new RibbonFeature("Teacher.Field.聯絡電話", "聯絡電話"));

            //Teacher.Instance.AddView(new JHSchool.TeacherExtendControls.SubjectView());
            Teacher.Instance.AddView(new JHSchool.TeacherExtendControls.SuperviseView());
            //Teacher.Instance.AddView(new JHSchool.TeacherExtendControls.CategoryView());
            Present.NavPaneContexMenu.GetChild("重新整理").Click += delegate { this.SyncAllBackground(); };

            // Teacher.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<TeacherExtendControls.BaseInfoItem>());

            #region 教師基本資料(20140502)
            ITeacherDatailtemAPI BaseItem = FISCA.InteractionService.DiscoverAPI <ITeacherDatailtemAPI>();
            if (BaseItem != null)
            {
                Teacher.Instance.AddDetailBulider(BaseItem.CreateBasicInfo());
            }
            else
            {
                Teacher.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.TeacherExtendControls.BaseInfoItem>());
            }
            #endregion


            // Teacher.Instance.AddDetailBulider(new ContentItemBulider<TeacherExtendControls.BaseInfoItem>());
//            Teacher.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<TeacherExtendControls.TeachStudentItem>());

            // 教師帶班班級
            Teacher.Instance.AddDetailBulider(new FISCA.Presentation.DetailBulider <JHSchool.TeacherExtendControls.TeachStudentItem>());

            //電子報表(因相關功能未完成先註)
            //Teacher.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider<TeacherExtendControls.ElectronicPaperPalmerworm>());
            Teacher.Instance.AddDetailBulider(new JHSchool.Legacy.ContentItemBulider <TeacherExtendControls.TeachCourseItem>());

            //K12.Teacher.Instance.AddView(new ShowAllStudentsView());
            //Teacher.Instance.RequiredDescription += delegate(object sender, RequiredDescriptionEventArgs e)
            //{
            //    var teacherRec = Teacher.Instance.Items[e.PrimaryKey];
            //    e.Result = teacherRec.Name + ( string.IsNullOrEmpty(teacherRec.Nickname) ? "" : "(" + teacherRec.Nickname + ")" );
            //};

            #region 教師篩選功能



            //private void CreateFilterItem(string name)
            //{
            //FilterMenu[name].AutoCheckOnClick = true;
            //FilterMenu[name].AutoCollapseOnClick = false;

            //FilterMenu[name].Checked = preference.GetBoolean(name, false);
            //FilterMenu[name].Click += delegate
            //{
            //    FillFilter();
            //    preference.SetBoolean(name, FilterMenu[name].Checked);

            //    preference.SaveAsync();
            //};
            //}

            #endregion

            #region 增加導師搜尋條件鈕

            ConfigData cd = User.Configuration["TeacherSearchOptionPreference"];

            SearchTeacherName = SearchConditionMenu["姓名"];
            SearchTeacherName.AutoCheckOnClick    = true;
            SearchTeacherName.AutoCollapseOnClick = false;
            SearchTeacherName.Checked             = cd.GetBoolean("SearchTeacherName", true);
            SearchTeacherName.Click += delegate
            {
                cd.SetBoolean("SearchTeacherName", SearchTeacherName.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchTeacherRefId = SearchConditionMenu["身分證號"];
            SearchTeacherRefId.AutoCheckOnClick    = true;
            SearchTeacherRefId.AutoCollapseOnClick = false;
            SearchTeacherRefId.Checked             = cd.GetBoolean("SearchTeacherRefId", true);
            SearchTeacherRefId.Click += delegate
            {
                cd.SetBoolean("SearchTeacherRefId", SearchTeacherRefId.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            SearchTeacherLoginID = SearchConditionMenu["登入帳號"];
            SearchTeacherLoginID.AutoCheckOnClick    = true;
            SearchTeacherLoginID.AutoCollapseOnClick = false;
            SearchTeacherLoginID.Checked             = cd.GetBoolean("SearchTeacherLoginID", true);
            SearchTeacherLoginID.Click += delegate
            {
                cd.SetBoolean("SearchTeacherLoginID", SearchTeacherLoginID.Checked);
                BackgroundWorker async = new BackgroundWorker();
                async.DoWork += delegate(object sender, DoWorkEventArgs e) { (e.Argument as ConfigData).Save(); };
                async.RunWorkerAsync(cd);
            };

            Present.Search += new EventHandler <SearchEventArgs>(Teacher_Search);



            #endregion

            //由類別模組提供
            //Present.SetDescriptionPaneBulider(new DescriptionPaneBulider<JHSchool.TeacherExtendControls.TeacherDescription>());

            #region 註冊權限管理
            Catalog ribbon = RoleAclSource.Instance["教師"]["功能按鈕"];
            ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0000", "新增教師資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0010", "刪除教師資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0020", "匯出教師資料"));
            ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0030", "匯入教師資料"));
            //ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0040", "指定教師類別"));
            //ribbon.Add(new RibbonFeature("JHSchool.Teacher.Ribbon0050", "管理教師類別清單"));

            Catalog detail = RoleAclSource.Instance["教師"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(TeacherExtendControls.BaseInfoItem)));
            detail.Add(new DetailItemFeature(typeof(TeacherExtendControls.TeachStudentItem)));
            //電子報表(因相關功能未完成先註)
            //detail.Add(new DetailItemFeature(typeof(TeacherExtendControls.ElectronicPaperPalmerworm)));
            detail.Add(new DetailItemFeature(typeof(TeacherExtendControls.TeachCourseItem)));
            #endregion

            // 建立篩選
            foreach (string each in AllStatus)
            {
                CreateFilterItem(each);
            }

            bool havedef = false;
            foreach (string each in AllStatus)
            {
                havedef |= FilterMenu[each].Checked;
            }

            if (!havedef)
            {
                FilterMenu["一般"].Checked = true;
            }


            MotherForm.AddPanel(K12.Presentation.NLDPanels.Teacher);
            _Initilized = true;
            UseFilter   = true;

            FillFilter();
        }
Ejemplo n.º 19
0
        private static void CreateListPaneFields()
        {
            CacheSync.Reset();
            Task task = Task.Factory.StartNew((x) =>
            {
                QueryHelper query = new QueryHelper();
                string cmd = @"
            select student.id,name,class_name,seat_no,student_number
            from student left join class on student.ref_class_id=class.id";

                DataTable dt = query.Select(cmd);
                CacheProvider.Student.Clear();
                foreach (DataRow row in dt.Rows)
                {
                    CacheProvider.Student.FillProperty(row["id"].ToString(), "Name", row["name"].ToString());
                    CacheProvider.Student.FillProperty(row["id"].ToString(), "ClassName", row["class_name"].ToString());
                    CacheProvider.Student.FillProperty(row["id"].ToString(), "SeatNo", row["seat_no"].ToString());
                    CacheProvider.Student.FillProperty(row["id"].ToString(), "StudentNumber", row["student_number"].ToString());
                }
            }, TaskScheduler.Default);

            task.ContinueWith((xx) =>
            {
                CacheSync.Set();

                NLDPanels.Student.CompareSource += (sender, e) =>
                {
                    string seatX = CacheProvider.Student[e.Value1].SeatNo;
                    string seatY = CacheProvider.Student[e.Value2].SeatNo;
                    int x, y;

                    if (!int.TryParse(seatX, out x))
                        x = 0;

                    if (!int.TryParse(seatY, out y))
                        y = 0;

                    e.Result = x.CompareTo(y);
                };

            }, TaskScheduler.FromCurrentSynchronizationContext());

            ListPaneField field = new ListPaneField("學生系統編號", false);
            NLDPanels.Student.AddListPaneField(field);
            field.GetVariable += (sender, e) => { e.Value = e.Key; };

            //班級
            field = new ListPaneField("系統編號");
            NLDPanels.Class.AddListPaneField(field);
            field.GetVariable += (sender, e) => { e.Value = e.Key; };

            //教師
            field = new ListPaneField("系統編號");
            NLDPanels.Teacher.AddListPaneField(field);
            field.GetVariable += (sender, e) => { e.Value = e.Key; };

            //課程
            field = new ListPaneField("系統編號");
            NLDPanels.Course.AddListPaneField(field);
            field.GetVariable += (sender, e) => { e.Value = e.Key; };

            //學生相關欄位。
            new ListPaneFields.Student_Name() { CacheProvider = CacheProvider.Student }.Register(NLDPanels.Student);
            new ListPaneFields.Student_Class() { CacheProvider = CacheProvider.Student }.Register(NLDPanels.Student);
            new ListPaneFields.Student_SeatNo() { CacheProvider = CacheProvider.Student }.Register(NLDPanels.Student);
            new ListPaneFields.Student_StudentNumber() { CacheProvider = CacheProvider.Student }.Register(NLDPanels.Student);
            new ListPaneFields.Student_Gender() { CacheProvider = CacheProvider.Student }.Register(NLDPanels.Student);

            ListPaneFields.Student_GraduationRequirement.Instance.Register(NLDPanels.Student);

            //new ListPaneFields.Student_GraduationRequirement().Register(NLDPanels.Student);

            //班級相關欄位。
            new ListPaneFields.Class_ClassName() { CacheProvider = CacheProvider.Class }.Register(NLDPanels.Class);

            //教師相關欄位。
            new ListPaneFields.Teacher_Name() { CacheProvider = CacheProvider.Teacher }.Register(NLDPanels.Teacher);

            //課程相關欄位。
            new ListPaneFields.Course_CourseName() { CacheProvider = CacheProvider.Course }.Register(NLDPanels.Course);
            new ListPaneFields.Course_ClassName() { CacheProvider = CacheProvider.Course }.Register(NLDPanels.Course);
            new ListPaneFields.Course_SerialNumber() { CacheProvider = CacheProvider.Course }.Register(NLDPanels.Course);
            //new ListPaneFields.Course_SubjectSemesterScoreInputRule() { CacheProvider = CacheProvider.Course }.Register(NLDPanels.Course);
            ListPaneFields.Course_SubjectSemesterScoreInputRule.Instance.Register(NLDPanels.Course);
        }