Exemple #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);
            }
        }
Exemple #2
0
        private LIS_PRODUTONFECollection BuscaProdutoCFOP(int IDCFOP)
        {
            LIS_PRODUTONFECollection LIS_PRODUTONFEColl = new LIS_PRODUTONFECollection();

            try
            {
                LIS_PRODUTONFEProvider LIS_PRODUTONFEP = new LIS_PRODUTONFEProvider();
                RowRelatorio.Clear();
                string DataInicial = Util.ConverStringDateSearch(msktDataInicial.Text);
                string DataFinal   = Util.ConverStringDateSearch(msktDataFinal.Text);

                RowRelatorio.Add(new RowsFiltro("IDCFOP", "System.Int32", "=", IDCFOP.ToString()));

                RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", DataInicial));
                RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", DataFinal));

                RowRelatorio.Add(new RowsFiltro("FLAGENVIADA", "System.String", "=", "S"));
                RowRelatorio.Add(new RowsFiltro("FLAGCANCELADA", "System.String", "=", "N"));


                LIS_PRODUTONFECollection LIS_PRODUTONFEColl_2 = new LIS_PRODUTONFECollection();
                LIS_PRODUTONFEColl_2 = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio);
                return(LIS_PRODUTONFEColl_2);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
                return(LIS_PRODUTONFEColl);
            }
        }
Exemple #3
0
        private decimal TotalValorProdutoAgrupado(int IDPRODUTO, int COD_MUN_IBGE)
        {
            decimal result = 0;

            LIS_PRODUTONFECollection LIS_PRODUTONFEColl = new LIS_PRODUTONFECollection();
            LIS_PRODUTONFEProvider   LIS_PRODUTONFEP    = new LIS_PRODUTONFEProvider();

            RowRelatorio.Clear();
            string DataInicial = Util.ConverStringDateSearch(msktDataInicial.Text);
            string DataFinal   = Util.ConverStringDateSearch(msktDataFinal.Text);

            RowRelatorio.Add(new RowsFiltro("IDPRODUTO", "System.Int32", "=", IDPRODUTO.ToString()));
            RowRelatorio.Add(new RowsFiltro("COD_MUN_IBGE", "System.Int32", "=", COD_MUN_IBGE.ToString()));

            if (Convert.ToInt32(cbFuncionario.SelectedValue) > 0)
            {
                RowRelatorio.Add(new RowsFiltro("IDVENDEDOR", "System.Int32", "=", Convert.ToInt32(cbFuncionario.SelectedValue).ToString()));
            }

            if (Convert.ToInt32(cbProduto.SelectedValue) > 0)
            {
                RowRelatorio.Add(new RowsFiltro("IDPRODUTO", "System.Int32", "=", Convert.ToInt32(cbProduto.SelectedValue).ToString()));
            }


            if (Convert.ToInt32(cbTransportador.SelectedValue) > 0)
            {
                RowRelatorio.Add(new RowsFiltro("IDTRANSPORTES", "System.Int32", "=", Convert.ToInt32(cbTransportador.SelectedValue).ToString()));
            }


            RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", DataInicial));
            RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", DataFinal));

            if (Convert.ToInt32(cbStatus.SelectedValue) > 0)
            {
                RowRelatorio.Add(new RowsFiltro("IDSTATUS", "System.Int32", "=", Convert.ToInt32(cbStatus.SelectedValue).ToString()));
            }

            if (txtCidade1.Text.Trim() != string.Empty)
            {
                RowRelatorio.Add(new RowsFiltro("COD_MUN_IBGE", "System.Int32", "=", _COD_MUN_IBGE.ToString()));
            }

            if (chkNFeEnviada.Checked)
            {
                RowRelatorio.Add(new RowsFiltro("FLAGENVIADA", "System.String", "=", "S"));
            }

            if (Convert.ToInt32(cbFuncionario.SelectedValue) > 0)
            {
                LIS_PRODUTONFEColl = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio, "NOMEPRODUTO, NOTAFISCALE");
            }
            else
            {
                LIS_PRODUTONFEColl = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio, "NOMEPRODUTO, NOTAFISCALE");
            }

            foreach (var item in LIS_PRODUTONFEColl)
            {
                result += Convert.ToDecimal(item.VALORTOTAL);
            }


            return(result);
        }
