private void buttonAddFlow_Click(object sender, EventArgs e) { InputType input; switch (GetSelectedInput()) { case DataType.EXCEL: input = new ExcelHandler(textBoxInputExcel.Text, comboBoxWorkSheet.SelectedValue.ToString() + "$"); break; case DataType.REST: input = new RestApiHandlerInput(tempInputMessage); break; case DataType.XML: input = new XmlHandlerInput(textBoxInputXml.Text); break; default: MessageBox.Show("No Input selected!"); return; } OutputType output; switch (GetSelectedOutput()) { case DataType.HTML: output = new HtmlHandler(textBoxOutputHtml.Text); break; case DataType.REST: output = new RestApiHandlerOutput(tempOutputMessage); break; case DataType.XML: output = new XmlHandlerOutput(textBoxOutputXml.Text); break; default: MessageBox.Show("No Output selected!"); return; } flowHandler.AddFlow(new Flow(input, output)); }
private void buttonOpenExcel_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Excel Worksheets| *.xls;*.xlsx"; openFileDialog.ShowDialog(); textBoxInputExcel.Text = openFileDialog.FileName; ExcelHandler excelHandler = new ExcelHandler(textBoxInputExcel.Text, ""); DataTable worksheets = excelHandler.getWorkSheets(); List <string> names = new List <string>(); foreach (DataRow item in worksheets.Rows) { string str = item[2].ToString().Replace("'", ""); names.Add(str.Replace("$", "")); } comboBoxWorkSheet.DataSource = names; }