Ejemplo n.º 1
0
 private void listViewFichas_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     var text = GetSelected(listViewFichas);
     if (text == "") return;
     var ficha = datosProceso.Fichas.FirstOrDefault(x => x.Nombre == text);
     if (ficha == null) return;
     var frm = new FrmDebug();
     frm.SetData("Ficha de indicadores " + text, ficha, true);
     frm.ShowDialog();
 }
Ejemplo n.º 2
0
 private void listViewMapeos_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     var text = GetSelected(listViewMapeos);
     if (text == "") return;
     var ficha = datosProceso.MapeosCargados[text];
     if (ficha == null) return;
     var frm = new FrmDebug();
     frm.SetData("Mapeo " + text, ficha, true);
     frm.ShowDialog();
 }
Ejemplo n.º 3
0
 private void BtnTestFuente_Click(object sender, EventArgs e)
 {
     var aux = GetSelected(listViewFuentes);
     if (string.IsNullOrEmpty(aux)) {
         MessageBox.Show("Seleccione Fuente");
         return;
     }
     try {
         var fuente = fuentesFactory.Fuentes.FirstOrDefault(x => x.Name == aux);
         var city = ComboCiudad.ComboBox.SelectedItem as Ciudad;
         var total = fuente.Total(city);
         var lista = fuente.Valores(city, 10);
         var msg = string.Format("Probando canton {0}, fuente{1}", city.Nombre, fuente.Name);
         LogMessage(msg);
         if (lista == null || lista.Count == 0) {
             MessageBox.Show("No vinieron datos");
             return;
         }
         LogMessage("Total: " + total);
         var sb = new StringBuilder("Primero: ").AppendLine();
         var uno = lista.First();
         var json1 = JsonConvert.SerializeObject(uno, Formatting.Indented);
         sb.AppendLine(json1);
         if (lista.Count > 1) {
             var rand = new Random().Next(0, lista.Count - 1);
             var obj = lista[rand];
             var json2 = JsonConvert.SerializeObject(obj, Formatting.Indented);
             sb.AppendLine("Al azar:" + rand).AppendLine(json2);
         }
         sb.AppendFormat("Total Registros: {0}", total).AppendLine();
         var frm = new FrmDebug();
         frm.SetData(msg, sb.ToString());
         frm.Show();
     } catch (Exception ex) {
         LogMessage("Error en prueba fuente:" + ex.Message, ex);
     }
 }