コード例 #1
0
        /// <summary>
        /// Obtiene una lista de ingredientes por formula
        /// Activo - Solo activos
        /// Inactivo - Solo inactivos
        /// Todos - Ambos
        /// </summary>
        /// <param name="ingrediente"></param>
        /// <param name="estatus"></param>
        /// <returns>Lista IngredienteInfo</returns>
        internal List <IngredienteInfo> ObtenerPorFormula(IngredienteInfo ingrediente, EstatusEnum estatus)
        {
            List <IngredienteInfo> listaIngredientes        = null;
            List <IngredienteInfo> listaIngredientesRegreso = new List <IngredienteInfo>();

            try
            {
                var ingredienteDal = new IngredienteDAL();
                listaIngredientes = ingredienteDal.ObtenerPorFormula(ingrediente, estatus);

                if (listaIngredientes != null)
                {
                    listaIngredientesRegreso.AddRange(listaIngredientes.Select(ingredienteInfo => ObtenerPorId(ingredienteInfo, estatus)));
                }
            }
            catch (ExcepcionDesconocida)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }

            return(listaIngredientesRegreso);
        }
コード例 #2
0
        public void Alterinhabilitadoing(IngredienteBLL objaux)
        {
            IngredienteDAL aiu = new IngredienteDAL();

            aiu.id_ingrediente = this.id_ingrediente;
            aiu.Altereliminaring(aiu);
        }
コード例 #3
0
 /// <summary>
 /// Metodo para Guardar/Modificar una entidad Ingrediente
 /// </summary>
 /// <param name="info"></param>
 public int Guardar(IngredienteInfo info)
 {
     try
     {
         Logger.Info();
         var ingredienteDAL = new IngredienteDAL();
         int result         = info.IngredienteId;
         if (info.IngredienteId == 0)
         {
             result = ingredienteDAL.Crear(info);
         }
         else
         {
             ingredienteDAL.Actualizar(info);
         }
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #4
0
        public DataTable listarmodificar(int id_ingrediente)
        {
            IngredienteDAL li = new IngredienteDAL();
            DataTable      dt = li.listarparamodi(id_ingrediente);

            return(dt);
        }
コード例 #5
0
        public DataTable NombreIngredienteList(string nombre_ingrediente)
        {
            IngredienteDAL li = new IngredienteDAL();
            DataTable      dt = li.BusarINGnombre(nombre_ingrediente);

            return(dt);
        }
コード例 #6
0
        public DataTable AllingredientesList()
        {
            IngredienteDAL li = new IngredienteDAL();
            DataTable      dt = li.Get_allingredientes();

            return(dt);
        }
コード例 #7
0
        public DataTable getalling()
        {
            IngredienteDAL ingDAL = new IngredienteDAL();
            DataTable      dt     = ingDAL.GetAllIng();

            return(dt);
        }
コード例 #8
0
        public bool AddIngrediente(IngredienteBLL objaux)
        {
            IngredienteDAL ai = new IngredienteDAL();

            ai.nombre_ingrediente = this.nombre_ingrediente;
            ai.proveedor          = this.proveedor;
            ai.habilitado         = this.habilitado;
            ai.stock        = this.stock;
            ai.stock_cocina = this.stock_cocina;
            return(ai.AgregarIngrediente(ai));
        }
コード例 #9
0
        public void AlterinIngrediente(IngredienteBLL objaux)
        {
            IngredienteDAL aiu = new IngredienteDAL();

            aiu.nombre_ingrediente = this.nombre_ingrediente;
            aiu.proveedor          = this.proveedor;
            aiu.habilitado         = this.habilitado;
            aiu.stock          = this.stock;
            aiu.stock_cocina   = this.stock_cocina;
            aiu.id_ingrediente = this.id_ingrediente;
            aiu.AlterIngrediente(aiu);
        }
コード例 #10
0
 /// <summary>
 /// Metodo para Guardar/Modificar una entidad Ingrediente
 /// </summary>
 /// <param name="listaIngredientes"></param>
 public int GuardarIngredientesXML(List <IngredienteInfo> listaIngredientes)
 {
     try
     {
         Logger.Info();
         var ingredienteDAL = new IngredienteDAL();
         var result         = ingredienteDAL.GuardarIngredientesXML(listaIngredientes);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #11
0
 /// <summary>
 /// Obtiene un lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 public ResultadoInfo <FormulaInfo> ObtenerPorPaginaFormula(PaginacionInfo pagina, IngredienteInfo filtro)
 {
     try
     {
         Logger.Info();
         var ingredienteDAL = new IngredienteDAL();
         ResultadoInfo <FormulaInfo> result = ingredienteDAL.ObtenerPorPaginaFormula(pagina, filtro);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #12
0
 /// <summary>
 /// Obtiene una entidad Ingrediente por su descripción
 /// </summary>
 /// <param name="descripcion"></param>
 /// <returns></returns>
 public IngredienteInfo ObtenerPorDescripcion(string descripcion)
 {
     try
     {
         Logger.Info();
         var             ingredienteDAL = new IngredienteDAL();
         IngredienteInfo result         = ingredienteDAL.ObtenerPorDescripcion(descripcion);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #13
0
 /// <summary>
 /// Obtiene una entidad Ingrediente por su Id
 /// </summary>
 /// <param name="ingredienteID">Obtiene una entidad Ingrediente por su Id</param>
 /// <returns></returns>
 public IngredienteInfo ObtenerPorIdOrganizacionFormulaProducto(int formula, int ProductoId, int OrganizacionID)
 {
     try
     {
         Logger.Info();
         var             ingredienteDAL = new IngredienteDAL();
         IngredienteInfo result         = ingredienteDAL.ObtenerPorIdOrganizacionFormulaProducto(formula, ProductoId, OrganizacionID);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #14
0
 /// <summary>
 /// Obtiene una lista filtrando por el estatus Activo = 1, Inactivo = 0
 /// </summary>
 /// <returns></returns>
 public IList <IngredienteInfo> ObtenerTodos(EstatusEnum estatus)
 {
     try
     {
         Logger.Info();
         var ingredienteDAL             = new IngredienteDAL();
         IList <IngredienteInfo> result = ingredienteDAL.ObtenerTodos(estatus);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
コード例 #15
0
        /// <summary>
        /// Obtiene un ingrediente con su detalle
        /// Activo - Solo activos
        /// Inactivo - Solo inactivos
        /// Todos - Ambos
        /// </summary>
        /// <returns>IngredienteInfo</returns>
        internal IngredienteInfo ObtenerPorId(IngredienteInfo ingrediente, EstatusEnum estatus)
        {
            try
            {
                var ingredienteDal = new IngredienteDAL();
                ingrediente = ingredienteDal.ObtenerPorId(ingrediente, estatus);

                if (ingrediente != null)
                {
                    if (ingrediente.Organizacion.OrganizacionID > 0)
                    {
                        var organizacionBl = new OrganizacionBL();
                        ingrediente.Organizacion = organizacionBl.ObtenerPorID(ingrediente.Organizacion.OrganizacionID);
                    }
                    if (ingrediente.Formula.FormulaId > 0)
                    {
                        var formulaBl = new FormulaBL();
                        ingrediente.Formula = formulaBl.ObtenerPorID(ingrediente.Formula.FormulaId);
                    }

                    if (ingrediente.Producto.ProductoId > 0)
                    {
                        var productoBl = new ProductoBL();
                        ingrediente.Producto = productoBl.ObtenerPorID(ingrediente.Producto);
                    }
                }
            }
            catch (ExcepcionDesconocida)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }

            return(ingrediente);
        }
コード例 #16
0
        public int Get_idbynom(string nom)
        {
            IngredienteDAL pd = new IngredienteDAL();

            return(pd.Get_iding_nomb(nom));
        }