private void dgvServico_CellContentClick(object sender, DataGridViewCellEventArgs e) { RepositorioServico repositorios = new RepositorioServico(); TelaRelatorio servico = new TelaRelatorio(); if (e.RowIndex >= 0) { servico.txtCodigo.Text = dgvServico.Rows[e.RowIndex].Cells[0].Value.ToString(); servico.txtEmpresa.Text = dgvServico.Rows[e.RowIndex].Cells[1].Value.ToString(); servico.txtDtInicio.Text = dgvServico.Rows[e.RowIndex].Cells[7].Value.ToString(); servico.txtDtTermino.Text = dgvServico.Rows[e.RowIndex].Cells[8].Value.ToString(); servico.txtValor.Text = dgvServico.Rows[e.RowIndex].Cells[9].Value.ToString(); servico.txtDescricao.Text = dgvServico.Rows[e.RowIndex].Cells[10].Value.ToString(); servico.cmbSituacao.Text = dgvServico.Rows[e.RowIndex].Cells[11].Value.ToString(); servico.txtRelatorio.Text = dgvServico.Rows[e.RowIndex].Cells[12].Value.ToString(); servico.ShowDialog(); } }
/// <summary> /// Contrutor da Classe de Negócio de Utilidades /// </summary> public NegocioServicos() { this.repositorio = new RepositorioServico(); }
public void selecionar(object sender, DataGridViewCellEventArgs e) { if (cmbPorTipo.Text == "Cliente") { RepositorioCliente repositorioc = new RepositorioCliente(); TelaCliente cliente = new TelaCliente(); if (e.RowIndex >= 0) { cliente.txtNome.Text = dgvConsulta.Rows[e.RowIndex].Cells[1].Value.ToString(); cliente.txtcpfCnpj.Text = dgvConsulta.Rows[e.RowIndex].Cells[2].Value.ToString(); cliente.txtEnd.Text = dgvConsulta.Rows[e.RowIndex].Cells[3].Value.ToString(); cliente.txtCid.Text = dgvConsulta.Rows[e.RowIndex].Cells[4].Value.ToString(); cliente.cboUf.Text = dgvConsulta.Rows[e.RowIndex].Cells[5].Value.ToString(); cliente.txtComplemento.Text = dgvConsulta.Rows[e.RowIndex].Cells[6].Value.ToString(); cliente.txtCep.Text = dgvConsulta.Rows[e.RowIndex].Cells[7].Value.ToString(); cliente.txtEmail.Text = dgvConsulta.Rows[e.RowIndex].Cells[8].Value.ToString(); cliente.txtFoneFax.Text = dgvConsulta.Rows[e.RowIndex].Cells[9].Value.ToString(); cliente.ShowDialog(); } } if (cmbPorTipo.Text == "Funcionário") { RepositorioFuncionario repositoriof = new RepositorioFuncionario(); TelaFuncionario funcionario = new TelaFuncionario(); if (e.RowIndex >= 0) { funcionario.txtNome.Text = dgvConsulta.Rows[e.RowIndex].Cells[1].Value.ToString(); funcionario.txtSenha.Text = dgvConsulta.Rows[e.RowIndex].Cells[2].Value.ToString(); funcionario.txtcpfCnpj.Text = dgvConsulta.Rows[e.RowIndex].Cells[3].Value.ToString(); funcionario.txtEnd.Text = dgvConsulta.Rows[e.RowIndex].Cells[4].Value.ToString(); funcionario.txtCid.Text = dgvConsulta.Rows[e.RowIndex].Cells[5].Value.ToString(); funcionario.txtCep.Text = dgvConsulta.Rows[e.RowIndex].Cells[6].Value.ToString(); funcionario.txtEmail.Text = dgvConsulta.Rows[e.RowIndex].Cells[7].Value.ToString(); funcionario.txtFone.Text = dgvConsulta.Rows[e.RowIndex].Cells[8].Value.ToString(); funcionario.cboUf.Text = dgvConsulta.Rows[e.RowIndex].Cells[9].Value.ToString(); funcionario.picUsuario.ImageLocation = dgvConsulta.Rows[e.RowIndex].Cells[10].Value.ToString(); funcionario.ShowDialog(); } } if (cmbPorTipo.Text == "Serviço") { RepositorioServico repositorios = new RepositorioServico(); TelaServico servico = new TelaServico(); if (e.RowIndex >= 0) { servico.txtempresa.Text = dgvConsulta.Rows[e.RowIndex].Cells[1].Value.ToString(); servico.txtcpfCnpj.Text = dgvConsulta.Rows[e.RowIndex].Cells[2].Value.ToString(); servico.txtEndereco.Text = dgvConsulta.Rows[e.RowIndex].Cells[3].Value.ToString(); servico.txtCidade.Text = dgvConsulta.Rows[e.RowIndex].Cells[4].Value.ToString(); servico.cmbUf.Text = dgvConsulta.Rows[e.RowIndex].Cells[5].Value.ToString(); servico.txtCep.Text = dgvConsulta.Rows[e.RowIndex].Cells[6].Value.ToString(); servico.txtdataInicio.Text = dgvConsulta.Rows[e.RowIndex].Cells[7].Value.ToString(); servico.txtdataTermino.Text = dgvConsulta.Rows[e.RowIndex].Cells[8].Value.ToString(); servico.txtValor.Text = dgvConsulta.Rows[e.RowIndex].Cells[9].Value.ToString(); servico.txtdescricaoDoServico.Text = dgvConsulta.Rows[e.RowIndex].Cells[11].Value.ToString(); servico.cmbSituacao.Text = dgvConsulta.Rows[e.RowIndex].Cells[12].Value.ToString(); servico.ShowDialog(); } } if (cmbPorTipo.Text == "Equipamento") { RepositorioEquipamento repositorioe = new RepositorioEquipamento(); TelaEquipamento equipamento = new TelaEquipamento(); if (e.RowIndex >= 0) { equipamento.txtMaterial.Text = dgvConsulta.Rows[e.RowIndex].Cells[1].Value.ToString(); equipamento.txtMarca.Text = dgvConsulta.Rows[e.RowIndex].Cells[2].Value.ToString(); equipamento.txtEspecificacao.Text = dgvConsulta.Rows[e.RowIndex].Cells[4].Value.ToString(); equipamento.txtPreco.Text = dgvConsulta.Rows[e.RowIndex].Cells[5].Value.ToString(); equipamento.txtQuantidade.Text = dgvConsulta.Rows[e.RowIndex].Cells[6].Value.ToString(); equipamento.ShowDialog(); } } }
public GerenciadorServico() { persistencia = new RepositorioServico(); }