コード例 #1
0
        private void ListaProdutosNF(string NOTAFISCAL)
        {
            try
            {
                LIS_NOTAFISCALEProvider LIS_NOTAFISCALEP = new LIS_NOTAFISCALEProvider();

                RowsFiltroCollection RowNF = new RowsFiltroCollection();
                RowNF.Add(new RowsFiltro("NFISCALE", "System.String", "=", Util.RetiraLetras(NOTAFISCAL).ToString()));
                LIS_NOTAFISCALEColl = LIS_NOTAFISCALEP.ReadCollectionByParameter(RowNF);

                int IDNOTAFISCAL = -1;
                if (LIS_NOTAFISCALEColl.Count > 0)
                {
                    IDNOTAFISCAL = Convert.ToInt32(LIS_NOTAFISCALEColl[0].IDNOTAFISCALE);
                }


                LIS_PRODUTONFEProvider LIS_PRODUTONFEP = new LIS_PRODUTONFEProvider();

                RowsFiltroCollection RowRelatorio = new RowsFiltroCollection();
                RowRelatorio.Add(new RowsFiltro("IDNOTAFISCALE", "System.String", "=", IDNOTAFISCAL.ToString()));

                LIS_PRODUTONFEColl = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
コード例 #2
0
        private void AtualizaDadosNFE()
        {
            try
            {
                CreaterCursor Cr = new CreaterCursor();
                this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

                NOTAFISCALEProvider       NOTAFISCALEP         = new NOTAFISCALEProvider();
                LIS_NOTAFISCALEProvider   LIS_NOTAFISCALEP     = new LIS_NOTAFISCALEProvider();
                LIS_NOTAFISCALECollection LIS_NOTAFISCALEColl2 = new LIS_NOTAFISCALECollection();
                RowsFiltroCollection      RowRelatorio         = new RowsFiltroCollection();
                RowRelatorio.Add(new RowsFiltro("NFISCALE", "System.String", ">=", txtIni.Text.PadLeft(8, '0')));
                RowRelatorio.Add(new RowsFiltro("NFISCALE", "System.String", "<=", txtFim.Text.PadLeft(8, '0')));
                RowRelatorio.Add(new RowsFiltro("FLAGENVIADA", "System.String", "=", "N"));

                LIS_NOTAFISCALEColl2 = LIS_NOTAFISCALEP.ReadCollectionByParameter(RowRelatorio);

                if (LIS_NOTAFISCALEColl2.Count > 0)
                {
                    foreach (LIS_NOTAFISCALEEntity item in LIS_NOTAFISCALEColl2)
                    {
                        NOTAFISCALEEntity NOTAFISCALETy = new NOTAFISCALEEntity();
                        NOTAFISCALETy = NOTAFISCALEP.Read(Convert.ToInt32(item.IDNOTAFISCALE));
                        NOTAFISCALETy.FLAGINUTILIZADO = "S";
                        NOTAFISCALEP.Save(NOTAFISCALETy);
                    }

                    this.Cursor = Cursors.Default;
                }
                else
                {
                    this.Cursor = Cursors.Default;
                    MessageBox.Show("Não foi possível alterar as notas selecionadas!!");
                }

                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }