private void textBoxDescricao_TextChanged(object sender, EventArgs e) { var c = colecaoConsult.Where(w => FormTextoFormat.PalavraSemAcento(w.Descricao).ToUpper().Contains(textBoxDescricao.Text.ToUpper())).ToList(); dataGridViewConsultar.DataSource = null; dataGridViewConsultar.DataSource = c; }
private static void FormatTextBox_AoAlterar(object sender, EventArgs e) { TextBox box = sender as TextBox; if (!string.IsNullOrEmpty(box.Text)) { FormTextoFormat.NovoTextoUpper(box); } }
private static void FormatTextBox_AoPerderFoco(object sender, EventArgs e) { TextBox box = sender as TextBox; if (!FormTextoFormat.ValidaEmail(box.Text)) { FormMessage.ShowMessegeWarning("E-mail inválido, campo será definico como \" [email protected]\""); box.Text = "*****@*****.**"; } }
public static string PalavraMaiuscula(string s) { string[] Preposicao = new string[] { "em", "a", "de", "da", "das", "do", "dos", "para", "com", "por", "pelo", "pela", "pelos", "pelas", "e" }; string[] nome = s.Split(' '); string novo = string.Empty; bool prox = false; foreach (string n in nome) { //foreach (string p in Preposicao) // if (p.Contains(n.ToLower())) { prox = true; break; } if (Preposicao.Contains(n.ToLower())) { prox = true; break; } if (prox) { novo = string.IsNullOrEmpty(novo) ? n.ToLower() : string.Join(" ", novo, n.ToLower()); prox = false; continue; } else { string nsp = string.Empty; string[] sp = n.Split('/'); if (sp.Length > 1) { foreach (string no in sp) { nsp += string.IsNullOrWhiteSpace(nsp) ? FormTextoFormat.Nome(no) : string.Concat("/", FormTextoFormat.Nome(no)); } novo = string.IsNullOrEmpty(novo) ? nsp : string.Join(" ", novo, nsp);; } else { novo = string.IsNullOrEmpty(novo) ? FormTextoFormat.Nome(n) : string.Join(" ", novo, FormTextoFormat.Nome(n)); } } } return(novo); }
private void textBoxValor_TextChanged(object sender, EventArgs e) { FormTextoFormat.MoedaFormat(sender); }
private void moeda_Click(object sender, EventArgs e) { FormTextoFormat.MoedaFormat(sender); }
private void numeric_Click(object sender, EventArgs e) { FormTextoFormat.NumericTexto(sender); }
private void textBoxQuant_TextChanged(object sender, EventArgs e) { FormTextoFormat.NumericTexto(sender, 2); }