Exemple #1
0
        private LIS_PRODUTOSPEDOTICACollection ProdutoRel(int IDFECHOSERVICO)
        {
            LIS_PRODUTOSPEDOTICACollection LIS_PRODUTOSPEDOTICA2Coll = new LIS_PRODUTOSPEDOTICACollection();

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

            LIS_PRODUTOSPEDOTICA2Coll = LIS_PRODUTOSPEDOTICAP.ReadCollectionByParameter(RowRelatorio);

            return(LIS_PRODUTOSPEDOTICA2Coll);
        }
Exemple #2
0
        private LIS_PRODUTOSPEDOTICACollection ProdutoRel(int IDPEDIDOOTICA)
        {
            LIS_PRODUTOSPEDOTICACollection LIS_PRODUTOSPEDIDOColl = new LIS_PRODUTOSPEDOTICACollection();
            LIS_PRODUTOSPEDOTICAProvider   LIS_PRODUTOSPEDIDOP    = new LIS_PRODUTOSPEDOTICAProvider();

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

            LIS_PRODUTOSPEDIDOColl = LIS_PRODUTOSPEDIDOP.ReadCollectionByParameter(RowRelatorio);

            return(LIS_PRODUTOSPEDIDOColl);
        }
Exemple #3
0
        private void QuantProduto(int IDPRODUTO)
        {
            LIS_PRODUTOSPEDOTICACollection LIS_PRODUTOSPEDIDOColl = new LIS_PRODUTOSPEDOTICACollection();
            LIS_PRODUTOSPEDOTICAProvider   LIS_PRODUTOSPEDIDOP    = new LIS_PRODUTOSPEDOTICAProvider();

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

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

            LIS_PRODUTOSPEDIDOColl = LIS_PRODUTOSPEDIDOP.ReadCollectionByParameter(RowRelatorio);

            foreach (var LIS_PRODUTOSPEDIDOTy in LIS_PRODUTOSPEDIDOColl)
            {
                QuantTotal += Convert.ToDecimal(LIS_PRODUTOSPEDIDOTy.QUANTIDADE);
                ValorTotal += Convert.ToDecimal(LIS_PRODUTOSPEDIDOTy.VALORTOTAL);
            }
        }
Exemple #4
0
        private void btnPesquisa_Click(object sender, EventArgs e)
        {
            if (Validacoes())
            {
                try
                {
                    string DataInicial = Util.ConverStringDateSearch(msktDataInicial.Text);
                    string DataFinal   = Util.ConverStringDateSearch(msktDataFinal.Text);

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

                    LIS_PRODUTOSPEDIDOColl = LIS_PRODUTOSPEDIDOP.ReadCollectionByParameter(RowRelatorio);

                    //Remove ID  repetido
                    LIS_PRODUTOSPEDOTICACollection LIS_PRODUTOSPEDIDO2Coll = new LIS_PRODUTOSPEDOTICACollection();
                    foreach (LIS_PRODUTOSPEDOTICAEntity item in LIS_PRODUTOSPEDIDOColl)
                    {
                        if (LIS_PRODUTOSPEDIDO2Coll.Find(delegate(LIS_PRODUTOSPEDOTICAEntity item2)
                        {
                            return
                            (item2.IDPRODUTO == item.IDPRODUTO);
                        }) == null)
                        {
                            LIS_PRODUTOSPEDIDO2Coll.Add(item);
                        }
                    }

                    LIS_PRODUTOSPEDIDOColl.Clear();
                    LIS_PRODUTOSPEDIDOColl = LIS_PRODUTOSPEDIDO2Coll;

                    //Filtra Serviços
                    RowRelatorio.Clear();
                    RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", ">=", DataInicial));
                    RowRelatorio.Add(new RowsFiltro("DTEMISSAO", "System.DateTime", "<=", DataFinal));
                    LIS_SERVICOPEDOTICAColl = LIS_SERVICOPEDOTICAP.ReadCollectionByParameter(RowRelatorio);

                    //Remove ID  repetido
                    LIS_SERVICOPEDOTICACollection LIS_SERVICOPEDOTICA2Coll = new LIS_SERVICOPEDOTICACollection();
                    foreach (LIS_SERVICOPEDOTICAEntity item in LIS_SERVICOPEDOTICAColl)
                    {
                        if (LIS_SERVICOPEDOTICA2Coll.Find(delegate(LIS_SERVICOPEDOTICAEntity item2)
                        {
                            return
                            (item2.IDSERVICO == item.IDSERVICO);
                        }) == null)
                        {
                            LIS_SERVICOPEDOTICA2Coll.Add(item);
                        }
                    }

                    LIS_SERVICOPEDOTICAColl.Clear();
                    LIS_SERVICOPEDOTICAColl = LIS_SERVICOPEDOTICA2Coll;

                    PreencheGrid();
                    PreencheGridServico();
                }
                catch (Exception EX)
                {
                    MessageBox.Show("Erro na pesquisa!");
                    MessageBox.Show("Erro técnico: " + EX.Message);
                }
            }
        }