private void btnCadastrar_Click(object sender, EventArgs e) { modelLogin.Consultar = false; modelLogin.Codigo = null; FrmCadastroLogin frmCadastroLogin = new FrmCadastroLogin(modelLogin); frmCadastroLogin.ShowDialog(); }
private void btnConsultar_Click(object sender, EventArgs e) { if (dgvLogin.Rows.Count == 0) { } else { modelLogin.Consultar = true; modelLogin.ID = dgvLogin.CurrentRow.Cells["id"].Value.ToString(); modelLogin.Senha = dgvLogin.CurrentRow.Cells["senha"].Value.ToString(); modelLogin.Nivel = dgvLogin.CurrentRow.Cells["nivel"].Value.ToString(); FrmCadastroLogin frmCadastroLogin = new FrmCadastroLogin(modelLogin); frmCadastroLogin.ShowDialog(); } }
private void btnEditar_Click(object sender, EventArgs e) { if (dgvLogin.Rows.Count == 0) { } else { modelLogin.Consultar = false; modelLogin.Codigo = dgvLogin.CurrentRow.Cells["codigo"].Value.ToString(); modelLogin.ID = dgvLogin.CurrentRow.Cells["id"].Value.ToString(); modelLogin.Senha = dgvLogin.CurrentRow.Cells["senha"].Value.ToString(); modelLogin.Nivel = dgvLogin.CurrentRow.Cells["nivel"].Value.ToString(); FrmCadastroLogin frmCadastroLogin = new FrmCadastroLogin(modelLogin); frmCadastroLogin.ShowDialog(); if (cbxFiltro.Text == "ADM") { Carregar("Administrador", txtProcurar.Text); } if (cbxFiltro.Text == "VENDEDOR") { Carregar("Vendedor", txtProcurar.Text); } if (cbxFiltro.Text == "ESTOQUISTA") { Carregar("Estoquista", txtProcurar.Text); } if (cbxFiltro.Text == "SUPERVISOR") { Carregar("Supervisor", txtProcurar.Text); } if (cbxFiltro.Text == "TODOS") { CarregarTodos(txtProcurar.Text); } lblExibidosTotal.Text = "Exibidos total: " + dgvLogin.Rows.Count; } }