public bool HasTOC(int bookId, int tocId) { if (Email == GlobalAccess.Instance.CurrentUserInfo.Email && CountryCode == GlobalAccess.Instance.CurrentUserInfo.Country.CountryCode && BookId == bookId && IndexTitle == null && TOCIdList != null && TOCIdList.Count >= 0) { return(TOCIdList.FindIndex(id => id == tocId) >= 0); } return(false); }
public void SetCurrentToc(int bookId, int tocId) { if (Email != GlobalAccess.Instance.CurrentUserInfo.Email || CountryCode != GlobalAccess.Instance.CurrentUserInfo.Country.CountryCode || BookId != bookId || IndexTitle != null || TOCIdList == null || TOCIdList.Count == 0) { throw new InvalidOperationException("Invalid tag status."); } TOCIdList.Remove(tocId); TOCIdList.Insert(0, tocId); }