Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public void ValidaPedido()
 {
     try
     {
         DALConexao   cx        = new DALConexao(DadosDaConexao.StringDeConexao);
         BLLPCPEDC    blldup    = new BLLPCPEDC(cx);
         BLLPCPEDI    itens     = new BLLPCPEDI(cx);
         ModeloPCPEDC modelodup = blldup.CarregaPCPEDC(Convert.ToInt64(txtCodigo.Text));
         if (modelodup.origemped == "B")
         {
             frmMapa f = new frmMapa();
             f.numcar  = Convert.ToInt32(txtNumcar.Text);
             f.tipoimp = 2;
             tipodanfe = 1;
             f.Show();
         }
         else
         {
             blldup.DuplicaC(modelodup);
             blldup.DuplicaI(modelodup);
             //blldup.AlterarPediSel(modelodup);
             // blldup.AlterarPedSEL(modelodup);
             dgvItens.DataSource = "";
             dgvItens.DataSource = itens.Localizar(Convert.ToInt64(txtCodigo.Text));
         }
     }catch (Exception ex)
     {
         MessageBox.Show("Atenção: " + ex.Message, "Atenção!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }