// >>>>> Formatação dos valores dos campos <<<<< private void txt_OnValueChanged(object sender, EventArgs e) { Bunifu.Framework.UI.BunifuMaterialTextbox txtBox = sender as Bunifu.Framework.UI.BunifuMaterialTextbox; if (!string.IsNullOrEmpty(txtBox.Text)) { txtBox.OnValueChanged -= txt_OnValueChanged; if (txtBox.Name.Contains("CPF")) { txtBox.Text = Data_Formater.Mask_CPF(txtBox.Text); } else { txtBox.Text = Data_Formater.Mask_RG(txtBox.Text); } SendKeys.Send("{END}"); txtBox.OnValueChanged += txt_OnValueChanged; } }
public void PictureBox1_Click(object sender, EventArgs e) { Invoke((MethodInvoker) delegate { if (!string.IsNullOrEmpty(Data_Formater.Just_Numbers(txtRG.Text))) { if (Web_Tools.Conectado_A_Internet()) { if (frm_Define_Nome.instancia != null) { frm_Define_Nome.instancia.Close(); } if (frm_Anexo.instancia != null) { frm_Anexo.instancia.Close(); } if (frm_Detalhes.instancia != null) { frm_Detalhes.instancia.Btn_Fechar_Click(frm_Detalhes.instancia, new EventArgs()); } infrator = Reload_Infrator(infrator); Controle_UI(infrator != null); if (infrator != null) { Infração ultima_infração = infrator.Infrações.OrderByDescending(inf => inf.Data_ocorrência).ToList().FirstOrDefault(); if (ultima_infração != null) { lbl_DataUltima.Text = ultima_infração.Data_ocorrência.ToString("dd/MM/yyyy"); } else { lbl_DataUltima.Text = "--/--/----"; } lbl_Status.Text = infrator.Infrações.Count > 1 ? "Reincidente" : infrator.Infrações.Count < 1 ? "Nada Consta" : "Incidente"; lbl_Nome.Text = infrator.Nome; lbl_CPF.Text = Data_Formater.Mask_CPF(infrator.Cpf); lbl_RG.Text = Data_Formater.Mask_RG(infrator.Rg); //Mudando Cor do Panel pnl_InfInfra.Controls.Clear(); pnl_InfInfra.BackColor = Color.White; foreach (Infração i in infrator.Infrações) { Cria_Item_Infração(i); } } else { Forms_Controller.pode_desconectar = false; MessageBox.Show("Infrator não encontrado!"); Forms_Controller.pode_desconectar = true; } } else { Web_Tools.Show_Net_Error(); } } }); }