// 执行统计方案 private void toolStripMenuItem_runProject_Click(object sender, EventArgs e) { string strError = ""; // 出现对话框,询问Project名字 GetProjectNameDlg dlg = new GetProjectNameDlg(); MainForm.SetControlFont(dlg, this.Font, false); dlg.scriptManager = this.ScriptManager; dlg.ProjectName = this.m_strProjectName; dlg.NoneProject = false; this.AppInfo.LinkFormState(dlg, "GetProjectNameDlg_state"); dlg.ShowDialog(this); this.AppInfo.UnlinkFormState(dlg); if (dlg.DialogResult != DialogResult.OK) { return; } this.m_strProjectName = dlg.ProjectName; // string strProjectLocate = ""; // 获得方案参数 // strProjectNamePath 方案名,或者路径 // return: // -1 error // 0 not found project // 1 found int nRet = this.ScriptManager.GetProjectData( dlg.ProjectName, out strProjectLocate); if (nRet == 0) { strError = "方案 " + dlg.ProjectName + " 没有找到..."; goto ERROR1; } if (nRet == -1) { strError = "scriptManager.GetProjectData() error ..."; goto ERROR1; } // nRet = RunScript(dlg.ProjectName, strProjectLocate, out strError); if (nRet == -1) { goto ERROR1; } return; ERROR1: MessageBox.Show(this, strError); }
private void button_getProjectName_Click(object sender, EventArgs e) { // 出现对话框,询问Project名字 GetProjectNameDlg dlg = new GetProjectNameDlg(); MainForm.SetControlFont(dlg, this.Font, false); dlg.scriptManager = this.ScriptManager; dlg.ProjectName = this.textBox_projectName.Text; dlg.NoneProject = false; Program.MainForm.AppInfo.LinkFormState(dlg, "GetProjectNameDlg_state"); dlg.ShowDialog(this); Program.MainForm.AppInfo.UnlinkFormState(dlg); if (dlg.DialogResult != DialogResult.OK) { return; } this.textBox_projectName.Text = dlg.ProjectName; }
private void button_findOutputFormat_Click(object sender, EventArgs e) { // 出现对话框,询问Project名字 GetProjectNameDlg dlg = new GetProjectNameDlg(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "请指定 订单输出 方案名"; dlg.scriptManager = this.ScriptManager; dlg.ProjectName = this.comboBox_outputFormat.Text; dlg.NoneProject = false; dlg.DisableNoneProject = true; this.AppInfo.LinkFormState(dlg, "OrderOutputItemDialog_GetProjectNameDlg_state"); dlg.ShowDialog(this); this.AppInfo.UnlinkFormState(dlg); if (dlg.DialogResult != DialogResult.OK) { return; } this.comboBox_outputFormat.Text = dlg.ProjectName; }