private void ButtonOK_Click(object sender, EventArgs e) { Debug.Assert(this.m_StockTypeId == 0); int id = ((BaseValueDisplayListItem)this.ComboBoxStocks.SelectedItem).Value; if (this.m_Diagram.GetStockTypeShape(id) != null) { FormsUtilities.InformationMessageBox("The specified stock type has already been added to the diagram."); return; } this.m_StockTypeId = id; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
internal void InternalExport(string location, ExportType exportType, bool showMessage) { ExportColumnCollection columns = this.CreateColumnCollection(); if (exportType == ExportType.ExcelFile) { this.ExcelExport(location, columns, this.CreateReportQuery(false), "Flows"); } else { columns.Remove("ScenarioName"); this.CSVExport(location, columns, this.CreateReportQuery(true)); if (showMessage) { FormsUtilities.InformationMessageBox("Data saved to '{0}'.", location); } } }
private void OnExecuteAddStockCommand(Command cmd) { DataSheet ds = this.Project.GetDataSheet(Constants.DATASHEET_STOCK_TYPE_NAME); DataView dv = new DataView(ds.GetData(), null, ds.DisplayMember, DataViewRowState.CurrentRows); if (dv.Count == 0) { FormsUtilities.InformationMessageBox("No stock types have been defined."); return; } FlowPathwayDiagram d = GetFlowDiagram(); ChooseStockTypeForm f = new ChooseStockTypeForm(); f.Initialize(d, this.Project); if (f.ShowDialog(this) == DialogResult.OK) { using (HourGlass h = new HourGlass()) { d.AddStockTypeShape(f.StockTypeId); } } }