Exemple #1
0
        /// <summary>
        /// Obtiene los estados de la nota de peso siguientes. Segun clasificacion de café.
        /// </summary>
        /// <param name="ESTADOS_NOTA_ID"></param>
        /// <param name="CLASIFICACIONES_CAFE_ID"></param>
        /// <returns>Lista estados de la nota de peso siguientes. Segun clasificacion de café.</returns>
        public List <estado_nota_de_peso> GetEstadosNotaDePeso(int ESTADOS_NOTA_ID, int CLASIFICACIONES_CAFE_ID)
        {
            try
            {
                List <estado_nota_de_peso> estadosList = null;

                using (var db = new colinasEntities())
                {
                    var querySiguiente = from enp in db.estados_nota_de_peso.Include("estados_detalles")
                                         where enp.ESTADOS_NOTA_ID == ESTADOS_NOTA_ID
                                         select enp;

                    estado_nota_de_peso siguiente = querySiguiente.First();

                    switch (siguiente.estados_detalles.ESTADOS_DETALLE_ENABLE_ESTADO)
                    {
                    case (int)EstadoNotaDePesoLogic.HabilitarEstadosEnNotasDePeso.ActivadoEnOrden:
                        estadosList = GetEstadosSiguiente(siguiente, db);
                        break;

                    default:
                        estadosList = db.estados_nota_de_peso.Include("estados_detalles").ToList <estado_nota_de_peso>();
                        break;
                    }
                }

                ClasificacionDeCafeLogic clasificaciondecafelogic = new ClasificacionDeCafeLogic();
                bool catacionFlag = clasificaciondecafelogic.ClasificacionDeCafePasaPorCatacion(CLASIFICACIONES_CAFE_ID);

                if (catacionFlag == false)
                {
                    estadosList = estadosList.Where(esn => esn.ESTADOS_NOTA_ES_CATACION == false).ToList <estado_nota_de_peso>();
                }

                return(estadosList);
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al obtener estados de nota de peso.", ex);
                throw;
            }
        }
Exemple #2
0
        /// <summary>
        /// Obtiene los estados de la nota de peso siguientes. Segun clasificacion de café.
        /// </summary>
        /// <param name="ESTADOS_NOTA_ID"></param>
        /// <param name="CLASIFICACIONES_CAFE_ID"></param>
        /// <returns>Lista estados de la nota de peso siguientes. Segun clasificacion de café.</returns>
        public List<estado_nota_de_peso> GetEstadosNotaDePeso(int ESTADOS_NOTA_ID, int CLASIFICACIONES_CAFE_ID)
        {
            try
            {
                List<estado_nota_de_peso> estadosList = null;

                using (var db = new colinasEntities())
                {
                    var querySiguiente = from enp in db.estados_nota_de_peso.Include("estados_detalles")
                                         where enp.ESTADOS_NOTA_ID == ESTADOS_NOTA_ID
                                         select enp;

                    estado_nota_de_peso siguiente = querySiguiente.First();

                    switch (siguiente.estados_detalles.ESTADOS_DETALLE_ENABLE_ESTADO)
                    {
                        case (int)EstadoNotaDePesoLogic.HabilitarEstadosEnNotasDePeso.ActivadoEnOrden:
                            estadosList = GetEstadosSiguiente(siguiente, db);
                            break;

                        default:
                            estadosList = db.estados_nota_de_peso.Include("estados_detalles").ToList<estado_nota_de_peso>();
                            break;
                    }
                }

                ClasificacionDeCafeLogic clasificaciondecafelogic = new ClasificacionDeCafeLogic();
                bool catacionFlag = clasificaciondecafelogic.ClasificacionDeCafePasaPorCatacion(CLASIFICACIONES_CAFE_ID);

                if (catacionFlag == false)
                    estadosList = estadosList.Where(esn => esn.ESTADOS_NOTA_ES_CATACION == false).ToList<estado_nota_de_peso>();

                return estadosList;
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al obtener estados de nota de peso.", ex);
                throw;
            }
        }