Exemplo n.º 1
0
        private PRODUTOSEntity BuscaProduto(string CODPRODUTOFORNECEDOR)
        {
            PRODUTOSEntity result = new PRODUTOSEntity();

            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("CODPRODUTOFORNECEDOR", "System.String", "=", CODPRODUTOFORNECEDOR.ToString()));

                LIS_PRODUTOSCollection LIS_PRODUTOSColl = new LIS_PRODUTOSCollection();
                LIS_PRODUTOSProvider   LIS_PRODUTOSP    = new LIS_PRODUTOSProvider();

                LIS_PRODUTOSColl = LIS_PRODUTOSP.ReadCollectionByParameter(RowRelatorio);

                if (LIS_PRODUTOSColl.Count > 0)
                {
                    result = PRODUTOSP.Read(Convert.ToInt32(LIS_PRODUTOSColl[0].IDPRODUTO));
                }


                return(result);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
                return(result);
            }
        }
Exemplo n.º 2
0
        private void GetDropProdutos()
        {
            try
            {
                LIS_PRODUTOSProvider LIS_PRODUTOSP = new LIS_PRODUTOSProvider();
                LIS_PRODUTOSColl = LIS_PRODUTOSP.ReadCollectionByParameter(null, "NOMEPRODUTOCOD");

                cbProduto.DisplayMember = "NOMEPRODUTOCOD";
                cbProduto.ValueMember   = "IDPRODUTO";

                LIS_PRODUTOSEntity PRODUTOSTy = new LIS_PRODUTOSEntity();
                PRODUTOSTy.NOMEPRODUTOCOD = ConfigMessage.Default.MsgDrop;
                PRODUTOSTy.IDPRODUTO      = -1;
                LIS_PRODUTOSColl.Add(PRODUTOSTy);

                Phydeaux.Utilities.DynamicComparer <LIS_PRODUTOSEntity> comparer = new Phydeaux.Utilities.DynamicComparer <LIS_PRODUTOSEntity>(cbProduto.DisplayMember);

                LIS_PRODUTOSColl.Sort(comparer.Comparer);
                cbProduto.DataSource = LIS_PRODUTOSColl;

                cbProduto.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }