public void SetAsFavorite() { DataExplorerFavorite favorite = new DataExplorerFavorite(this.Session); favorite.Employee = Session.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId); DataExplorerFavorites.Add(favorite); Session.Save(this); }
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); } }