private void preencherComboClientes() { ClienteCtrl objClienteCtrl; try { objClienteCtrl = new ClienteCtrl(); if (objClienteCtrl.consultar("") != null) { for (int i = 0; i < objClienteCtrl.consultar("").Rows.Count; i++) { this.cmbCliente.Items.Add(objClienteCtrl.consultar("").Rows[i]["nome"].ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void TxtNome_KeyUp(object sender, KeyEventArgs e) { ClienteCtrl objClienteCtrl; try { objClienteCtrl = new ClienteCtrl(); this.dgvCliente.DataSource = objClienteCtrl.consultar(this.txtNome.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void carregaGrid() { ClienteCtrl objClienteCtrl; try { objClienteCtrl = new ClienteCtrl(); this.dgvCliente.DataSource = objClienteCtrl.consultar(""); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void consultarClienteView_Load(object sender, EventArgs e) { ClienteCtrl objClienteCtrl; try { objClienteCtrl = new ClienteCtrl(); this.dgvCliente.DataSource = objClienteCtrl.consultar(""); this.dgvCliente.Columns[0].Width = 80; this.dgvCliente.Columns[0].HeaderText = "CPF"; this.dgvCliente.Columns[1].Width = 100; this.dgvCliente.Columns[1].HeaderText = "Nome"; this.dgvCliente.Columns[2].Width = 125; this.dgvCliente.Columns[2].HeaderText = "Email"; this.dgvCliente.Columns[3].Width = 80; this.dgvCliente.Columns[3].HeaderText = "Telefone"; this.dgvCliente.Columns[4].Visible = false; this.dgvCliente.Columns[5].Width = 50; this.dgvCliente.Columns[5].HeaderText = "CEP"; this.dgvCliente.Columns[6].Width = 100; this.dgvCliente.Columns[6].HeaderText = "Rua"; this.dgvCliente.Columns[7].Width = 70; this.dgvCliente.Columns[7].HeaderText = "NĂºmero"; this.dgvCliente.Columns[8].Width = 100; this.dgvCliente.Columns[8].HeaderText = "Bairro"; this.dgvCliente.Columns[9].Width = 75; this.dgvCliente.Columns[9].HeaderText = "Cidade"; this.dgvCliente.Columns[10].Width = 50; this.dgvCliente.Columns[10].HeaderText = "UF"; this.dgvCliente.DefaultCellStyle.Font = new Font("Trebuchet MS", 12); } catch (Exception ex) { MessageBox.Show(ex.Message); } }