private void Loja_Leave() { if (!string.IsNullOrEmpty(textBoxCodLoja.Text)) { if (int.TryParse(textBoxCodLoja.Text, out int cod)) { EletroLojaInfo loja = negocioServ.ConsultarEletroLojaId(cod); if (loja != null) { textBoxCodLoja.Text = string.Format("{0:000}", cod); labelLojaDescricao.Text = loja.LojDescricao; } else { textBoxCodLoja.Text = string.Empty; labelLojaDescricao.Text = string.Empty; } } else { FormMessage.ShowMessegeWarning("Insira um valor numérico!"); textBoxCodLoja.Text = string.Empty; labelLojaDescricao.Text = string.Empty; } } }
private void buttonAddLoja_Click(object sender, EventArgs e) { EletroLojaInfo eletroLojaInfo = new EletroLojaInfo(); FormCadTexto formCadTexto = new FormCadTexto(eletroLojaInfo); formCadTexto.ShowDialog(this); formCadTexto.Dispose(); }