Exemple #4
0
        private LIS_PRODUTONFECollection BuscaProdutoNFePelaCidade(int COD_MUN_IBGE)
        {
            LIS_PRODUTONFECollection LIS_PRODUTONFEColl = new LIS_PRODUTONFECollection();

            try
            {
                LIS_PRODUTONFEProvider LIS_PRODUTONFEP = new LIS_PRODUTONFEProvider();
                RowRelatorio.Clear();
                string DataInicial = Util.ConverStringDateSearch(msktDataInicial.Text);
                string DataFinal   = Util.ConverStringDateSearch(msktDataFinal.Text);

                RowRelatorio.Add(new RowsFiltro("COD_MUN_IBGE", "System.Int32", "=", COD_MUN_IBGE.ToString()));

                if (Convert.ToInt32(cbFuncionario.SelectedValue) > 0)
                {
                    RowRelatorio.Add(new RowsFiltro("IDVENDEDOR", "System.Int32", "=", Convert.ToInt32(cbFuncionario.SelectedValue).ToString()));
                }

                if (Convert.ToInt32(cbProduto.SelectedValue) > 0)
                {
                    RowRelatorio.Add(new RowsFiltro("IDPRODUTO", "System.Int32", "=", Convert.ToInt32(cbProduto.SelectedValue).ToString()));
                }


                if (Convert.ToInt32(cbTransportador.SelectedValue) > 0)
                {
                    RowRelatorio.Add(new RowsFiltro("IDTRANSPORTES", "System.Int32", "=", Convert.ToInt32(cbTransportador.SelectedValue).ToString()));
                }


                RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", DataInicial));
                RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", DataFinal));

                if (Convert.ToInt32(cbStatus.SelectedValue) > 0)
                {
                    RowRelatorio.Add(new RowsFiltro("IDSTATUS", "System.Int32", "=", Convert.ToInt32(cbStatus.SelectedValue).ToString()));
                }

                if (txtCidade1.Text.Trim() != string.Empty)
                {
                    RowRelatorio.Add(new RowsFiltro("COD_MUN_IBGE", "System.Int32", "=", _COD_MUN_IBGE.ToString()));
                }

                if (chkNFeEnviada.Checked)
                {
                    RowRelatorio.Add(new RowsFiltro("FLAGENVIADA", "System.String", "=", "S"));
                    RowRelatorio.Add(new RowsFiltro("FLAGCANCELADA", "System.String", "=", "N"));
                }

                if (Convert.ToInt32(cbFuncionario.SelectedValue) > 0)
                {
                    LIS_PRODUTONFEColl = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio, "NOMEPRODUTO, NOTAFISCALE");
                }
                else
                {
                    LIS_PRODUTONFEColl = LIS_PRODUTONFEP.ReadCollectionByParameter(RowRelatorio, "NOMEPRODUTO, NOTAFISCALE");
                }


                LIS_PRODUTONFECollection LIS_PRODUTONFEColl_2 = new LIS_PRODUTONFECollection();
                if (chkAgruparProduto.Checked)
                {
                    //Remove os produtos Repetidos
                    foreach (LIS_PRODUTONFEEntity item in LIS_PRODUTONFEColl)
                    {
                        if (LIS_PRODUTONFEColl_2.Find(delegate(LIS_PRODUTONFEEntity item2) { return(item2.IDPRODUTO == item.IDPRODUTO); }) == null)
                        {
                            LIS_PRODUTONFEColl_2.Add(item);
                        }
                    }

                    LIS_PRODUTONFEColl = LIS_PRODUTONFEColl_2;
                }

                return(LIS_PRODUTONFEColl);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
                return(LIS_PRODUTONFEColl);
            }
        }