Esempio n. 1
0
        static public void Main2()
        {
            //處理學生資料
            ResStudentData();
            //處理教師資料
            ResTeacherData();

            //批次修改入學及畢業日期
            FISCA.Presentation.MenuButton btnOrder = FISCA.Presentation.MotherForm.RibbonBarItems["學生", "指定"]["批次修改入學及畢業日期"];
            btnOrder.Enable = false;
            btnOrder.Image  = Properties.Resources.record_b_write_64;
            btnOrder.Click += delegate
            {
                new BasicInformation.Student.SchoolYearEditor().ShowDialog();
            };

            K12.Presentation.NLDPanels.Student.SelectedSourceChanged += delegate
            {
                btnOrder.Enable = Permissions.批次修改入學及畢業日期_雙語部權限 && K12.Presentation.NLDPanels.Student.SelectedSource.Count > 0;
            };

            //雙語部 - 班級名條 & 班級點名單
            FISCA.Presentation.MenuButton btnC = FISCA.Presentation.MotherForm.RibbonBarItems["班級", "資料統計"]["報表"]["學務相關報表"];
            btnC["班級點名表(雙語部)"].Enable = Permissions.班級點名單_雙語部權限;
            btnC["班級點名表(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count > 0)
                {
                    new TempletChooseForm().ShowDialog();
                }
                else
                {
                    MsgBox.Show("請選擇班級!!");
                }
            };

            btnC["缺曠週報表_依假別(雙語部)"].Enable = Permissions.缺曠週報表_依假別_雙語部權限;
            btnC["缺曠週報表_依假別(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count > 0)
                {
                    new Report().Print();
                }
                else
                {
                    MsgBox.Show("請選擇班級!!");
                }
            };

            //班級
            btnC["缺曠通知單(雙語部)"].Enable = Permissions.班級缺曠通知單_雙語部權限;
            btnC["缺曠通知單(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count > 0)
                {
                    new AbsenceNotification.Report("class").Print();
                }
                else
                {
                    MsgBox.Show("請選擇班級!!");
                }
            };

            btnC["獎懲通知單(雙語部)"].Enable = Permissions.班級獎懲通知單_雙語部權限;
            btnC["獎懲通知單(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Class.SelectedSource.Count > 0)
                {
                    new DisciplineNotification.Report("class").Print();
                }
                else
                {
                    MsgBox.Show("請選擇班級!!");
                }
            };

            FISCA.Presentation.MenuButton btnS = FISCA.Presentation.MotherForm.RibbonBarItems["學生", "資料統計"]["報表"]["學務相關報表"];

            //學生
            btnS["缺曠通知單(雙語部)"].Enable = Permissions.學生缺曠通知單_雙語部權限;
            btnS["缺曠通知單(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Student.SelectedSource.Count > 0)
                {
                    new AbsenceNotification.Report("student").Print();
                }
                else
                {
                    MsgBox.Show("請選擇學生!!");
                }
            };

            //學生
            btnS["獎懲通知單(雙語部)"].Enable = Permissions.學生獎懲通知單_雙語部權限;
            btnS["獎懲通知單(雙語部)"].Click += delegate
            {
                if (K12.Presentation.NLDPanels.Student.SelectedSource.Count > 0)
                {
                    new DisciplineNotification.Report("student").Print();
                }
                else
                {
                    MsgBox.Show("請選擇學生!!");
                }
            };

            RibbonBarButton rbItemImport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯入"];
            RibbonBarButton rbItemExport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯出"];

            //rbItemExport["學籍相關匯出"]["匯出學生基本資料(雙語部)"].Enable = Permissions.匯出學生基本資料_雙語部權限;
            //rbItemExport["學籍相關匯出"]["匯出學生基本資料(雙語部)"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Export.Exporter exporter = new ExportSchoolObject();
            //    ExportStudentV2 wizard = new ExportStudentV2(exporter.Text, exporter.Image);
            //    exporter.InitializeExport(wizard);
            //    wizard.ShowDialog();
            //};

            //rbItemImport["學籍相關匯入"]["匯入學生基本資料(雙語部)"].Enable = Permissions.匯入學生基本資料_雙語部權限;
            //rbItemImport["學籍相關匯入"]["匯入學生基本資料(雙語部)"].Click += delegate
            //{
            //    SmartSchool.API.PlugIn.Import.Importer importer = new ImportSchoolObject();
            //    ImportStudentV2 wizard = new ImportStudentV2(importer.Text, importer.Image);
            //    importer.InitializeImport(wizard);
            //    wizard.ShowDialog();
            //};

            rbItemExport["學籍相關匯出"]["匯出學生基本資料(2015)"].Enable = Permissions.匯出學生基本資料New_雙語部權限;
            rbItemExport["學籍相關匯出"]["匯出學生基本資料(2015)"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter exporter = new ExportStudentData();
                ExportStudentV2 wizard = new ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            rbItemImport["學籍相關匯入"]["匯入學生基本資料(2015)"].Enable = Permissions.匯入學生基本資料New_雙語部權限;
            rbItemImport["學籍相關匯入"]["匯入學生基本資料(2015)"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer importer = new ImportStudentData();
                ImportStudentV2 wizard = new ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };


            FISCA.Presentation.RibbonBarButton btnSDAdmin = FISCA.Presentation.MotherForm.RibbonBarItems["學務作業", "資料統計"]["報表"];
            //學務作業
            btnSDAdmin.Size = RibbonBarButton.MenuButtonSize.Large;
            btnSDAdmin["獎懲公告單(雙語部)"].Enable = Permissions.獎懲公告單_雙語部權限;
            btnSDAdmin["獎懲公告單(雙語部)"].Click += delegate
            {
                new AnnouncementSingle().ShowDialog();
            };

            FISCA.Permission.Catalog TestCatalog1 = FISCA.Permission.RoleAclSource.Instance["班級"]["報表"];
            TestCatalog1.Add(new FISCA.Permission.RibbonFeature(Permissions.班級點名單_雙語部, "班級點名表(雙語部)"));
            TestCatalog1.Add(new FISCA.Permission.RibbonFeature(Permissions.班級缺曠通知單_雙語部, "缺曠通知單(雙語部)"));
            TestCatalog1.Add(new FISCA.Permission.RibbonFeature(Permissions.班級獎懲通知單_雙語部, "獎懲通知單(雙語部)"));
            TestCatalog1.Add(new FISCA.Permission.RibbonFeature(Permissions.缺曠週報表_依假別_雙語部, "缺曠週報表_依假別(雙語部)"));

            FISCA.Permission.Catalog TestCatalog2 = FISCA.Permission.RoleAclSource.Instance["學生"]["報表"];
            TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.學生缺曠通知單_雙語部, "缺曠通知單(雙語部)"));
            TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.學生獎懲通知單_雙語部, "獎懲通知單(雙語部)"));

            FISCA.Permission.Catalog TestCatalog3 = FISCA.Permission.RoleAclSource.Instance["學務作業"]["報表"];
            TestCatalog3.Add(new FISCA.Permission.RibbonFeature(Permissions.獎懲公告單_雙語部, "獎懲公告單(雙語部)"));

            FISCA.Permission.Catalog TestCatalog4 = FISCA.Permission.RoleAclSource.Instance["學生"]["功能按鈕"];
            TestCatalog4.Add(new FISCA.Permission.RibbonFeature(Permissions.批次修改入學及畢業日期_雙語部, "批次修改入學及畢業日期"));

            //TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.匯出學生基本資料_雙語部, "匯出學生基本資料(雙語部)"));
            //TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.匯入學生基本資料_雙語部, "匯入學生基本資料(雙語部)"));
            TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.匯出學生基本資料New_雙語部, "匯出學生基本資料(2015)"));
            TestCatalog2.Add(new FISCA.Permission.RibbonFeature(Permissions.匯入學生基本資料New_雙語部, "匯入學生基本資料(2015)"));
        }
