public List<PostInfo> GetPostListByTerritoryId(int pageId, int pageSize, int territoryId, bool isWeb) { try { PostManager mgr = new PostManager(); HelperMethods helperMgr = new HelperMethods(); TokenInfo tokenInfo = helperMgr.GetUserToken<TokenInfo>(isWeb, HttpContext.Current); return mgr.GetPostListByTerritoryId(tokenInfo.Idf, tokenInfo.FolderPath, pageId, helperMgr.SetPageSize(pageSize, isWeb), territoryId == 0 ? tokenInfo.TerritoryId : territoryId); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }
public List<NotificationInfo> GetNotificationByUser(int pageId, int pageSize, bool isWeb) { try { PostManager mgr = new PostManager(); HelperMethods helperMgr = new HelperMethods(); var userIdf = helperMgr.GetUserIdf(isWeb, HttpContext.Current); return mgr.GetNotificationByUser(userIdf, pageId, helperMgr.SetPageSize(pageSize, isWeb)); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }
public List<PostInfo> GetContactPostsList(string contactToken, int pageId, int pageSize, bool isWeb) { try { PostManager mgr = new PostManager(); HelperMethods helperMgr = new HelperMethods(); TokenInfo tokenInfo = helperMgr.GetUserToken<TokenInfo>(isWeb, HttpContext.Current); return mgr.GetContactPostsList(tokenInfo.Idf, JsonWebToken.DecodeToken<TokenInfo>(contactToken, CodeHelper.SecretAccessKey, true, false).Idf, tokenInfo.TerritoryId, tokenInfo.FolderPath, pageId, helperMgr.SetPageSize(pageSize, isWeb)); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }
public List<SearchInfo> SearchUsers(string searchString,int pageId, int pageSize, bool isWeb) { try { UserManager mgr = new UserManager(); HelperMethods helperMgr = new HelperMethods(); TokenInfo tokenInfo = helperMgr.GetUserToken<TokenInfo>(isWeb, HttpContext.Current); return mgr.SearchUsers(tokenInfo.Idf, searchString, pageId, helperMgr.SetPageSize(pageSize, isWeb)); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }
public List<CommentInfo> GetOwnComments(long postId, int pageId, int pageSize, bool isWeb) { try { CommentManager mgr = new CommentManager(); HelperMethods helperMgr = new HelperMethods(); Guid userIdf = helperMgr.GetUserIdf(isWeb, HttpContext.Current); return mgr.GetOwnComments(userIdf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb)); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }
public List<CommentInfo> GetComments(long postId, int pageId, int pageSize, bool isWeb) { try { CommentManager mgr = new CommentManager(); HelperMethods helperMgr = new HelperMethods(); TokenInfo tokenInfo = new HelperMethods().GetUserToken<TokenInfo>(isWeb, HttpContext.Current); PostInfo post = new PostManager().GetPostById(tokenInfo.Idf, 0, tokenInfo.FolderPath, postId); if (post.isDone == true) return mgr.GetComments(tokenInfo.Idf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb)); else return mgr.GetOwnComments(tokenInfo.Idf, postId, pageId, helperMgr.SetPageSize(pageSize, isWeb)); } catch (Exception ex) { throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError); } }