private void BL_template_gen(object sender, RoutedEventArgs e) { DataTable data = ((DataView)candBLGrid.ItemsSource).ToTable(); string output_path = ZOTFiles.FileSaver("Archivos CSV |*csv", "csv", "Exportando plantilla de Blacklisting"); using (StreamWriter writer = new StreamWriter(output_path)) { writer.WriteLine("Objeto;mrbtsId;lnBtsId;lnCelId;lnRelId;handoverAllowed;removeAllowed;;"); foreach (DataRow row in data.Rows) { if ((bool)row["SelectedBL"]) { string toCSV = "LNREL;"; toCSV += (string)row["ENBID SOURCE"] + ";"; toCSV += (string)row["ENBID SOURCE"] + ";"; toCSV += row["LnCell SOURCE"].ToString() + ";"; if ((string)row["Label"] != "") { toCSV += ((string)row["Label"]).Split('-')[1] + ";"; } else { toCSV += ";"; } toCSV += "1;"; toCSV += "0;"; toCSV += (string)row["Name SOURCE"] + ";"; toCSV += (string)row["Name TARGET"]; writer.WriteLine(toCSV); } } } }
private void btnCandidatasBL_Click(object sender, EventArgs e) { DataTable data = ToDataTable(advancedDataGridViewCol); string output_path = ZOTFiles.FileSaver("Archivos CSV |*csv", "csv", "Exportando plantilla de Blacklisting"); if (output_path != "error") { try{ using (StreamWriter writer = new StreamWriter(output_path)) { writer.WriteLine("Objeto;mrbtsId;lnBtsId;lnCelId;lnRelId;handoverAllowed;removeAllowed;;"); foreach (DataRow row in data.Rows) { if (row["Column1"].ToString() == "True") { string toCSV = "LNREL;"; toCSV += (string)row["Column3"] + ";"; toCSV += (string)row["Column3"] + ";"; toCSV += row["Column4"].ToString() + ";"; if ((string)row["Column2"] != "") { toCSV += ((string)row["Column2"]).Split('-')[1] + ";"; } else { toCSV += ";"; } toCSV += "1;"; toCSV += "0;"; toCSV += (string)row["Column5"] + ";"; toCSV += (string)row["Column5"]; writer.WriteLine(toCSV); } } } MessageBox.Show("CSV generado correctamente", "Exportado", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (IOException) { MessageBox.Show("El CSV debe cerrarse para poder exportarlo", "ERRoR", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception) { MessageBox.Show("Se produjo en error en la generación del csv", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("La ruta no es valida o se canceló la generación del csv.", "Cancelado", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void FL18_Click(object sender, RoutedEventArgs e) { try { FL18_path.Text = ZOTFiles.FileFinder("Access data base |*mdb", "Export FL18", Path.GetDirectoryName(SRAN_path.Text)); } catch (Exception) { FL18_path.Text = ZOTFiles.FileFinder("Access data base |*mdb", "Export FL18"); } }
private void NIR_Click(object sender, RoutedEventArgs e) { try { NIR_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "NIR 48H Completa", Path.GetDirectoryName(NIR_path.Text)); } catch (Exception) { NIR_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "NIR 48H Completa"); } }
private void TA_Click(object sender, RoutedEventArgs e) { try { TA_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "Timming Advance", Path.GetDirectoryName(TA_path.Text)); } catch (Exception) { TA_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "Timming Advance"); } }
private void R31_Click(object sender, RoutedEventArgs e) { try { RSLTE31_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "Consulta RSLTE31", Path.GetDirectoryName(RSLTE31_path.Text)); } catch (Exception) { RSLTE31_path.Text = ZOTFiles.FileFinder("Archivos CSV |*csv", "Consulta RSLTE31"); } }
private void OFF_template_gen(object sender, RoutedEventArgs e) { DataTable data = ((DataView)candOFFGrid.ItemsSource).ToTable(); string output_path = ZOTFiles.FileSaver("Archivos CSV |*csv", "csv", "Exportando plantilla de Offset"); using (StreamWriter writer = new StreamWriter(output_path)) { writer.WriteLine("Objeto;mrbtsId;lnBtsId;lnCelId;lnRelId;cellIndOffNeigh;;"); foreach (DataRow row in data.Rows) { if ((bool)row["SelectedOFF"]) { string toCSV = "LNREL;"; toCSV += (string)row["ENBID SOURCE"] + ";"; toCSV += (string)row["ENBID SOURCE"] + ";"; toCSV += row["LnCell SOURCE"].ToString() + ";"; if ((string)row["Label"] != "") { toCSV += ((string)row["Label"]).Split('-')[1] + ";"; } else { toCSV += ";"; } if ((double)row["Offset"] > 9) { toCSV += ((double)row["Offset"] - 3).ToString() + ";"; } else { toCSV += ((double)row["Offset"] - 1).ToString() + ";"; } toCSV += (string)row["Name SOURCE"] + ";"; toCSV += (string)row["Name TARGET"]; writer.WriteLine(toCSV); } } } }