private void inserçãoToolStripMenuItem_Click(object sender, EventArgs e) { var frm = new frmCadClientes(); frm.MdiParent = this; frm.Show(); }
private void cadastrarToolStripMenuItem_Click(object sender, EventArgs e) { frmCadClientes frm = new frmCadClientes(); frm.MdiParent = this; frm.Show(); }
private void grdClientes_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { var clienteSelecionado = new Clientes(); clienteSelecionado.Nome = grdClientes.Rows[e.RowIndex].Cells[0].Value.ToString(); clienteSelecionado.CPF = grdClientes.Rows[e.RowIndex].Cells[1].Value.ToString(); clienteSelecionado.Codigo = int.Parse(grdClientes.Rows[e.RowIndex].Cells[2].Value.ToString()); clienteSelecionado.DataNascimento = DateTime.Parse(grdClientes.Rows[e.RowIndex].Cells[3].Value.ToString()); frmCadClientes frmOpen = Application.OpenForms["frmCadClientes"] != null ? (frmCadClientes)Application.OpenForms["frmCadClientes"] : null; if (frmOpen != null) { frmOpen.atualizaCliente(clienteSelecionado); frmOpen.Activate(); } else { var frm = new frmCadClientes(clienteSelecionado); frm.MdiParent = this.MdiParent; frm.Show(); frm.Activate(); } }