Exemple #1
0
        private void Pesquisa()
        {
            CreaterCursor Cr = new CreaterCursor();

            this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("CODLOTE", "System.String", "=", txtNumeroLote.Text));
                RowRelatorio.Add(new RowsFiltro("IDPRODUTO", "System.Int32", "=", cbProduto.SelectedValue.ToString()));
                RowRelatorio.Add(new RowsFiltro("FLAGATIVO", "System.String", "=", "S"));

                LIS_ESTOQUELOTEColl = LIS_ESTOQUELOTEP.ReadCollectionByParameter(RowRelatorio, "DATA");

                //Busca Saldo
                Decimal SaldoLote = SaldoProduto();
                LIS_ESTOQUELOTEEntity LIS_ESTOQUELOTETy = new LIS_ESTOQUELOTEEntity();
                LIS_ESTOQUELOTETy.CODLOTE    = "Saldo: ";
                LIS_ESTOQUELOTETy.QUANTIDADE = SaldoLote;
                LIS_ESTOQUELOTEColl.Add(LIS_ESTOQUELOTETy);

                DataGriewDados.AutoGenerateColumns = false;
                DataGriewDados.DataSource          = LIS_ESTOQUELOTEColl;

                lblTotalPesquisa.Text = LIS_ESTOQUELOTEColl.Count.ToString();

                PaintGrid();

                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;

                MessageBox.Show("Erro técnico: " + ex.Message,
                                ConfigSistema1.Default.NomeEmpresa,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
        }
Exemple #2
0
        private static LIS_ESTOQUELOTECollection ExecuteReader(ref LIS_ESTOQUELOTECollection collection, ref FbDataReader dataReader, FbCommand dbCommand)
        {
            using (dataReader = dbCommand.ExecuteReader())
            {
                collection = new LIS_ESTOQUELOTECollection();

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        collection.Add(FillEntityObject(ref dataReader));
                    }
                }

                if (!(dataReader.IsClosed))
                {
                    dataReader.Close();
                }
                dataReader.Dispose();
            }

            return(collection);
        }