Revisa el texto para quitar acentos y demás

master
Elena 2019-10-19 17:39:55 +02:00
parent c941a8e29e
commit 2a0dbc6408
2 changed files with 16 additions and 2 deletions

View File

@ -148,7 +148,7 @@ namespace OliviaAddIn
instalacion = (IPoint)geom;
x = instalacion.X;
y = instalacion.Y;
text_sal = st;
text_sal = revisa_text(st);
}
}
}
@ -239,7 +239,7 @@ namespace OliviaAddIn
}
FunGDB.libera(fc);
//Actualiza el texto de salida
text_sal = text_sal + val_st[i].Replace(" ", string.Empty);
text_sal = text_sal + revisa_text(val_st[i]);
/*if(i<(nval-1))//si es el último no le pone '_'
text_sal = text_sal + "_";*/
}
@ -262,5 +262,18 @@ namespace OliviaAddIn
}
return true;
}
string revisa_text(string text)
{
StringBuilder sb = new StringBuilder();
foreach (char c in text)
{
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_')
{
sb.Append(c);
}
}
return sb.ToString();
}
}
}

View File

@ -778,6 +778,7 @@ namespace OliviaAddIn
private void checkBox_sens_CheckedChanged(object sender, EventArgs e)
{
checkBox_sens.Checked = false;
if (checkBox_sens.Checked == true)
{
btn_edit_camp_sensor.Enabled = checkBox_sens.Checked;