private void btnBuscar_Click(object sender, EventArgs e) { fBusca_Cliente fBuscaCli = new fBusca_Cliente(); fBuscaCli.ShowDialog(); if (clsStatic.cliente == null) { LimparCampos(); } else { CarregaCampos(); } }
private void btnIncluiCliente_Click(object sender, EventArgs e) { fBusca_Cliente frmCliente = new fBusca_Cliente(); frmCliente.ShowDialog(); if (clsStatic.cliente != null) { pedido.Cliente_ID = clsStatic.cliente.Cliente_ID; txtBairro.Text = clsStatic.cliente.Bairro; txtCEP.Text = clsStatic.cliente.Cep; txtCPF.Text = clsStatic.cliente.Cpf; txtNome.Text = clsStatic.cliente.Nome; txtNumero.Text = clsStatic.cliente.Numero; txtRua.Text = clsStatic.cliente.Rua; txtCidade.Text = clsStatic.cliente.Cidade; txtIDCliente.Text = clsStatic.cliente.Cliente_ID.ToString(); if (!String.IsNullOrEmpty(clsStatic.cliente.Imagem)) { imgCliente.BackgroundImage = clsUtil.Base64ToImage(clsStatic.cliente.Imagem); } else { imgCliente.BackgroundImage = null; } } else { pedido.Cliente_ID = 0; txtBairro.Clear(); txtCEP.Clear(); txtCPF.Clear(); txtNome.Clear(); txtNumero.Clear(); txtRua.Clear(); txtCidade.Clear(); txtIDCliente.Clear(); imgCliente.BackgroundImage = null; } }