Esempio n. 1
0
        private static LIS_PEDIDOOTICACollection ExecuteReader(ref LIS_PEDIDOOTICACollection collection, ref FbDataReader dataReader, FbCommand dbCommand)
        {
            using (dataReader = dbCommand.ExecuteReader())
            {
                collection = new LIS_PEDIDOOTICACollection();

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

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

            return(collection);
        }
Esempio n. 2
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            RowRelatorio.Clear();
            RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", Util.ConverStringDateSearch(mkDtInicial.Text)));
            RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", Util.ConverStringDateSearch(mkdatafinal.Text)));

            LIS_PEDIDOColl.Clear();

            LIS_PEDIDOColl = LIS_PEDIDOP.ReadCollectionByParameter(RowRelatorio, "IDPEDIDOOTICA, DTEMISSAO DESC");

            //Colocando somatorio no final da lista
            LIS_PEDIDOOTICAEntity LIS_PEDIDOTy = new LIS_PEDIDOOTICAEntity();

            LIS_PEDIDOTy.TOTALPEDIDO = SumTotalPesquisa("TOTALPEDIDO");

            LIS_PEDIDOColl.Add(LIS_PEDIDOTy);

            lblTotalRegistros.Text = "Total de Registros: " + (LIS_PEDIDOColl.Count - 1).ToString();

            DataGridRelaPedido.AutoGenerateColumns = false;
            DataGridRelaPedido.DataSource          = LIS_PEDIDOColl;

            AddGridFormaPagto();
        }