Exemplo n.º 1
0
        private void button_editCfgFile_Click(object sender, EventArgs e)
        {
            string strError = "";

            string strLocalFileName = this.textBox_cfgFileName.Text;

            if (string.IsNullOrEmpty(strLocalFileName) == false)
            {
            }
            else
            {
                string strNumber = this.GetTypeNumber();
                if (string.IsNullOrEmpty(strNumber) == true)
                {
                    strError = "请先指定报表类型,才能创建新的配置文件";
                    goto ERROR1;
                }

                string strFileName = strNumber + ".xml";
                strLocalFileName = Path.Combine(this.CfgFileDir, strFileName);
            }

            ReportDefForm dlg = new ReportDefForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.AppInfo = Program.MainForm.AppInfo;

            Program.MainForm.AppInfo.LinkFormState(dlg, "ReportDefForm_state");
            dlg.CfgFileName = strLocalFileName;
            dlg.UiState     = Program.MainForm.AppInfo.GetString("reportapply_form", "reportdefform_ui_state", "");
            dlg.ShowDialog(this);
            Program.MainForm.AppInfo.SetString("reportapply_form", "reportdefform_ui_state", dlg.UiState);
            Program.MainForm.AppInfo.UnlinkFormState(dlg);

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

            this.textBox_cfgFileName.Text = strLocalFileName;
            AutoFillReportName();
            return;

ERROR1:
            MessageBox.Show(this, strError);
        }
Exemplo n.º 2
0
        private void button_editCfgFile_Click(object sender, EventArgs e)
        {
            string strError = "";

            string strLocalFileName = this.textBox_cfgFileName.Text;
            if (string.IsNullOrEmpty(strLocalFileName) == false)
            {
            }
            else
            {
                string strNumber = this.GetTypeNumber();
                if (string.IsNullOrEmpty(strNumber) == true)
                {
                    strError = "请先指定报表类型,才能创建新的配置文件";
                    goto ERROR1;
                }

                string strFileName = strNumber + ".xml";
                strLocalFileName = Path.Combine(this.CfgFileDir, strFileName);
            }

            ReportDefForm dlg = new ReportDefForm();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.AppInfo = this.MainForm.AppInfo;

            this.MainForm.AppInfo.LinkFormState(dlg, "ReportDefForm_state");
            dlg.CfgFileName = strLocalFileName;
            dlg.UiState = this.MainForm.AppInfo.GetString("reportapply_form", "reportdefform_ui_state", "");
            dlg.ShowDialog(this);
            this.MainForm.AppInfo.SetString("reportapply_form", "reportdefform_ui_state", dlg.UiState);
            this.MainForm.AppInfo.UnlinkFormState(dlg);

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

            this.textBox_cfgFileName.Text = strLocalFileName;
            AutoFillReportName();
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }