public DataSet ConsultarDetallePorFormula(int Id)
        {
            bool blnIniObjCon = false;

            try
            {
                //List<BLLDetallesFormulas> lista = new List<BLLDetallesFormulas>();
                blnIniObjCon = InicializaObjConexion();
                Detalles     = new DAL.DALDetallesFormulas(objDALBase, StrUsuarioSistema);
                DataSet dtsRet = Detalles.ConsultaPorFormula(Id);
                //lista = ConvierteDSEntidad(dtsRet);
                return(dtsRet);
            }
            catch (Exception err)
            {
                throw new Exception(err.Message, err.InnerException);
            }

            finally
            {
                if (blnIniObjCon)
                {
                    objDALBase.CierraConexion();
                }
            }
        }
        public void DarDeBajaPorId(int IdProducto)
        {
            bool blnIniObjCon = false;

            try
            {
                blnIniObjCon = InicializaObjConexion();
                Detalles     = new DAL.DALDetallesFormulas(objDALBase, StrUsuarioSistema);
                Detalles.DardeBajaPorId(IdProducto);
            }
            catch
            {
            }
        }
        public void ActualizarPrecios(int IdDetalle, decimal precio, int IdFormula)
        {
            bool blnIniObjCon = false;

            try
            {
                blnIniObjCon = InicializaObjConexion();
                Detalles     = new DAL.DALDetallesFormulas(objDALBase, StrUsuarioSistema);
                Detalles.CambiarPrecios(IdDetalle, precio, IdFormula);
            }
            catch
            {
            }
        }
        public string Guardar(BLLDetallesFormulas DF)
        {
            string  mensaje      = "";
            DataSet dtsRet       = DF.ConvierteEntidadDS();
            bool    blnIniObjCon = false;

            try
            {
                blnIniObjCon = InicializaObjConexion();
                Detalles     = new DAL.DALDetallesFormulas(objDALBase, StrUsuarioSistema);
                mensaje      = Detalles.Guardar("G", dtsRet);
            }
            catch (Exception er)
            {
                mensaje = "Error: " + er.Message;
            }
            return(mensaje);
        }
        public DataSet ConsultarDetallePorMoneda()
        {
            bool blnIniObjCon = false;

            try
            {
                blnIniObjCon = InicializaObjConexion();
                Detalles     = new DAL.DALDetallesFormulas(objDALBase, StrUsuarioSistema);
                DataSet dtsRet = Detalles.ConsultaPorMoneda();
                return(dtsRet);
            }
            catch (Exception err)
            {
                throw new Exception(err.Message, err.InnerException);
            }

            finally
            {
                if (blnIniObjCon)
                {
                    objDALBase.CierraConexion();
                }
            }
        }