private void ClientesToolStripMenuItem2_Click(object sender, EventArgs e) { frmConsultaCliente f = new frmConsultaCliente(); f.MdiParent = this; f.Show(); }
private void toolStripButton1_Click(object sender, EventArgs e) { frmConsultaCliente f = new frmConsultaCliente(); f.MdiParent = this; f.Show(); }
public void txtCodCliente_Leave(object sender, EventArgs e) { try { if (txtCodCliente.Text == "") { frmConsultaCliente f = new frmConsultaCliente(true); f.ShowDialog(); if (f.cod != 0) { txtCodCliente.Text = f.cod.ToString(); DALConexao cx = new DALConexao(DadosDaConexao.StringDeConexao); BLLCliente bll = new BLLCliente(cx); ModelCliente modelo = bll.CarregaModelCliente(Convert.ToInt32(txtCodCliente.Text)); if (modelo.IdCliente <= 0) { txtCodCliente.Clear(); txtNomeCliente.Clear(); txtCelCliente.Clear(); txtCodCliente.Select(); } else { txtNomeCliente.Text = modelo.Nome; txtCelCliente.Text = modelo.Celular; txtCodServico.Select(); } } } else { DALConexao cx = new DALConexao(DadosDaConexao.StringDeConexao); BLLCliente bll = new BLLCliente(cx); ModelCliente modelo = bll.CarregaModelCliente(Convert.ToInt32(txtCodCliente.Text)); if (modelo.IdCliente <= 0) { txtCodCliente.Clear(); txtNomeCliente.Clear(); txtCelCliente.Clear(); txtCodCliente.Select(); } else { txtNomeCliente.Text = modelo.Nome; txtCelCliente.Text = modelo.Celular; txtCodServico.Select(); } } } catch { txtCodCliente.Clear(); txtNomeCliente.Clear(); txtCelCliente.Clear(); txtCodCliente.Select(); } }