private void CarregarDados() { gerenciadorPlantaoBLL = new BLL.GerenciadorPlantaoServices(); dgvAgentes.DataSource = gerenciadorPlantaoBLL.CarregarAgentes(); cmbPlantao.DataSource = gerenciadorPlantaoBLL.CarregarPlantao(); cmbPlantao.DisplayMember = "nome_plantao"; cmbPlantao.ValueMember = "id"; cmbPlantao.SelectedIndex = -1; cmbEquipe.DataSource = gerenciadorPlantaoBLL.CarregarEquipes(); cmbEquipe.DisplayMember = "nome_equipe"; cmbEquipe.ValueMember = "id"; cmbEquipe.SelectedIndex = -1; cmbPosicao.DataSource = gerenciadorPlantaoBLL.CarregarPosicao(); cmbPosicao.DisplayMember = "posicao"; cmbPosicao.ValueMember = "id"; cmbPosicao.SelectedIndex = -1; }
private void btnSalvar_Click(object sender, EventArgs e) { Salvar(); gerenciadorPlantaoBLL = new BLL.GerenciadorPlantaoServices(); dgvAgentes.DataSource = gerenciadorPlantaoBLL.CarregarAgentes(); }
private void Salvar() { gerenciadorPlantaoBLL = new BLL.GerenciadorPlantaoServices(); MessageBox.Show(gerenciadorPlantaoBLL.AlterarPlantao(id, Convert.ToInt16(cmbPlantao.SelectedValue), Convert.ToInt16(cmbEquipe.SelectedValue), Convert.ToInt16(cmbPosicao.SelectedValue))); }