Exemple #1
0
        public static void Main()
        {
            FISCA.Permission.RoleAclSource.Instance.Root.SubCatalogs["明德外掛系統"]["校車模組"].Add(new FISCA.Permission.ReportFeature("MdhsBus", "校車模組"));
            FISCA.Permission.RoleAclSource.Instance.Root.SubCatalogs["明德外掛系統"]["校車模組"].Add(new FISCA.Permission.DetailItemFeature("MdhsBusView", "校車明細"));
            if (!FISCA.Permission.UserAcl.Current["MdhsBus"].Executable) return;

            //建立或引用 『總務作業』 頁簽下的 RibbonBarItem『校車』
            FISCA.Presentation.RibbonBarItem rbItem = FISCA.Presentation.MotherForm.RibbonBarItems["總務作業", "校車作業"];
            FISCA.Presentation.RibbonBarItem rbItem01 = FISCA.Presentation.MotherForm.RibbonBarItems["新生", "報表及統計"];
            FISCA.Presentation.RibbonBarItem rbItem02 = FISCA.Presentation.MotherForm.RibbonBarItems["總務作業", "校車收費"];
            RibbonBarItem StudentReports = K12.Presentation.NLDPanels.Student.RibbonBarItems["統計報表"];

            //建立或引用 RibbonBarItem『校車』裡的按鈕 『班級學生資料』

            //建立或引用 RibbonBarItem『校車』裡的按鈕 『未銷假學生』
            //FISCA.Presentation.RibbonBarButton rbBtnAssign = rbItem["校車未銷假學生"];
            //rbBtnAssign.Click += new EventHandler(rbBtnQuery_Click);

            if (CurrentUser.Acl["MdhsBus"].Executable)
            {
                Catalog ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"];

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車設定"];
                ribbon.Add(new ReportFeature("NewMdhsBusStopSetup", "校車路線站名維護-新"));
                MenuButton rbi36 = rbItem["校車設定"]["校車路線站名維護-新"];
                rbi36.Enable = CurrentUser.Acl["NewMdhsBusStopSetup"].Executable;
                rbi36.Click += delegate
                {
                    AssignBusNew frm = new AssignBusNew();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車設定"];
                ribbon.Add(new ReportFeature("MdhsBusStopSetup", "校車路線站名維護"));
                MenuButton rbi30 = rbItem["校車設定"]["校車路線站名維護"];
                rbi30.Enable = CurrentUser.Acl["MdhsBusStopSetup"].Executable;
                //FISCA.Presentation.RibbonBarButton rbBtnAdd = rbItem["校車路線站名維護"];
                rbi30.Click += new EventHandler(rbBtnAssign_Click);

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["匯入及匯出"];
                ribbon.Add(new ReportFeature("MdhsBusImport", "匯入校車路線站名資料"));
                MenuButton rbi01 = rbItem["匯入及匯出"]["匯入"]["匯入校車路線站名資料"];
                rbi01.Enable = CurrentUser.Acl["MdhsBusImport"].Executable;
                rbi01.Click += delegate
                {
                    ImportLibrary.PowerfulImportWizard wizardBusStop = new ImportLibrary.PowerfulImportWizard("匯入校車路線站名資料", null);
                    ImportLibrary.IPowerfulImportWizard iWizardBusStop = wizardBusStop;

                    List<Data.BusStop> _Source = new List<Data.BusStop>();
                    AccessHelper udtHelper = new AccessHelper();
                    _Source = udtHelper.Select<Data.BusStop>();
                    校車站名資料庫.Clear();
                    foreach (Data.BusStop var in _Source)
                    {
                        if (!校車站名資料庫.ContainsKey(var.BusTimeName))
                            校車站名資料庫.Add(var.BusTimeName, new Dictionary<string, Data.BusStop>());
                        if (!校車站名資料庫[var.BusTimeName].ContainsKey(var.BusStopID))
                            校車站名資料庫[var.BusTimeName].Add(var.BusStopID, var);
                        if (!檢查校車站名資料庫.ContainsKey(var.UID))
                            檢查校車站名資料庫.Add(var.UID, var);
                    }

                    iWizardBusStop.RequiredFields.AddRange("校車時段", "代碼");
                    iWizardBusStop.ImportableFields.AddRange("站名", "月費", "車號", "站序", "停車地址", "到站時間", "放學上車地點");
                    iWizardBusStop.IdentifyRow += new EventHandler<ImportLibrary.IdentifyRowEventArgs>(iWizardBusStop_IdentifyRow);
                    iWizardBusStop.ValidateRow += new EventHandler<ImportLibrary.ValidateRowEventArgs>(iWizardBusStop_ValidateRow);
                    iWizardBusStop.ImportStart += new EventHandler(iWizardBusStop_ImportStart);
                    iWizardBusStop.ImportPackage += new EventHandler<ImportLibrary.ImportPackageEventArgs>(iWizardBusStop_ImportPackage);
                    wizardBusStop.ShowDialog();
                };

                ribbon.Add(new ReportFeature("MdhsBusStudentImport", "匯入校車學生乘車資料"));
                MenuButton rbi02 = rbItem["匯入及匯出"]["匯入"]["匯入校車學生乘車資料"];
                rbi02.Enable = CurrentUser.Acl["MdhsBusStudentImport"].Executable;
                rbi02.Click += delegate
                {
                    ImportLibrary.PowerfulImportWizard wizardBusStudent = new ImportLibrary.PowerfulImportWizard("匯入校車學生乘車資料", null);
                    ImportLibrary.IPowerfulImportWizard iWizardBusStudent = wizardBusStudent;

                    List<Data.BusStop> _BusSource = Data.BusStopDAO.GetSortByBusNumberList();
                    //List<string> bustimes = new List<string>();
                    AccessHelper udtHelper = new AccessHelper();
                    List<Data.BusSetup> _Source = Data.BusSetupDAO.GetSortByBusStartDateList();
                    List<Data.StudentByBus> _StudentSource = udtHelper.Select<Data.StudentByBus>();
                    校車站名資料庫.Clear();
                    foreach (Data.BusStop var in _BusSource)
                    {
                        if (!校車站名資料庫.ContainsKey(var.BusTimeName))
                            校車站名資料庫.Add(var.BusTimeName, new Dictionary<string, Data.BusStop>());
                        if (!校車站名資料庫[var.BusTimeName].ContainsKey(var.BusStopID))
                            校車站名資料庫[var.BusTimeName].Add(var.BusStopID, var);
                    }
                    校車時間紀錄資料庫.Clear();
                    foreach (Data.BusSetup var in _Source)
                    {
                        if (!校車時間紀錄資料庫.ContainsKey(var.BusYear.ToString()))
                            校車時間紀錄資料庫.Add(var.BusYear.ToString(), new Dictionary<string, Data.BusSetup>());
                        if (!校車時間紀錄資料庫[var.BusYear.ToString()].ContainsKey(var.BusRangeName))
                            校車時間紀錄資料庫[var.BusYear.ToString()].Add(var.BusRangeName, var);
                    }
                    學生搭車紀錄資料庫.Clear();
                    foreach (Data.StudentByBus var in _StudentSource)
                    {
                        if (!學生搭車紀錄資料庫.ContainsKey(var.StudentID))
                            學生搭車紀錄資料庫.Add(var.StudentID, new Dictionary<string, MdhsBus.Data.StudentByBus>());
                        if (!學生搭車紀錄資料庫[var.StudentID].ContainsKey(var.SchoolYear.ToString() + var.BusRangeName))
                            學生搭車紀錄資料庫[var.StudentID].Add(var.SchoolYear.ToString() + var.BusRangeName, var);
                    }
                    學生資料庫.Clear();
                    List<StudentRecord> students = K12.Data.Student.SelectAll();
                    foreach (StudentRecord var in students)
                    {
                        if (var.Status.ToString() != "一般")
                            continue;
                        if (!學生資料庫.ContainsKey(var.StudentNumber))
                            學生資料庫.Add(var.StudentNumber, var);
                    }

                    班級資料庫.Clear();
                    List<ClassRecord> classes = K12.Data.Class.SelectAll();
                    foreach (ClassRecord var in classes)
                    {
                        if (var.GradeYear == null)
                            continue;
                        else if (var.GradeYear > 3)
                            continue;
                        else if (var.Name.IndexOf("夜輔") >= 0 || var.Name.IndexOf("轉學") >= 0 || var.Name.IndexOf("選修") >= 0)
                            continue;
                        if (!班級資料庫.ContainsKey(var.Name))
                            班級資料庫.Add(var.Name, var);
                    }

                    iWizardBusStudent.RequiredFields.AddRange("搭車年度", "校車時段", "期間名稱", "代碼", "班級", "學號");
                    iWizardBusStudent.ImportableFields.AddRange("天數", "車費", "是否繳費", "繳費日期", "備註");
                    iWizardBusStudent.IdentifyRow += new EventHandler<ImportLibrary.IdentifyRowEventArgs>(iWizardBusStudent_IdentifyRow);
                    iWizardBusStudent.ValidateRow += new EventHandler<ImportLibrary.ValidateRowEventArgs>(iWizardBusStudent_ValidateRow);
                    iWizardBusStudent.ImportStart += new EventHandler(iWizardBusStudent_ImportStart);
                    iWizardBusStudent.ImportPackage += new EventHandler<ImportLibrary.ImportPackageEventArgs>(iWizardBusStudent_ImportPackage);
                    wizardBusStudent.ShowDialog();
                };

                ribbon.Add(new ReportFeature("MdhsBusNewStudentImport", "匯入校車新生乘車資料"));
                MenuButton rbi03 = rbItem["匯入及匯出"]["匯入"]["匯入校車新生乘車資料"];
                rbi03.Enable = CurrentUser.Acl["MdhsBusNewStudentImport"].Executable;
                rbi03.Click += delegate
                {
                    ImportLibrary.PowerfulImportWizard wizardBusNewStudent = new ImportLibrary.PowerfulImportWizard("匯入校車新生乘車資料", null);
                    ImportLibrary.IPowerfulImportWizard iWizardBusNewStudent = wizardBusNewStudent;

                    List<Data.BusStop> _BusSource = Data.BusStopDAO.GetSortByBusNumberList();
                    //List<string> bustimes = new List<string>();
                    AccessHelper udtHelper = new AccessHelper();
                    List<Data.BusSetup> _Source = Data.BusSetupDAO.GetSortByBusStartDateList();
                    List<Data.StudentByBus> _StudentSource = udtHelper.Select<Data.StudentByBus>();
                    校車站名資料庫.Clear();
                    foreach (Data.BusStop var in _BusSource)
                    {
                        if (!校車站名資料庫.ContainsKey(var.BusTimeName))
                            校車站名資料庫.Add(var.BusTimeName, new Dictionary<string, Data.BusStop>());
                        if (!校車站名資料庫[var.BusTimeName].ContainsKey(var.BusStopID))
                            校車站名資料庫[var.BusTimeName].Add(var.BusStopID, var);
                    }
                    校車時間紀錄資料庫.Clear();
                    foreach (Data.BusSetup var in _Source)
                    {
                        if (!校車時間紀錄資料庫.ContainsKey(var.BusYear.ToString()))
                            校車時間紀錄資料庫.Add(var.BusYear.ToString(), new Dictionary<string, Data.BusSetup>());
                        if (!校車時間紀錄資料庫[var.BusYear.ToString()].ContainsKey(var.BusRangeName))
                            校車時間紀錄資料庫[var.BusYear.ToString()].Add(var.BusRangeName, var);
                    }
                    新生搭車紀錄資料庫.Clear();
                    foreach (Data.StudentByBus var in _StudentSource)
                    {
                        if (!新生搭車紀錄資料庫.ContainsKey(var.StudentID))
                            新生搭車紀錄資料庫.Add(var.StudentID, var);
                    }
                    新生資料庫.Clear();
                    新生科別資料庫.Clear();
                    List<NewStudentRecord> students = udtHelper.Select<NewStudentRecord>("學年度='" + K12.Data.School.DefaultSchoolYear + "'");
                    foreach (NewStudentRecord var in students)
                    {
                        if (var.Active != true)
                            continue;
                        if (!新生資料庫.ContainsKey(var.Number))
                            新生資料庫.Add(var.Number, var);
                        if (!新生科別資料庫.Contains(var.Dept))
                            新生科別資料庫.Add(var.Dept);
                    }

                    iWizardBusNewStudent.RequiredFields.AddRange("搭車年度", "校車時段", "期間名稱", "代碼", "科別", "編號");
                    iWizardBusNewStudent.ImportableFields.AddRange("天數", "車費", "是否繳費", "繳費日期", "備註");
                    iWizardBusNewStudent.IdentifyRow += new EventHandler<ImportLibrary.IdentifyRowEventArgs>(iWizardBusNewStudent_IdentifyRow);
                    iWizardBusNewStudent.ValidateRow += new EventHandler<ImportLibrary.ValidateRowEventArgs>(iWizardBusNewStudent_ValidateRow);
                    iWizardBusNewStudent.ImportStart += new EventHandler(iWizardBusNewStudent_ImportStart);
                    iWizardBusNewStudent.ImportPackage += new EventHandler<ImportLibrary.ImportPackageEventArgs>(iWizardBusNewStudent_ImportPackage);
                    wizardBusNewStudent.ShowDialog();
                };

                ribbon.Add(new ReportFeature("MdhsBusStudentPaymentImport", "匯入校車學生繳費資料"));
                MenuButton rbi04 = rbItem["匯入及匯出"]["匯入"]["匯入校車學生繳費資料"];
                rbi04.Enable = CurrentUser.Acl["MdhsBusStudentPaymentImport"].Executable;
                rbi04.Click += delegate
                {
                    ImportLibrary.PowerfulImportWizard wizardBusStudentPayment = new ImportLibrary.PowerfulImportWizard("匯入校車學生繳費資料", null);
                    ImportLibrary.IPowerfulImportWizard iWizardBusStudentPayment = wizardBusStudentPayment;

                    List<Data.BusStop> _BusSource = Data.BusStopDAO.GetSortByBusNumberList();
                    AccessHelper udtHelper = new AccessHelper();
                    List<Data.BusSetup> _Source = Data.BusSetupDAO.GetSortByBusStartDateList();
                    List<Data.StudentByBus> _StudentSource = udtHelper.Select<Data.StudentByBus>();

                    搭車紀錄資料庫.Clear();
                    foreach (Data.StudentByBus var in _StudentSource)
                    {
                        if (!搭車紀錄資料庫.ContainsKey(var.UID))
                            搭車紀錄資料庫.Add(var.UID, var);
                    }

                    iWizardBusStudentPayment.RequiredFields.AddRange("搭車系統編號");
                    iWizardBusStudentPayment.ImportableFields.AddRange("是否繳費", "繳費日期", "備註");
                    iWizardBusStudentPayment.IdentifyRow += new EventHandler<ImportLibrary.IdentifyRowEventArgs>(iWizardBusStudentPayment_IdentifyRow);
                    iWizardBusStudentPayment.ValidateRow += new EventHandler<ImportLibrary.ValidateRowEventArgs>(iWizardBusStudentPayment_ValidateRow);
                    iWizardBusStudentPayment.ImportStart += new EventHandler(iWizardBusStudentPayment_ImportStart);
                    iWizardBusStudentPayment.ImportPackage += new EventHandler<ImportLibrary.ImportPackageEventArgs>(iWizardBusStudentPayment_ImportPackage);
                    wizardBusStudentPayment.ShowDialog();
                };

                ribbon.Add(new ReportFeature("MdhsBusExport", "匯出校車路線站名資料"));
                MenuButton rbi21 = rbItem["匯入及匯出"]["匯出"]["匯出校車路線站名資料"];
                rbi21.Enable = CurrentUser.Acl["MdhsBusExport"].Executable;
                rbi21.Click += delegate
                {
                    //可存取 UDT 的工具類別
                    AccessHelper udtHelper = new AccessHelper();

                    //List<ClassRecord> Classes = K12.Data.Class.SelectAll();
                    //Dictionary<string, ClassRecord> classrec = new Dictionary<string, ClassRecord>();
                    //foreach (ClassRecord var in Classes)
                    //{
                    //    if (!classrec.ContainsKey(var.Name))
                    //        classrec.Add(var.Name, var);
                    //}
                    //List<Data.StudentByBus> Studentbuses = udtHelper.Select<Data.StudentByBus>();
                    //foreach (Data.StudentByBus var in Studentbuses)
                    //{
                    //    string cName = var.ClassName;
                    //    if (var.ClassName.IndexOf("科") > 0)
                    //        continue;
                    //    if (var.ClassName.Substring(1, 1) == "一")
                    //        cName = cName.Replace("一", "二");
                    //    else if (var.ClassName.Substring(1, 1) == "二")
                    //        cName = cName.Replace("二", "三");
                    //    else
                    //        continue;
                    //    if (cName == "普二甲")
                    //        cName = "普二甲自";
                    //    var.ClassID = classrec[cName].ID;
                    //}
                    //Studentbuses.SaveAll();

                    List<Data.BusStop> buses = udtHelper.Select<Data.BusStop>();
                    Workbook wb = new Workbook();
                    Style defaultStyle = wb.DefaultStyle;
                    defaultStyle.Font.Name = "標楷體";
                    defaultStyle.Font.Size = 12;
                    wb.DefaultStyle = defaultStyle;
                    int row = 0;
                    int nowSet = 0;
                    wb.Worksheets[0].Name = "校車路線站名資料";

                    //校車路線站名資料
                    wb.Worksheets[0].Cells[row, 0].PutValue("代碼");
                    wb.Worksheets[0].Cells[row, 1].PutValue("站名");
                    wb.Worksheets[0].Cells[row, 2].PutValue("車費");
                    wb.Worksheets[0].Cells[row, 3].PutValue("車號");
                    wb.Worksheets[0].Cells[row, 4].PutValue("站序");
                    wb.Worksheets[0].Cells[row, 5].PutValue("到站時間");
                    wb.Worksheets[0].Cells[row, 6].PutValue("放學上車地點");
                    wb.Worksheets[0].Cells[row, 7].PutValue("停車地址");
                    wb.Worksheets[0].Cells[row, 8].PutValue("校車時段");
                    row++;
                    buses.Sort(CompareBusNumber);
                    foreach (Data.BusStop var in buses)
                    {
                        MotherForm.SetStatusBarMessage("正在產生報表", nowSet++ * 100 / buses.Count);
                        wb.Worksheets[0].Cells[row, 0].PutValue(var.BusStopID);
                        wb.Worksheets[0].Cells[row, 1].PutValue(var.BusStopName);
                        wb.Worksheets[0].Cells[row, 2].PutValue(var.BusMoney);
                        wb.Worksheets[0].Cells[row, 3].PutValue(var.BusNumber);
                        wb.Worksheets[0].Cells[row, 4].PutValue(var.BusStopNo);
                        wb.Worksheets[0].Cells[row, 5].PutValue(var.ComeTime);
                        wb.Worksheets[0].Cells[row, 6].PutValue(var.BusUpAddr);
                        wb.Worksheets[0].Cells[row, 7].PutValue(var.BusStopAddr);
                        wb.Worksheets[0].Cells[row, 8].PutValue(var.BusTimeName);
                        row++;
                    }
                    wb.Worksheets[0].AutoFitColumns();
                    try
                    {
                        wb.Save(Application.StartupPath + "\\Reports\\匯出校車路線站名資料.xls", FileFormatType.Excel2003);
                        System.Diagnostics.Process.Start(Application.StartupPath + "\\Reports\\匯出校車路線站名資料.xls");
                        MotherForm.SetStatusBarMessage("校車路線站名資料已匯出完成", 100);
                    }
                    catch
                    {
                        System.Windows.Forms.SaveFileDialog sd1 = new System.Windows.Forms.SaveFileDialog();
                        sd1.Title = "另存新檔";
                        sd1.FileName = "匯出校車路線站名資料.xls";
                        sd1.Filter = "Excel檔案 (*.xls)|*.xls|所有檔案 (*.*)|*.*";
                        if (sd1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            try
                            {
                                wb.Save(sd1.FileName, FileFormatType.Excel2003);
                                System.Diagnostics.Process.Start(sd1.FileName);
                                MotherForm.SetStatusBarMessage("校車路線站名資料已匯出完成", 100);
                            }
                            catch
                            {
                                System.Windows.Forms.MessageBox.Show("指定路徑無法存取。", "建立檔案失敗", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                                return;
                            }
                        }
                    }
                };

                ribbon.Add(new ReportFeature("MdhsStudnetByBusDetail", "匯出學生搭乘校車資料"));
                MenuButton rbi22 = rbItem["匯入及匯出"]["匯出"]["匯出學生搭乘校車資料"];
                rbi22.Enable = CurrentUser.Acl["MdhsStudnetByBusDetail"].Executable;
                rbi22.Click += delegate
                {
                    StudentByBusDetail frm = new StudentByBusDetail();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車設定"];
                ribbon.Add(new ReportFeature("MdhsBusSetup", "校車時間設定"));
                MenuButton rbi31 = rbItem["校車設定"]["校車時間設定"];
                rbi31.Enable = CurrentUser.Acl["MdhsBusSetup"].Executable;
                rbi31.Click += delegate
                {
                    Setup frm = new Setup();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車設定"];
                ribbon.Add(new ReportFeature("MdhsStudnetByBus", "學生搭乘校車設定"));
                MenuButton rbi32 = rbItem["校車設定"]["學生搭乘校車設定"];
                rbi32.Enable = CurrentUser.Acl["MdhsStudnetByBus"].Executable;
                rbi32.Click += delegate
                {
                    StudentBus frm = new StudentBus();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["新生校車設定"];
                ribbon.Add(new ReportFeature("MdhsNewStudnetByBus", "新生搭乘校車設定"));
                MenuButton rbi33 = rbItem["新生校車設定"]["新生搭乘校車設定"];
                rbi33.Enable = CurrentUser.Acl["MdhsNewStudnetByBus"].Executable;
                rbi33.Click += delegate
                {
                    NewStudentBus frm = new NewStudentBus();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["新生校車設定"];
                ribbon.Add(new ReportFeature("MdhsNewStudnetTransfer", "新生搭乘校車轉高一學生"));
                MenuButton rbi34 = rbItem["新生校車設定"]["新生搭乘校車轉高一學生"];
                rbi34.Enable = CurrentUser.Acl["MdhsNewStudnetTransfer"].Executable;
                rbi34.Click += delegate
                {
                    NewStudentTransfer frm = new NewStudentTransfer();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車設定"];
                ribbon.Add(new ReportFeature("MdhsBusMoneyMitigate", "夜輔撘車學生已搭日校校車車費減免"));
                MenuButton rbi35 = rbItem["校車設定"]["夜輔撘車學生已搭日校校車車費減免"];
                rbi35.Enable = CurrentUser.Acl["MdhsBusMoneyMitigate"].Executable;
                rbi35.Click += delegate
                {
                    BusMoneyMitigate frm = new BusMoneyMitigate();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車報表"];
                ribbon.Add(new ReportFeature("MdhsStudnetSurveyform", "學生搭乘校車調查表/點名表"));
                MenuButton rbi41 = rbItem["校車報表"]["學生搭乘校車調查表/點名表"];
                rbi41.Enable = CurrentUser.Acl["MdhsStudnetSurveyform"].Executable;
                rbi41.Click += delegate
                {
                    Surveyform frm = new Surveyform();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車報表"];
                ribbon.Add(new ReportFeature("MdhsNewStudnetBusPrint", "新生學生校車繳費單"));
                MenuButton rbi42 = rbItem01["報表"]["學費相關報表"]["新生校車繳費單列印"];
                rbi42.Enable = CurrentUser.Acl["MdhsNewStudnetBusPrint"].Executable;
                rbi42.Click += delegate
                {
                    PaymentSheet frm = new PaymentSheet();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車報表"];
                ribbon.Add(new ReportFeature("MdhsNewStudnetsBusPrint", "新生學生校車繳費單(批次)"));
                MenuButton rbi43 = rbItem01["報表"]["學費相關報表"]["新生校車繳費單列印(批次)"];
                rbi43.Enable = CurrentUser.Acl["MdhsNewStudnetsBusPrint"].Executable;
                rbi43.Click += delegate
                {
                    PaymentSheets frm = new PaymentSheets();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車報表"];
                ribbon.Add(new ReportFeature("MdhsStudnetBusPrint", "學生校車繳費單"));
                MenuButton rbi44 = StudentReports["報表"]["明德女中"]["學費相關報表"]["學生校車繳費單列印"];
                rbi44.Enable = CurrentUser.Acl["MdhsNewStudnetBusPrint"].Executable;
                rbi44.Click += delegate
                {
                    StudnetPaymentSheet frm = new StudnetPaymentSheet();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車報表"];
                ribbon.Add(new ReportFeature("MdhsStudnetsBusPrint", "學生校車繳費單(批次)"));
                MenuButton rbi45 = rbItem["校車報表"]["學生校車繳費單列印(批次)"];
                rbi45.Enable = CurrentUser.Acl["MdhsStudnetsBusPrint"].Executable;
                rbi45.Click += delegate
                {
                    StudnetPaymentSheets frm = new StudnetPaymentSheets();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車收費設定"];
                ribbon.Add(new ReportFeature("MdhsBusPaymentSetup", "校車收費設定"));
                MenuButton rbi51 = rbItem["校車設定"]["校車收費設定"];
                rbi51.Enable = CurrentUser.Acl["MdhsBusPaymentSetup"].Executable;
                rbi51.Click += delegate
                {
                    PaymentSetup frm = new PaymentSetup();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車收費設定"];
                ribbon.Add(new ReportFeature("MdhsBusPaymentBar", "校車收費管理"));
                MenuButton rbi52 = rbItem02["校車收費管理"];
                rbi52.Enable = CurrentUser.Acl["MdhsBusPaymentBar"].Executable;
                rbi52.Click += delegate
                {
                    PaymentBar frm = new PaymentBar();
                    frm.ShowDialog();
                };

                ribbon = RoleAclSource.Instance["明德外掛系統"]["校車模組"]["校車收費設定"];
                ribbon.Add(new ReportFeature("MdhsBusBalance", "校車收費對帳"));
                MenuButton rbi53 = rbItem02["校車收費對帳"];
                rbi53.Enable = CurrentUser.Acl["MdhsBusBalance"].Executable;
                rbi53.Click += delegate
                {
                    MdhsBusBalance frm = new MdhsBusBalance();
                    frm.ShowDialog();
                };

                //rollbook
            }

            if (FISCA.Permission.UserAcl.Current["MdhsBusView"].Editable || FISCA.Permission.UserAcl.Current["MdhsBusView"].Viewable)
            {
                K12.Presentation.NLDPanels.Student.AddView(new StudentBusBView());
                K12.Presentation.NLDPanels.Student.AddDetailBulider<StudentBusDetail>();
            }
        }
Exemple #2
0
 /// <summary>
 /// 設定可以call back 的表單
 /// </summary>
 /// <param name="masterForm"></param>
 public void SetMasterForm(Setup masterForm)
 {
     this._masterForm = masterForm;
 }