public void AddUserFavorite(string userCode, string type, string pageName, string pageUrl, string pageImage, bool hasPermission) { if (TheFavoritesMgr.CheckFavoritesUniqueExist(userCode, type, pageName)) { TheFavoritesMgr.DeleteFavorites(userCode, type, pageName); } if (hasPermission) { Favorites fav = new Favorites(); fav.User = TheUserMgr.LoadUser(userCode); fav.Type = type; fav.PageName = pageName; fav.PageUrl = pageUrl; fav.PageImage = pageImage; TheFavoritesMgr.CreateFavorites(fav); } }
public void DeleteUserFavorite(int id) { TheFavoritesMgr.DeleteFavorites(id); }