Exemple #1
0
        private void PreencheGrid()
        {
            ValotTotalGeral = 0;

            CreaterCursor Cr = new CreaterCursor();

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

            DataGriewDados.Rows.Clear();
            CUPOMELETRONICOProvider CUPOMELETRONICOP = new CUPOMELETRONICOProvider();

            foreach (var LIS_PRODUTONFCETy in LIS_PRODUTONFCEColl)
            {
                CUPOMELETRONICOEntity CUPOMELETRONICOTy = new CUPOMELETRONICOEntity();
                CUPOMELETRONICOTy = CUPOMELETRONICOP.Read(Convert.ToInt32(LIS_PRODUTONFCETy.CUPOMELETRONICOID));
                string NumCupom   = CUPOMELETRONICOTy.NUMERONFCE.ToString();
                string Data       = Convert.ToDateTime(CUPOMELETRONICOTy.DTEMISSAO).ToString("dd/MM/yyyy");
                string Produto    = LIS_PRODUTONFCETy.NOMEPRODUTO;
                string Quantidade = Convert.ToDecimal(LIS_PRODUTONFCETy.QUANTIDADE).ToString("n3");
                string VlUnit     = Convert.ToDecimal(LIS_PRODUTONFCETy.VALORUNITARIO).ToString("n3");
                string VlTotal    = Convert.ToDecimal(LIS_PRODUTONFCETy.VALORTOTAL).ToString("n2");

                ValotTotalGeral += Convert.ToDecimal(LIS_PRODUTONFCETy.VALORTOTAL);

                DataGridViewRow row2 = new DataGridViewRow();
                row2.CreateCells(DataGriewDados, NumCupom, Data, Produto, Quantidade, VlUnit, VlTotal);
                row2.DefaultCellStyle.Font = new Font("Arial", 8);
                DataGriewDados.Rows.Add(row2);
            }

            DataGridViewRow rowLinha = new DataGridViewRow();

            rowLinha.CreateCells(DataGriewDados, "", "", "", "", "Total Geral: ", ValotTotalGeral.ToString("n2"));
            rowLinha.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold);
            DataGriewDados.Rows.Add(rowLinha);

            this.Cursor = Cursors.Default;
        }