예제 #1
0
 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);
     }
 }
예제 #2
0
 public bool DeletePost(long postId, bool isWeb)
 {
     try
     {
         PostManager mgr = new PostManager();
         HelperMethods helperMgr = new HelperMethods();
         TokenInfo tokenInfo = helperMgr.GetUserToken<TokenInfo>(isWeb, HttpContext.Current);
         return mgr.DeletePost(tokenInfo.Idf, postId);
     }
     catch (Exception ex)
     {
         throw new WebFaultException<string>(ex.Message, System.Net.HttpStatusCode.InternalServerError);
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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);
     }
 }