Beispiel #1
0
        public void SetAsFavorite()
        {
            BIDashboardFavorite favorite = new BIDashboardFavorite(this.Session);

            favorite.Employee = Session.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId);
            BIDashboardFavorites.Add(favorite);
            Session.Save(this);
        }
Beispiel #2
0
        public void RemoveFromFavorite()
        {
            BIDashboardFavorite rFavorite = null;

            foreach (BIDashboardFavorite favorite in BIDashboardFavorites)
            {
                if (favorite.Employee == Session.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId))
                {
                    rFavorite = favorite;
                }
            }

            if (rFavorite != null)
            {
                BIDashboardFavorites.Remove(rFavorite);
                Session.Save(this);
            }
        }