Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DoubleCheck();
            bool valid = true;

            foreach (Control control in Controls)
            {
                if (_errorProvider.GetError(control) != string.Empty)
                {
                    valid = false;
                }
            }
            if (!valid)
            {
                MsgBox.Show("密碼資料有誤,請先修正後再行儲存!");
                return;
            }

            try
            {
                //計算密碼雜~!
                ChangePassword(PasswordHash.Compute(txtPassword.Text));
            }
            catch (Exception ex)
            {
                MsgBox.Show("密碼變更失敗 :" + ex.Message);
                return;
            }
            string accesspoint = FISCA.Authentication.DSAServices.AccessPoint;
            string username    = FISCA.Authentication.DSAServices.UserAccount;

            //string accesspoint = CurrentUser.Instance.AccessPoint;
            //string username = CurrentUser.Instance.UserName;
            try
            {
                //CurrentUser.Instance.SetConnection(accesspoint, username, txtPassword.Text);
                //CurrentUser.Instance.SetConnection(accesspoint, username, txtPassword.Text);
            }
            catch (Exception ex)
            {
                MsgBox.Show("重新建立連線失敗 : " + ex.Message);
                return;
            }
            MsgBox.Show("密碼變更完成!");
            PermRecLogProcess prlp = new PermRecLogProcess();

            prlp.SaveLog("核心", "修改", "修改使用者帳號密碼.");
            this.Close();
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            SchoolInfoEnt.ChineseAddress = txtSchoolChsAddress.Text;
            SchoolInfoEnt.ChinsesName    = txtSchoolChsName.Text;
            SchoolInfoEnt.Code           = txtSchoolCode.Text; //學校代碼

            SchoolInfoEnt.Telephone      = txtPhone.Text;
            SchoolInfoEnt.EnglishAddress = txtSchoolEngAddess.Text;
            SchoolInfoEnt.EnglishName    = txtSchoolEngName.Text;
            SchoolInfoEnt.Fax            = txtFax.Text;
            SchoolInfoEnt.SchoolYear     = intSchoolYear.Text;
            SchoolInfoEnt.Semester       = intSemester.Text;

            SchoolInfoEnt.ChancellorChsName   = txtChancellorChsName.Text;
            SchoolInfoEnt.ChancellorEngName   = txtChancellorEngName.Text;
            SchoolInfoEnt.ChancellorCellPhone = txtChancellorCellPhone.Text;
            SchoolInfoEnt.ChancellorEmail     = txtChancellorEmail.Text;

            SchoolInfoEnt.EduDirectorName      = txtEduDirectorName.Text;
            SchoolInfoEnt.EduDirectorCellPhone = txtEduDirectorCellPhone.Text;
            SchoolInfoEnt.EduDirectorEmail     = txtEduDirectorEmail.Text;

            SchoolInfoEnt.StuDirectorName      = txtStuDirectorName.Text;
            SchoolInfoEnt.StuDirectorCellPhone = txtStuDirectorCellPhone.Text;
            SchoolInfoEnt.StuDirectorEmail     = txtStuDirectorEmail.Text;

            SchoolInfoEnt.AssociatedWithName      = txtAssociatedWithName.Text;
            SchoolInfoEnt.AssociatedWithCellPhone = txtAssociatedWithCellPhone.Text;
            SchoolInfoEnt.AssociatedWithEmail     = txtAssociatedWithEmail.Text;

            SchoolInfoEnt.OtherTitle     = txtOtherTitle.Text;
            SchoolInfoEnt.OtherName      = txtOtherName.Text;
            SchoolInfoEnt.OtherCellPhone = txtOtherCellPhone.Text;
            SchoolInfoEnt.OtherEmail     = txtOtherEmail.Text;


            setSchoolInfoData(SchoolInfoEnt);
            MessageBox.Show("資料儲存完成");
            PermRecLogProcess prlp = new PermRecLogProcess();

            prlp.SaveLog("核心", "修改", "修改學校基本資料.");
            this.Close();
        }
Esempio n. 3
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();
        }
Esempio n. 4
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();
        }
Esempio n. 5
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();
        }