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

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

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

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