private void txtNomePesquisa_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { btnPesquisa_Click(null, null); } else if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) { DataGriewDados.Focus(); } }
private void PreencheGrid() { QuantTotal = 0; ValorTotal = 0; ValotTotalGeral = 0; CreaterCursor Cr = new CreaterCursor(); this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0); DataGriewDados.Rows.Clear(); //DataGridViewRow rowTop = new DataGridViewRow(); //rowTop.CreateCells(DataGriewDados, "_________", "___________________________________________________________", "_______", "_______"); //rowTop.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold); //DataGriewDados.Rows.Add(rowTop); //DataGridViewRow row1 = new DataGridViewRow(); //row1.CreateCells(DataGriewDados, "Ranking", "Descrição", "Quantidade", "Total R$"); //row1.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold); //DataGriewDados.Rows.Add(row1); foreach (var LIS_PRODUTOSPEDIDOTy in LIS_PRODUTOSPEDIDOColl) { QuantTotal = 0; ValorTotal = 0; QuantProduto(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDPRODUTO)); ValotTotalGeral += ValorTotal; DataGridViewRow row2 = new DataGridViewRow(); row2.CreateCells(DataGriewDados, "", LIS_PRODUTOSPEDIDOTy.NOMEPRODUTO, QuantTotal, ValorTotal.ToString("n2")); row2.DefaultCellStyle.Font = new Font("Arial", 8); DataGriewDados.Rows.Add(row2); } DataGriewDados.Sort(DataGriewDados.Columns["quantidade"], ListSortDirection.Descending); //DataGridViewRow rowLinha_1 = new DataGridViewRow(); //rowLinha_1.CreateCells(DataGriewDados, "_________", "___________________________________________________________", "_______", "_______"); //rowLinha_1.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold); //DataGriewDados.Rows.Add(rowLinha_1); 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; }
private void PreencheGrid() { QuantTotal = 0; ValorTotal = 0; ValotTotalGeral = 0; CreaterCursor Cr = new CreaterCursor(); this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0); DataGriewDados.Rows.Clear(); foreach (var LIS_PRODUTOSPEDIDOTy in LIS_PRODUTOSPEDIDOColl) { QuantTotal = 0; ValorTotal = 0; QuantProduto(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDPRODUTO)); ValotTotalGeral += ValorTotal; string NomeMarca = string.Empty; if (LIS_PRODUTOSPEDIDOTy.IDMARCA != null && LIS_PRODUTOSPEDIDOTy.IDMARCA > 0) { NomeMarca = MARCAP.Read(Convert.ToInt32(LIS_PRODUTOSPEDIDOTy.IDMARCA)).NOME; } DataGridViewRow row2 = new DataGridViewRow(); row2.CreateCells(DataGriewDados, "", LIS_PRODUTOSPEDIDOTy.IDPRODUTO.ToString(), LIS_PRODUTOSPEDIDOTy.NOMEPRODUTO, NomeMarca, QuantTotal, ValorTotal.ToString("n2")); row2.DefaultCellStyle.Font = new Font("Arial", 8); DataGriewDados.Rows.Add(row2); } DataGriewDados.Sort(DataGriewDados.Columns["quantidade"], ListSortDirection.Descending); 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; }
private void PreencheGrid() { CreaterCursor Cr = new CreaterCursor(); this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0); try { QuantTotal = 0; QuantSubTotal = 0; DataGriewDados.Rows.Clear(); foreach (var LIS_OCORRENCIATLMKTy in LIS_OCORRENCIATLMKColl) { QuantSubTotal = QuantOcorrencias(Convert.ToInt32(LIS_OCORRENCIATLMKTy.IDFUNCIONARIO)); QuantTotal += QuantSubTotal; DataGridViewRow row2 = new DataGridViewRow(); row2.CreateCells(DataGriewDados, "", LIS_OCORRENCIATLMKTy.NOMEFUNCIONARIO, QuantSubTotal); row2.DefaultCellStyle.Font = new Font("Arial", 8); DataGriewDados.Rows.Add(row2); } DataGriewDados.Sort(DataGriewDados.Columns["quantidade"], ListSortDirection.Descending); DataGridViewRow rowLinha = new DataGridViewRow(); rowLinha.CreateCells(DataGriewDados, "_________", "__________________________________________________________________ TOTAL GERAL: ", QuantTotal.ToString()); rowLinha.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold); DataGriewDados.Rows.Add(rowLinha); this.Cursor = Cursors.Default; } catch (Exception EX) { this.Cursor = Cursors.Default; MessageBox.Show("Erro técnico: " + EX.Message); } }
private void btnPesquisa_Click(object sender, EventArgs e) { if (Validacoes()) { CreaterCursor Cr = new CreaterCursor(); this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0); try { RowRelatorio.Clear(); string DataInicial = Util.ConverStringDateSearch(msktDataInicial.Text); string DataFinal = Util.ConverStringDateSearch(msktDataFinal.Text); RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", DataInicial, "and")); RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", DataFinal, "and")); if (rbOrcamentoPesquisa.Checked) { RowRelatorio.Add(new RowsFiltro("FLAGORCAMENTO", "System.String", "=", "S", "and")); } if (rbVendasPesquisa.Checked) { RowRelatorio.Add(new RowsFiltro("FLAGORCAMENTO", "System.String", "=", "N", "and")); } if (Convert.ToInt32(cbFuncionario.SelectedValue) > 0) { RowRelatorio.Add(new RowsFiltro("IDVENDEDOR", "System.Int32", "=", Convert.ToInt32(cbFuncionario.SelectedValue).ToString(), "and")); } if (Convert.ToInt32(cbSupervisor.SelectedValue) > 0) { RowRelatorio.Add(new RowsFiltro("IDSUPERVISOR", "System.Int32", "=", Convert.ToInt32(cbSupervisor.SelectedValue).ToString(), "and")); } DataGriewDados.Rows.Clear(); TotalGeralPedido = 0; TotalGeralComissao = 0; LIS_PEDIDOColl = LIS_PEDIDOP.ReadCollectionByParameter(RowRelatorio, "IDPEDIDO DESC"); lblTotalRegistros.Text = "Total de Registros: " + LIS_PEDIDOColl.Count.ToString(); PreencheGridProduto(); DataGriewDados.Sort(DataGriewDados.Columns["IDPEDIDO"], ListSortDirection.Descending); DataGridViewRow row3 = new DataGridViewRow(); row3.CreateCells(DataGriewDados, "", "", "", "Total Geral:", TotalGeralPedido.ToString("n2"), TotalGeralComissao.ToString("n2")); row3.DefaultCellStyle.Font = new Font("Arial", 8, FontStyle.Bold); DataGriewDados.Rows.Add(row3); this.Cursor = Cursors.Default; } catch (Exception EX) { this.Cursor = Cursors.Default; MessageBox.Show("Erro na pesquisa!"); MessageBox.Show("Erro técnico: " + EX.Message); } } }