void CarregarCombos() { FuncionarioBussiness business = new FuncionarioBussiness(); List <ClienteDTO> lista = business.Listar(); cbonomedocliente.ValueMember = nameof(ClienteDTO.ID); cbonomedocliente.DisplayMember = nameof(ClienteDTO.Nome); cbonomedocliente.DataSource = lista; FuncionariosBusiness businesss = new FuncionariosBusiness(); List <FuncionariosDTO> listaa = businesss.Listar(); cbofuncionario.ValueMember = nameof(FuncionariosDTO.ID); cbofuncionario.DisplayMember = nameof(FuncionariosDTO.Nome); cbofuncionario.DataSource = listaa; TratamentoBusiness businessss = new TratamentoBusiness(); List <TratamentoDTO> listaaa = businessss.Listar(); cbotipodetratamento.ValueMember = nameof(TratamentoDTO.ID); cbotipodetratamento.DisplayMember = nameof(TratamentoDTO.Nome); cbotipodetratamento.DataSource = listaaa; }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 3) { TratamentoDTO tratamento = dataGridView1.Rows[e.RowIndex].DataBoundItem as TratamentoDTO; Consultar_Tratamentos tela = new Consultar_Tratamentos(); tela.LoadScreen(tratamento); tela.ShowDialog(); this.Hide(); } if (e.ColumnIndex == 4) { TratamentoDTO produtoss = dataGridView1.CurrentRow.DataBoundItem as TratamentoDTO; DialogResult r = MessageBox.Show("Deseja excluir o tratamento ?", "Realce Sua Beleza", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (r == DialogResult.Yes) { TratamentoBusiness business = new TratamentoBusiness(); business.Remover(produtoss.ID); CarregarGrid(); } } }
private void button1_Click(object sender, EventArgs e) { TratamentoBusiness business = new TratamentoBusiness(); List <TratamentoDTO> lista = business.Consultar(textBox1.Text); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = lista; }
public void CarregarGrid() { TratamentoBusiness business = new TratamentoBusiness(); List <TratamentoDTO> dto = new List <TratamentoDTO>(); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = dto; }
private void button1_Click(object sender, EventArgs e) { txtnome.Text = trate.Nome.ToString(); txtduração.Text = trate.Duracao.ToString(); txtvalor.Text = trate.Valor.ToString(); TratamentoBusiness business = new TratamentoBusiness(); business.Alterar(trate); MessageBox.Show("Tratamento alterado com sucesso"); tela_principal tela = new tela_principal(); tela.ShowDialog(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { TratamentoDTO dto = new TratamentoDTO(); dto.Nome = txtnome.Text; dto.Valor = Convert.ToDecimal(txtvalor.Text); dto.Duracao = Convert.ToInt32(txtduracao.Text); TratamentoBusiness business = new TratamentoBusiness(); business.Salvar(dto); MessageBox.Show("Tratemento cadastrado com sucesso"); tela_principal tela = new tela_principal(); tela.Show(); this.Hide(); }