Exemplo n.º 1
0
        private Boolean LoteExiste(string CodLote)
        {
            Boolean Result = false;

            try
            {
                if (CodLote.Trim() != string.Empty)
                {
                    RowRelatorio.Clear();
                    RowRelatorio.Add(new RowsFiltro("CODLOTE", "System.String", "=", CodLote));
                    LOTEColl.Clear();
                    LOTEColl = LOTEP.ReadCollectionByParameter(RowRelatorio);

                    if (LOTEColl.Count > 0)
                    {
                        GetProdutoLote();
                        Result = true;
                    }
                    else
                    {
                        MessageBox.Show("Lote: " + CodLote + " Não Existe!");
                        txtNumeroLote.Focus();
                    }
                }

                return(Result);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro Técnico: " + ex.Message);
                return(Result);
            }
        }
Exemplo n.º 2
0
        private void BuscaCodLote(int IDLOTE)
        {
            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("IDLOTE", "System.Int32", "=", IDLOTE.ToString()));
                LOTEColl.Clear();
                LOTEColl = LOTEP.ReadCollectionByParameter(RowRelatorio);

                if (LOTEColl.Count > 0)
                {
                    txtNumeroLote.Text = LOTEColl[0].CODLOTE;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro Técnico: " + ex.Message);
            }
        }
Exemplo n.º 3
0
        private void GetLoteProduto(int CodProduto)
        {
            try
            {
                RowRelatorio.Clear();
                RowRelatorio.Add(new RowsFiltro("IDPRODUTO", "System.Int32", "=", CodProduto.ToString()));

                LIS_ESTOQUELOTECollection LIS_ESTOQUELOTEColl_2 = new LIS_ESTOQUELOTECollection();
                LIS_ESTOQUELOTEColl_2 = LIS_ESTOQUELOTEP.ReadCollectionByParameter(RowRelatorio, "DATAVALIDADE");

                LOTEColl2.Clear();
                foreach (var item in LIS_ESTOQUELOTEColl_2)
                {
                    LOTEEntity LOTETy = new LOTEEntity();
                    LOTETy.IDLOTE  = Convert.ToInt32(item.IDLOTE);
                    LOTETy.CODLOTE = item.CODLOTE;
                    LOTEColl2.Add(LOTETy);
                }

                //Remove Produto Repetido
                LOTECollection LOTEColl3 = new LOTECollection();
                foreach (LOTEEntity item in LOTEColl2)
                {
                    if (LOTEColl3.Find(delegate(LOTEEntity item2) { return(item2.IDLOTE == item.IDLOTE); }) == null)
                    {
                        LOTEColl3.Add(item);
                    }
                }
                LOTEColl2 = LOTEColl3;
                GetDropLote();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }