Пример #1
0
        public void SetAsFavorite()
        {
            DataExplorerFavorite favorite = new DataExplorerFavorite(this.Session);

            favorite.Employee = Session.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId);
            DataExplorerFavorites.Add(favorite);
            Session.Save(this);
        }
Пример #2
0
        public void RemoveFromFavorite()
        {
            DataExplorerFavorite rFavorite = null;

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

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