Esempio n. 2
0
        public static void Main()
        {
            // 檢查UDT是否存在
            CheckUDTExist();

            #region 自訂驗證規則

            FactoryProvider.RowFactory.Add(new ValidationRule.FitnessRowValidatorFactory());

            #endregion

            // 把"體適能資料"加入資料項目
            if (FISCA.Permission.UserAcl.Current[Permissions.KeyFitnessContent].Editable || FISCA.Permission.UserAcl.Current[Permissions.KeyFitnessContent].Viewable)
            {
                K12.Presentation.NLDPanels.Student.AddDetailBulider <DetailContents.StudentFitnessContent>();
            }
            // 2018.09.22 [ischoolKingdom] Vicky依據 [J學務][01] 體適能功能重覆整理、UI調整 項目,將體適能()的"()"去除,統一命名為體適能。
            RibbonBarItem FitnessBar = NLDPanels.Student.RibbonBarItems["體適能"];


            // 加入"匯出"按鈕以及圖示
            FitnessBar["匯出"].Image = Properties.Resources.Export_Image;
            FitnessBar["匯出"].Size  = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;

            // 加入"匯出"按鈕以及圖示
            FitnessBar["匯入"].Image = Properties.Resources.Import_Image;
            FitnessBar["匯入"].Size  = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;

            FitnessBar["報表"].Image = Properties.Resources.paste_64;
            FitnessBar["報表"].Size  = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;

            FitnessBar["常模轉換"].Image  = Properties.Resources.amplify_wave_64;
            FitnessBar["常模轉換"].Size   = FISCA.Presentation.RibbonBarButton.MenuButtonSize.Large;
            FitnessBar["常模轉換"].Enable = false;
            FitnessBar["常模轉換"].Click += delegate
            {
                ComparisonForm cf = new ComparisonForm();
                cf.ShowDialog();
            };

            // 加入"匯出體適能"按鈕
            FISCA.Presentation.MenuButton btnExport2 = FitnessBar["匯出"]["匯出體適能上傳檔"];
            // 設定權限
            btnExport2.Enable = false;
            // 設定動作
            btnExport2.Click += delegate
            {
                if (NLDPanels.Student.SelectedSource.Count > 0)
                {
                    ImportExport.FrmFitnessExportBaseForm frm = new ImportExport.FrmFitnessExportBaseForm();
                    frm.ShowDialog();
                }
                else
                {
                    FISCA.Presentation.Controls.MsgBox.Show("請先選擇學生!");
                }
            };

            // 加入"匯入體適能"按鈕
            FISCA.Presentation.MenuButton btnImport = FitnessBar["匯入"]["匯入體適能上傳檔"];
            // 設定權限
            btnImport.Enable = Permissions.IsEnableFitnessImport;
            // 設定動作
            btnImport.Click += delegate
            {
                MsgBox.Show("說明:\n1.匯入檔案必須將說明內容(1行~15行)刪除.\n(只需保留標題以下內容)\n2.必須手動增加學年度欄位\n3.匯入功能之鍵值為[身分證字號+學年度]");
                // 準備所有一般生的學生ID, 之後驗證資料時會用到
                Global._AllStudentIDNumberIDTemp = DAO.FDQuery.GetAllIDNumberDict();

                ImportExport.ImportStudentFitness frmImport = new ImportExport.ImportStudentFitness();
                frmImport.Execute();
            };

            FISCA.Presentation.MenuButton btnReport = FitnessBar["報表"]["體適能證明單"];
            btnReport.Enable = false;
            btnReport.Click += delegate
            {
                if (NLDPanels.Student.SelectedSource.Count > 0)
                {
                    FitnessProveSingle fps = new FitnessProveSingle();
                    fps.ShowDialog();
                }
                else
                {
                    FISCA.Presentation.Controls.MsgBox.Show("請先選擇學生!");
                }
            };



            //2016/6/2 穎驊新增
            //2016/8/3 因應繼斌要求 將"班級體適能通知單" 更名為 "班級體適能確認單"
            FISCA.Presentation.MenuButton ClassFitnessInformReport = K12.Presentation.NLDPanels.Class.RibbonBarItems["資料統計"]["報表"]["學務相關報表"];
            ClassFitnessInformReport["班級體適能確認單"].Enable = false;
            ClassFitnessInformReport["班級體適能確認單"].Click += delegate
            {
                if (NLDPanels.Class.SelectedSource.Count > 0)
                {
                    ClassFitnessInformReport CFIR = new ClassFitnessInformReport();
                    CFIR.ShowDialog();
                }
                else
                {
                    FISCA.Presentation.Controls.MsgBox.Show("請先選擇班級!");
                }
            };



            //2016/7/7 穎驊新增,恩正說把"全校體適能統計百分比報表"功能放在學務作業裡面
            FISCA.Presentation.MenuButton SchoolFitnessStatisticsReport = MotherForm.RibbonBarItems["學務作業", "資料統計"]["報表"]["全校體適能統計百分比報表"];

            SchoolFitnessStatisticsReport.Enable = Permissions.IsEnableSchoolFitnessStatisticsReport;

            SchoolFitnessStatisticsReport.Click += delegate
            {
                SchoolFitnessStatisticsReport SFSR = new SchoolFitnessStatisticsReport();
                SFSR.ShowDialog();
            };


            NLDPanels.Student.SelectedSourceChanged += delegate
            {
                bool check = NLDPanels.Student.SelectedSource.Count > 0;


                //體適能證明單
                btnReport.Enable = check && Permissions.IsEnableFitnessProveSingle;

                //匯出體適能
                btnExport2.Enable = check && Permissions.IsEnableFitnessExport;



                FitnessBar["常模轉換"].Enable = check && Permissions.體適能常模轉換權限;
            };


            //2016/6/2 穎驊新增
            //2016/8/3 因應繼斌要求 將"班級體適能通知單" 更名為 "班級體適能確認單"
            NLDPanels.Class.SelectedSourceChanged += delegate
            {
                bool check = NLDPanels.Class.SelectedSource.Count > 0;

                ClassFitnessInformReport["班級體適能確認單"].Enable = check && Permissions.IsEnableClassFitnessInformReport;
            };


            string 體適能證明單 = "ischool/國中系統/學生/報表/體適能/體適能證明單";
            FISCA.Features.Register(體適能證明單, arg =>
            {
                FitnessProveSingle fps = new FitnessProveSingle();
                fps.ShowDialog();
            });

            // 在權限畫面出現"體適能資料項目"權限
            Catalog catalog1 = RoleAclSource.Instance["學生"]["資料項目"];
            catalog1.Add(new DetailItemFeature(Permissions.KeyFitnessContent, "體適能"));

            // 在權限畫面出現"匯出體適能"權限
            Catalog catalog2 = RoleAclSource.Instance["學生"]["功能按鈕"];
            catalog2.Add(new RibbonFeature(Permissions.KeyFitnessExport, "匯出體適能"));

            // 在權限畫面出現"匯入體適能"權限
            Catalog catalog3 = RoleAclSource.Instance["學生"]["功能按鈕"];
            catalog3.Add(new RibbonFeature(Permissions.KeyFitnessImport, "匯入體適能"));

            // 在權限畫面出現"匯出體適能"權限
            Catalog catalog4 = RoleAclSource.Instance["學生"]["報表"];
            catalog4.Add(new RibbonFeature(Permissions.KeyFitnessProveSingle, "體適能證明單"));

            // 在權限畫面出現"常模轉換"權限
            Catalog catalog5 = RoleAclSource.Instance["學生"]["功能按鈕"];
            catalog5.Add(new RibbonFeature(Permissions.體適能常模轉換, "常模轉換"));


            // 2016//6/2 穎驊新增 , 在權限畫面出現"班級體適能通知單"權限
            //2016/8/3 因應繼斌要求 將"班級體適能通知單" 更名為 "班級體適能確認單"
            Catalog catalog6 = RoleAclSource.Instance["班級"]["報表"];
            catalog6.Add(new RibbonFeature(Permissions.KeyClassFitnessInformReport, "班級體適能確認單"));


            // 2016//7/7 穎驊新增 , 在權限畫面出現"全校體適能統計百分比報表"權限(而且是在學務作業)
            Catalog catalog7 = RoleAclSource.Instance["學務作業"]["功能按鈕"];
            catalog7.Add(new RibbonFeature(Permissions.KeySchoolFitnessStatisticsReport, "全校體適能統計百分比報表"));
        }