Example #1
0
        public static IList <AlmacenInventarioLoteInfo> ObtenerLotes(FiltroAyudaLotes filtroLote)
        {
            IList <AlmacenInventarioLoteInfo> listaAlmacenInventarioLote = null;

            try
            {
                var seguridad = HttpContext.Current.Session["Seguridad"] as SeguridadInfo;
                if (seguridad != null)
                {
                    var almacenPL = new AlmacenPL();
                    List <AlmacenInfo> almacenesOrganizacion  = almacenPL.ObtenerAlmacenesPorOrganizacion(seguridad.Usuario.Organizacion.OrganizacionID);
                    AlmacenInfo        almacenPlantaAlimentos =
                        almacenesOrganizacion.FirstOrDefault(
                            alm => alm.TipoAlmacenID == TipoAlmacenEnum.PlantaDeAlimentos.GetHashCode());
                    if (almacenPlantaAlimentos != null)
                    {
                        filtroLote.AlmacenID = almacenPlantaAlimentos.AlmacenID;
                    }
                    filtroLote.OrganizacionID = seguridad.Usuario.Organizacion.OrganizacionID;

                    var almacenInventarioLotePL = new AlmacenInventarioLotePL();

                    listaAlmacenInventarioLote =
                        almacenInventarioLotePL.ObtenerAlmacenInventarioLotePorLote(filtroLote);

                    return(listaAlmacenInventarioLote);
                }
            }
            catch (ExcepcionDesconocida ex)
            {
                Logger.Error(ex);
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }

            return(listaAlmacenInventarioLote);
        }