Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            ExibeOS eos = new ExibeOS(textBox1.Text);

            TADescritivo.Text = eos.ExibeDescricao;
            TACPF.Text        = eos.ExibeCPF;
            TAPlaca.Text      = eos.ExibePlaca;
            TANome.Text       = eos.ExibeNome;
            TATelefone.Text   = eos.ExibeTel;
            TAANO.Text        = eos.ExibeAno;
            TAModelo.Text     = eos.ExibeModelo;
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            ExibeOS      eos = new ExibeOS(textBox3.Text);
            ExibePecasOS epo = new ExibePecasOS(textBox3.Text);


            string sql = $"select QTTD_PECA,COD_PECA from Consulta_Banco where NUM_ORC={textBox3.Text}";

            try
            {
                SqlCommand    cmd    = new SqlCommand(sql, conexao.conectar());
                SqlDataReader leitor = cmd.ExecuteReader();
                textBox1.Text += ("---------------------PEÇAS---------------------" + System.Environment.NewLine);

                while (leitor.Read())
                {
                    textBox1.Text += "Peça: " + leitor[0].ToString() + ", Valor: R$ " + leitor[1].ToString() + System.Environment.NewLine;
                    //Console.WriteLine("Peça: " + leitor[0].ToString() + ", Valor: R$ " + leitor[1].ToString() + System.Environment.NewLine);
                    i++;
                }
                textBox1.Text += "-----------------------------------------------" + System.Environment.NewLine + System.Environment.NewLine;
                conexao.desconectar();
            }
            catch (SqlException)
            {
                this.mensagem = "Erro ao Buscar Itens!!";
                // Console.WriteLine(e);
            }

            string sql1 = $"select * from Orcamentos where NUM_ORC={textBox3.Text}";

            try
            {
                SqlCommand    cmd    = new SqlCommand(sql1, conexao.conectar());
                SqlDataReader leitor = cmd.ExecuteReader();

                while (leitor.Read())
                {
                    textBox1.Text += ("---------------------ORDEM DE SERVIÇO---------------------" + System.Environment.NewLine + System.Environment.NewLine +
                                      "Numero OS: " + leitor[0].ToString() + System.Environment.NewLine +
                                      "Descrição OS: " + leitor[1].ToString() + System.Environment.NewLine +
                                      "CPF: " + leitor[2].ToString() + System.Environment.NewLine +
                                      "Placa: " + leitor[3].ToString() + System.Environment.NewLine +
                                      "Nome: " + leitor[4].ToString() + System.Environment.NewLine +
                                      "Telefone: " + leitor[5].ToString() + System.Environment.NewLine +
                                      "Ano de Fabricação: " + leitor[6].ToString() + System.Environment.NewLine +
                                      "Kilometragem: " + leitor[8].ToString() + System.Environment.NewLine +
                                      "Modelo: " + leitor[7].ToString() + System.Environment.NewLine +
                                      "Valor Peças: " + leitor[9].ToString() + System.Environment.NewLine +
                                      "Valor Mão de Obra: " + leitor[10].ToString() + System.Environment.NewLine +
                                      "Valor Total: " + leitor[11].ToString() + System.Environment.NewLine + System.Environment.NewLine +
                                      "----------------------------------------------------------" + System.Environment.NewLine + System.Environment.NewLine +
                                      "OFICINA ABELHA");
                    // textBox2.Text = (leitor[1].ToString());
                }
                conexao.desconectar();
            }
            catch (SqlException)
            {
                this.mensagem = "Erro ao Buscar Itens!!";
                // Console.WriteLine(e);
            }


            //TODescritivo.Text = eos.ExibeDescricao;
            //TOCPF.Text = eos.ExibeCPF;
            //TOPlaca.Text = eos.ExibePlaca;
            //TONome.Text = eos.ExibeNome;
            //TOTelefone.Text = eos.ExibeTel;
            //TOANO.Text = eos.ExibeAno;
            //TOModelo.Text = eos.ExibeModelo;
            //TOKM.Text = eos.ExibeKM;
            //textBox2.Text = eos.ExibeValorPec;
            //TOMao.Text = eos.ExibeValorMao;
            //textBox4.Text = eos.ExibeValorTotal;
        }