Example #1
0
        private void BtnGerarRelatorio_Click(object sender, EventArgs e)
        {
            frmGerarRel frmGerar = new frmGerarRel();

            new frmGerarRel().Show();
            this.Hide();
        }
Example #2
0
        private void dgvMoto_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //verifica se existe itens na grid
            if (dgvMoto.RowCount == 0)
            {
                return;
            }
            //carrega a tela com todos os dados do cliente
            OleDbDataReader drReader;
            clMotorista     clMotorista = new clMotorista();

            clMotorista.banco = Properties.Settings.Default.conexaoDB;
            drReader          = clMotorista.PesquisarCodigo(Convert.ToInt32(dgvMoto.CurrentRow.Cells[0].Value));
            if (Funcao == "inicio")
            {
                if (drReader.Read())
                {
                    frmCadastrarMotorista frmCadastrarMotorista = new frmCadastrarMotorista();

                    frmCadastrarMotorista.nome        = drReader["Nome"].ToString();
                    frmCadastrarMotorista.idMotorista = drReader["idMotorista"].ToString();
                    frmCadastrarMotorista.cnh         = drReader["CNH"].ToString();
                    frmCadastrarMotorista.telefone    = drReader["Telefone"].ToString();
                    drReader.Close();
                    new frmCadastrarMotorista().Show();
                    this.Close();
                }
            }
            if (Funcao == "lancar")
            {
                if (drReader.Read())
                {
                    frmLancarFrete frmLancarFrete = new frmLancarFrete();
                    frmLancarFrete.nome        = drReader["Nome"].ToString();
                    frmLancarFrete.idMotorista = drReader["idMotorista"].ToString();
                    drReader.Close();
                    new frmLancarFrete().Show();
                    this.Close();
                }
            }
            if (Funcao == "editar")
            {
                if (drReader.Read())
                {
                    frmPesquisarFrete frmPesquisarFrete = new frmPesquisarFrete();
                    frmPesquisarFrete.nome        = drReader["Nome"].ToString();
                    frmPesquisarFrete.idMotorista = drReader["idMotorista"].ToString();
                    drReader.Close();
                    new frmPesquisarFrete().Show();
                    this.Close();
                }
            }
            if (Funcao == "relatorio")
            {
                if (drReader.Read())
                {
                    frmGerarRel frmGerarRel = new frmGerarRel();
                    frmGerarRel.nome        = drReader["Nome"].ToString();
                    frmGerarRel.idMotorista = drReader["idMotorista"].ToString();
                    drReader.Close();
                    new frmGerarRel().Show();
                    this.Close();
                }
            }
        }