private void metroButton1_Click_1(object sender, EventArgs e) { FormPesquisaPessoa form = new FormPesquisaPessoa(); form.ShowDialog(); if (form.Id_selecionado > 0) { repositorioPessoa = new RepositorioPessoa(unitOfWork); repositorioPessoa.ClearNotifications(); pessoa = repositorioPessoa.GetOne(p => p.PessoaId == form.Id_selecionado); txtProprietario.Text = pessoa.Nome; txtCpfCnpj.Text = pessoa.CpfCnpj; metroButton3.Enabled = true; if (repositorioPessoa.IsInvalid()) { Erros = true; ShowErros(repositorio.Notifications); } } else { pessoa = new Pessoa(); txtProprietario.Clear(); txtCpfCnpj.Clear(); metroButton3.Enabled = false; } }
private void PessoaToolStripMenuItem_Click(object sender, EventArgs e) { FormPesquisaPessoa formPesquisaPessoa = new FormPesquisaPessoa(); formPesquisaPessoa.MdiParent = this; formPesquisaPessoa.Show(); }
private void metroButton1_Click(object sender, EventArgs e) { FormPesquisaPessoa form = new FormPesquisaPessoa(); form.ShowDialog(); if (form.Id_selecionado > 0) { RepositorioPessoa repositorioPessoa = new RepositorioPessoa(new UnitOfWork()); repositorioPessoa.ClearNotifications(); pessoa = repositorioPessoa.GetOne(p => p.PessoaId == form.Id_selecionado); txtPessoa.Text = pessoa.Nome; txtCpfCnpj.Text = pessoa.CpfCnpj; if (repositorioPessoa.IsInvalid()) { foreach (var msg in repositorioPessoa.Notifications) { MessageBox.Show("ERRO", msg.Message, MessageBoxButtons.OK); } } } else { pessoa = null; txtPessoa.Clear(); } }
private void menuPessoa_Click(object sender, EventArgs e) { FormPesquisaPessoa form = new FormPesquisaPessoa(); form.ShowDialog(); }