Esempio n. 1
0
        void menu_modifyReport_Click(object sender, EventArgs e)
        {
            string strError = "";

            if (this.listView_reports.SelectedItems.Count == 0)
            {
                strError = "尚未选定要修改的事项";
                goto ERROR1;
            }

            ListViewItem item = this.listView_reports.SelectedItems[0];

            ReportApplyForm dlg = new ReportApplyForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.MainForm          = this.MainForm;
            dlg.ReportForm        = this.ReportForm;
            dlg.LibraryCode       = ReportForm.GetOriginLibraryCode(this.comboBox_general_libraryCode.Text);
            dlg.CfgFileDir        = Path.Combine(this.MainForm.UserDir, "report_def"); //  Path.Combine(this.MainForm.UserDir, "report_def");
            dlg.ReportName        = ListViewUtil.GetItemText(item, COLUMN_REPORT_NAME);
            dlg.Freguency         = ListViewUtil.GetItemText(item, COLUMN_REPORT_FREQ);
            dlg.ReportType        = ListViewUtil.GetItemText(item, COLUMN_REPORT_TYPE);
            dlg.ReportCfgFileName = ListViewUtil.GetItemText(item, COLUMN_REPORT_CFGFILE);
            dlg.NameTable         = ListViewUtil.GetItemText(item, COLUMN_REPORT_NAMETABLE);

            this.MainForm.AppInfo.LinkFormState(dlg, "ReportApplyForm_state");
            dlg.UiState = this.MainForm.AppInfo.GetString("libraryreportconfig_form", "reportapplyform_ui_state", "");
            dlg.ShowDialog(this);
            this.MainForm.AppInfo.SetString("libraryreportconfig_form", "reportapplyform_ui_state", dlg.UiState);
            this.MainForm.AppInfo.UnlinkFormState(dlg);

            if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAME, dlg.ReportName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_FREQ, dlg.Freguency);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_TYPE, dlg.ReportType);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_CFGFILE, dlg.ReportCfgFileName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAMETABLE, dlg.NameTable);

            this.Changed = true;
            return;

ERROR1:
            MessageBox.Show(this, strError);
        }
Esempio n. 2
0
        void menu_newReport_Click(object sender, EventArgs e)
        {
            ReportApplyForm dlg = new ReportApplyForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.MainForm    = this.MainForm;
            dlg.ReportForm  = this.ReportForm;
            dlg.LibraryCode = ReportForm.GetOriginLibraryCode(this.comboBox_general_libraryCode.Text);
            dlg.CfgFileDir  = Path.Combine(this.MainForm.UserDir, "report_def"); //  Path.Combine(this.MainForm.UserDir, "report_def");
REDO_INPUT:
            this.MainForm.AppInfo.LinkFormState(dlg, "ReportApplyForm_state");
            dlg.UiState = this.MainForm.AppInfo.GetString("libraryreportconfig_form", "reportapplyform_ui_state", "");
            dlg.ShowDialog(this);
            this.MainForm.AppInfo.SetString("libraryreportconfig_form", "reportapplyform_ui_state", dlg.UiState);
            this.MainForm.AppInfo.UnlinkFormState(dlg);

            if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            // 对报表文件名进行查重
            ListViewItem dup = ListViewUtil.FindItem(this.listView_reports, dlg.ReportName, COLUMN_REPORT_NAME);

            if (dup != null)
            {
                ListViewUtil.SelectLine(dup, true);
                MessageBox.Show(this, "报表名为 '" + dlg.ReportName + "' 的事项已经存在,不允许重复创建。请修改报表名");
                goto REDO_INPUT;
            }

            ListViewItem item = new ListViewItem();

            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAME, dlg.ReportName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_FREQ, dlg.Freguency);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_TYPE, dlg.ReportType);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_CFGFILE, dlg.ReportCfgFileName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAMETABLE, dlg.NameTable);
            this.listView_reports.Items.Add(item);

            ListViewUtil.SelectLine(item, true);

            this.Changed = true;
        }
