Example #1
0
        /// <summary>
        /// Devuelve un Diccionario con los lotes con stock registrados de un suministro en el sistema.
        /// </summary>
        /// <param name="IdSuministro"></param>
        /// <param name="Vencimiento">True para anexar la fecha de vencimiento al numero de lote.</param>
        /// <returns>Retorna un Diccionario con el numero de lote (key) e id (value)</returns>
        public IDictionary <string, int> ListarDicLotesStock(int IdSuministro, bool Vencimiento)
        {
            IDictionary <string, int> strLotes = new Dictionary <string, int>();
            IDictionary <int, Lote>   lotes    = mLote.ListarDicLotesFull(IdSuministro);

            foreach (var lote in lotes.Values)
            {
                if (lote.getCantidadStock() != 0)
                {
                    if (Vencimiento)
                    {
                        string fecha = string.Empty;
                        if (!lote.Perecedero)
                        {
                            fecha = "No Perecedero";
                        }
                        else
                        {
                            fecha = lote.VencimientoLote.Value.ToShortDateString();
                        }
                        strLotes.Add(lote.NumeroLote + " (Vto: " + fecha + ")", lote.LoteId);
                    }
                    else
                    {
                        strLotes.Add(lote.NumeroLote, lote.LoteId);
                    }
                }
            }
            return(strLotes);
        }