Exemple #1
0
        // 啟用國中
        private static void StartJHSchool()
        {
            // 註冊與載入自訂資料欄位


            // 註冊權限
            Catalog StudUserDefineDataFuncButtonRoleAcl = RoleAclSource.Instance["學生"]["功能按鈕"];

            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strSetUserDefineDataAcl, "設定自訂資料欄位樣版"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataExportAcl, "匯出自訂資料欄位"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataImportAcl, "匯入自訂資料欄位"));


            // 設定自訂資料欄位樣版

            K12.Presentation.NLDPanels.Student.AddDetailBulider(new FISCA.Presentation.DetailBulider <UserDefineDataItem>());
            Catalog detail = RoleAclSource.Instance["學生"]["資料項目"];

            detail.Add(new DetailItemFeature(typeof(UserDefineDataItem)));

            RibbonBarButton rbSetUserDefineData = K12.Presentation.NLDPanels.Student.RibbonBarItems["其它"]["自訂資料欄位管理"];

            rbSetUserDefineData.Image  = Properties.Resources.windows_save_64;
            rbSetUserDefineData.Enable = UserAcl.Current[strSetUserDefineDataAcl].Executable;
            rbSetUserDefineData.Click += delegate
            {
                SetUserDefineDataForm sudd = new SetUserDefineDataForm();
                sudd.ShowDialog();
            };



            // 匯出匯入自訂資料欄位
            MenuButton rbUserDefDataExport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯出"]["其它相關匯出"];
            MenuButton rbUserDefDataImport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯入"]["其它相關匯入"];

            // 匯出自訂資料欄位
            rbUserDefDataExport["匯出自訂資料欄位"].Enable = UserAcl.Current[strUserDefineDataExportAcl].Executable;
            rbUserDefDataExport["匯出自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter exporter = new ImportExport.ExportUserDefData();
                ImportExport.ExportStudentV2           wizard   = new ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            // 匯入自訂資料欄位
            rbUserDefDataImport["匯入自訂資料欄位"].Enable = UserAcl.Current[strUserDefineDataImportAcl].Executable;
            rbUserDefDataImport["匯入自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer importer = new ImportExport.ImportUserDefData();
                ImportExport.ImportStudentV2           wizard   = new ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };
        }
        // 啟用國中
        private static void StartJHSchool()
        {
            // 註冊與載入自訂資料欄位

            // 註冊權限
            Catalog StudUserDefineDataFuncButtonRoleAcl = RoleAclSource.Instance["教師"]["功能按鈕"];
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strSetUserDefineDataAcl , "設定自訂資料欄位樣版"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataExportAcl, "匯出自訂資料欄位"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataImportAcl, "匯入自訂資料欄位"));

            // 設定自訂資料欄位樣版
            //K12.Presentation.NLDPanels.Teacher.AddDetailBulider<UserDefineDataItem>();
            Catalog detail = RoleAclSource.Instance["教師"]["資料項目"];
            detail.Add(new DetailItemFeature(typeof(UserDefineDataItem)));
            if (UserAcl.Current[typeof(UserDefineDataItem)].Viewable)
                K12.Presentation.NLDPanels.Teacher.AddDetailBulider<UserDefineDataItem>();

            RibbonBarButton rbSetUserDefineData = MotherForm.RibbonBarItems["教師", "其它"]["自訂資料欄位管理"];
            rbSetUserDefineData.Image = Teacher_UserDefineData.Properties.Resources.windows_save_64;
            rbSetUserDefineData.Enable = FISCA.Permission.UserAcl.Current[strSetUserDefineDataAcl].Executable; //User.Acl[strSetUserDefineDataAcl].Executable;
            rbSetUserDefineData.Click += delegate
            {
                SetUserDefineDataForm sudd = new SetUserDefineDataForm();
                sudd.ShowDialog();
            };

            // 匯出匯入自訂資料欄位
            //MenuButton rbUserDefDataExport = Student.Instance.RibbonBarItems["資料統計"]["匯出"]["其它相關匯出"];
            //MenuButton rbUserDefDataImport = Student.Instance.RibbonBarItems["資料統計"]["匯入"]["其它相關匯入"];
            MenuButton rbUserDefDataExport = MotherForm.RibbonBarItems["教師", "資料統計"]["匯出"]["其它相關匯出"];
            MotherForm.RibbonBarItems["教師", "資料統計"]["匯出"].Image = Teacher_UserDefineData.Properties.Resources.Export_Image;
            MotherForm.RibbonBarItems["教師", "資料統計"]["匯出"].Size = RibbonBarButton.MenuButtonSize.Large;

            MenuButton rbUserDefDataImport = MotherForm.RibbonBarItems["教師", "資料統計"]["匯入"]["其它相關匯入"];
            MotherForm.RibbonBarItems["教師", "資料統計"]["匯入"].Image = Teacher_UserDefineData.Properties.Resources.Import_Image;
            MotherForm.RibbonBarItems["教師", "資料統計"]["匯入"].Size = RibbonBarButton.MenuButtonSize.Large;

                // 匯出自訂資料欄位
            rbUserDefDataExport["匯出自訂資料欄位"].Enable = FISCA.Permission.UserAcl.Current[strUserDefineDataExportAcl].Executable;
            rbUserDefDataExport["匯出自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter exporter = new ImportExport.ExportUserDefData ();
                ImportExport.ExportStudentV2 wizard = new ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            // 匯入自訂資料欄位
            rbUserDefDataImport["匯入自訂資料欄位"].Enable = FISCA.Permission.UserAcl.Current[strUserDefineDataImportAcl].Executable;
            rbUserDefDataImport["匯入自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer importer = new ImportExport.ImportUserDefData();
                ImportExport.ImportStudentV2 wizard = new ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };
        }
Exemple #3
0
        public static void Main()
        {
            // 設定權限字串
            string strSetUserDefineDataAcl    = "Student.ischool_UserDefineData_SetUserDefineDataForm";
            string strUserDefineDataImportAcl = "Student.ischool_UserDefineData_Import";
            string strUserDefineDataExportAcl = "Student.ischool_UserDefineData_Export";


            // 載入設定
            Global.StartDefaultValue();

            // 加入合理性檢查
            // 自訂欄位資料欄位重複
            try
            {
                DataRationalityManager.Checks.Add(new DoubleUserDefDataRAT());
            }
            catch (Exception ex)
            {
                FISCA.Presentation.Controls.MsgBox.Show("自訂資料欄位合理性檢查" + ex.Message);
            }

            // 註冊權限
            Catalog StudUserDefineDataFuncButtonRoleAcl = RoleAclSource.Instance["學生"]["功能按鈕"];

            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strSetUserDefineDataAcl, "設定自訂資料欄位樣版"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataExportAcl, "匯出自訂資料欄位"));
            StudUserDefineDataFuncButtonRoleAcl.Add(new RibbonFeature(strUserDefineDataImportAcl, "匯入自訂資料欄位"));


            // 設定自訂資料欄位樣版
            if (FISCA.Permission.UserAcl.Current[Global.自訂資料欄位功能代碼].Editable || FISCA.Permission.UserAcl.Current[Global.自訂資料欄位功能代碼].Viewable)
            {
                K12.Presentation.NLDPanels.Student.AddDetailBulider(new FISCA.Presentation.DetailBulider <UserDefineDataItem>());
            }

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

            detail.Add(new DetailItemFeature(typeof(UserDefineDataItem)));

            RibbonBarButton rbSetUserDefineData = K12.Presentation.NLDPanels.Student.RibbonBarItems["其它"]["自訂資料欄位管理"];

            rbSetUserDefineData.Image  = Properties.Resources.windows_save_64;
            rbSetUserDefineData.Enable = UserAcl.Current[strSetUserDefineDataAcl].Executable;
            rbSetUserDefineData.Click += delegate
            {
                SetUserDefineDataForm sudd = new SetUserDefineDataForm();
                sudd.ShowDialog();
            };


            // 匯出匯入自訂資料欄位
            MenuButton rbUserDefDataExport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯出"]["其它相關匯出"];
            MenuButton rbUserDefDataImport = K12.Presentation.NLDPanels.Student.RibbonBarItems["資料統計"]["匯入"]["其它相關匯入"];

            // 匯出自訂資料欄位
            rbUserDefDataExport["匯出自訂資料欄位"].Enable = UserAcl.Current[strUserDefineDataExportAcl].Executable;
            rbUserDefDataExport["匯出自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Export.Exporter exporter = new ImportExport.ExportUserDefData();
                ImportExport.ExportStudentV2           wizard   = new ImportExport.ExportStudentV2(exporter.Text, exporter.Image);
                exporter.InitializeExport(wizard);
                wizard.ShowDialog();
            };

            // 匯入自訂資料欄位
            rbUserDefDataImport["匯入自訂資料欄位"].Enable = UserAcl.Current[strUserDefineDataImportAcl].Executable;
            rbUserDefDataImport["匯入自訂資料欄位"].Click += delegate
            {
                SmartSchool.API.PlugIn.Import.Importer importer = new ImportExport.ImportUserDefData();
                ImportExport.ImportStudentV2           wizard   = new ImportExport.ImportStudentV2(importer.Text, importer.Image);
                importer.InitializeImport(wizard);
                wizard.ShowDialog();
            };
        }