Esempio n. 3
0
        void menu_newReport_Click(object sender, EventArgs e)
        {
            ReportApplyForm dlg = new ReportApplyForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.MainForm = this.MainForm;
            dlg.ReportForm = this.ReportForm;
            dlg.LibraryCode = ReportForm.GetOriginLibraryCode(this.comboBox_general_libraryCode.Text);
            dlg.CfgFileDir = Path.Combine(this.MainForm.UserDir, "report_def"); //  Path.Combine(this.MainForm.UserDir, "report_def");
        REDO_INPUT:
            this.MainForm.AppInfo.LinkFormState(dlg, "ReportApplyForm_state");
            dlg.UiState = this.MainForm.AppInfo.GetString("libraryreportconfig_form", "reportapplyform_ui_state", "");
            dlg.ShowDialog(this);
            this.MainForm.AppInfo.SetString("libraryreportconfig_form", "reportapplyform_ui_state", dlg.UiState);
            this.MainForm.AppInfo.UnlinkFormState(dlg);

            if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel)
                return;

            // 对报表文件名进行查重
            ListViewItem dup = ListViewUtil.FindItem(this.listView_reports, dlg.ReportName, COLUMN_REPORT_NAME);
            if (dup != null)
            {
                ListViewUtil.SelectLine(dup, true);
                MessageBox.Show(this, "报表名为 '" + dlg.ReportName + "' 的事项已经存在,不允许重复创建。请修改报表名");
                goto REDO_INPUT;
            }

            ListViewItem item = new ListViewItem();
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAME, dlg.ReportName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_FREQ, dlg.Freguency);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_TYPE, dlg.ReportType);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_CFGFILE, dlg.ReportCfgFileName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAMETABLE, dlg.NameTable);
            this.listView_reports.Items.Add(item);

            ListViewUtil.SelectLine(item, true);

            this.Changed = true;
        }
Esempio n. 4
0
        void menu_modifyReport_Click(object sender, EventArgs e)
        {
            string strError = "";

            if (this.listView_reports.SelectedItems.Count == 0)
            {
                strError = "尚未选定要修改的事项";
                goto ERROR1;
            }

            ListViewItem item = this.listView_reports.SelectedItems[0];

            ReportApplyForm dlg = new ReportApplyForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.MainForm = this.MainForm;
            dlg.ReportForm = this.ReportForm;
            dlg.LibraryCode = ReportForm.GetOriginLibraryCode(this.comboBox_general_libraryCode.Text);
            dlg.CfgFileDir = Path.Combine(this.MainForm.UserDir, "report_def"); //  Path.Combine(this.MainForm.UserDir, "report_def");
            dlg.ReportName = ListViewUtil.GetItemText(item, COLUMN_REPORT_NAME);
            dlg.Freguency = ListViewUtil.GetItemText(item, COLUMN_REPORT_FREQ);
            dlg.ReportType = ListViewUtil.GetItemText(item, COLUMN_REPORT_TYPE);
            dlg.ReportCfgFileName = ListViewUtil.GetItemText(item, COLUMN_REPORT_CFGFILE);
            dlg.NameTable = ListViewUtil.GetItemText(item, COLUMN_REPORT_NAMETABLE);

            this.MainForm.AppInfo.LinkFormState(dlg, "ReportApplyForm_state");
            dlg.UiState = this.MainForm.AppInfo.GetString("libraryreportconfig_form", "reportapplyform_ui_state", "");
            dlg.ShowDialog(this);
            this.MainForm.AppInfo.SetString("libraryreportconfig_form", "reportapplyform_ui_state", dlg.UiState);
            this.MainForm.AppInfo.UnlinkFormState(dlg);

            if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel)
                return;

            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAME, dlg.ReportName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_FREQ, dlg.Freguency);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_TYPE, dlg.ReportType);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_CFGFILE, dlg.ReportCfgFileName);
            ListViewUtil.ChangeItemText(item, COLUMN_REPORT_NAMETABLE, dlg.NameTable);

            this.Changed = true;
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }