private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            MySqlDataReader dr;
            Conexao         con = new Conexao();
            MySqlCommand    cmd = new MySqlCommand("select * from tb_orcamento where id_ocorrencia=@id", con.ConectarBD());

            cmd.Parameters.Add("@id", MySqlDbType.VarChar).Value = id_ocorrencia;

            dr = cmd.ExecuteReader();
            if (dr.HasRows)
            {
                tela_orcamento tela = new tela_orcamento();
                tela.Show();
                tela.btnEditar.Visible = true;
                if (Variaveis_globais.cargo == "Gerência")
                {
                    tela.btnAprovar.Visible = true;
                    tela.btnReproar.Visible = true;
                    tela.label5.Visible     = true;
                    tela.txtMotivo.Visible  = true;
                }
                while (dr.Read())
                {
                    tela.lblNOcorrencia.Text  = dr[1].ToString();
                    tela.lblStatus.Text       = dr[2].ToString();
                    tela.cbbServico.Text      = dr[3].ToString();
                    tela.txtDsOcorrencia.Text = dr[4].ToString();
                    tela.dateTimePicker1.Text = dr[5].ToString();
                    tela.txtValor.Text        = dr[6].ToString();
                    tela.txtMotivo.Text       = dr[7].ToString();
                }
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            tela_orcamento tela = new tela_orcamento();

            tela.Show();
            tela.lblNOcorrencia.Text = txt_nm_ocorrencia.Text;
            tela.btnSalvar.Visible   = true;
        }