Пример #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            Servico   serv      = new Servico();
            ServicoBO servicoBO = new ServicoBO();

            serv.Codservico = Convert.ToInt16(txtCod.Text);
            serv.Tipo       = cmbTipo.SelectedItem.ToString().ToUpper();
            serv.Porte      = cmbPorte.SelectedItem.ToString().ToUpper();
            serv.Valor      = Convert.ToDecimal(txtValor.Text);

            servicoBO.Editar(serv);
            MessageBox.Show("Servico Editado com Sucesso!");
        }
Пример #2
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            Servico   serv      = new Servico();
            ServicoBO servicoBO = new ServicoBO();

            try
            {
                serv.Codservico = Convert.ToInt16(txtCod.Text);


                dataGridView1.DataSource = servicoBO.BuscaCod(serv);
            }
            catch
            {
                MessageBox.Show("Preencha  corretamente as informações!!");
            }
        }