Esempio n. 1
0
        public IEnumerable EmotionIntellisense(string premalink, string emotion)
        {
            try
            {
                _dalemotions = new DalEmotions();
                _lstemotion  = new List <DtoEmotions>();
                IEnumerable query = "";
                _lstemotion = _dalemotions.EmotionIntellisense(premalink, emotion);

                if (_lstemotion != null)
                {
                    query = from c in _lstemotion
                            select new
                    {
                        Value = c.Emotionid.ToString(),
                        Name  = c.EmotionName
                    };
                }
                return(query);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Esempio n. 2
0
        public string GetTaggedEmotion(long tagId, long loggedInUser)
        {
            try
            {
                _dalemotions = new DalEmotions();

                IEnumerable <DtoEmotions> lstemo = _dalemotions.GetTaggedEmotion(tagId, loggedInUser);

                string emos = "";

                emos = "";
                if (lstemo == null)
                {
                    return(emos);
                }
                foreach (DtoEmotions emotions in lstemo)
                {
                    emos += "|" + emotions.EmotionName + "," + emotions.Emotionid + "," + emotions.TotalCount + "," +
                            (emotions.EmotionUser == 1 ? "true" : "false");
                }

                return(emos);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Esempio n. 3
0
 public List <DtoEmotions> GetPremalinkEmotionsById(long id)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.GetPremalinkEmotionsById(id));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 4
0
 public List <DtoEmotions> GetPremalinkEmotions(string premalink, long?userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.GetPremalinkEmotions(premalink, userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 5
0
 public List <DtoEmotions> RateableEmotionIntellisense(string prefixText)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.RateableEmotionIntellisense(prefixText));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 6
0
 public List <DtoEmotions> GetEmotionByWebsite(long websiteid)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.GetEmotionByWebsite(websiteid));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 7
0
 public int AddTaggedEmotion(string emotionName, long userId, long tagId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.AddTaggedEmotion(emotionName, userId, tagId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(0);
 }
Esempio n. 8
0
 public List <DtoEmotions> spGetEmotionByUser(long userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.GetEmotionByUser(userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 9
0
 public int AddEmotion(string emotionName, string premalink, int emotionId, long userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.AddEmotion(emotionName, premalink, emotionId, userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(0);
 }
Esempio n. 10
0
 public int DecrementTaggedEmotion(long tagId, int emotionId, long userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.DecrementTaggedEmotion(tagId, emotionId, userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(0);
 }
Esempio n. 11
0
 public List <DtoEmotions> GetAllEmotion(string websitename, string premalink, long userid)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.GetAllEmotion(websitename, premalink, userid));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Esempio n. 12
0
 public int DecrementEmotion(string premalink, int emotionId, long userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.DecrementEmotion(premalink, emotionId, userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(0);
 }
Esempio n. 13
0
 public int DecrementUserEmotion(int emotionId, long currentUserProfileId, long userId)
 {
     try
     {
         _dalemotions = new DalEmotions();
         return(_dalemotions.DecrementUserEmotion(emotionId, currentUserProfileId, userId));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(0);
 }
Esempio n. 14
0
        public List <DtoEmotions> GetUserEmotionForProfile(long currentUserId, long loggedInUser)
        {
            try
            {
                _lstemotion  = new List <DtoEmotions>();
                _dalemotions = new DalEmotions();

                _lstemotion = _dalemotions.GetUserEmotionForProfile(currentUserId, loggedInUser);
                return(_lstemotion);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Esempio n. 15
0
        public List <DtoNewsFeed> GetExploreNewsFeed(long UserId, long tagId, long PageNumber, long RowsPerPage)
        {
            try
            {
                var dalemotion = new DalEmotions();

                var lstdtonewsfeed    = new List <DtoNewsFeed>();
                var newlstdtonewsfeed = new List <DtoNewsFeed>();
                var lstemotion        = new List <DtoEmotions>();

                _daluser = new DalUser();

                lstdtonewsfeed = _daluser.GetExploreNewsFeed(UserId, tagId, PageNumber, RowsPerPage);

                IEnumerable <long> query = (from ca in lstdtonewsfeed
                                            select ca.PremalinkId).Distinct();

                foreach (long item in query)
                {
                    IEnumerable <DtoNewsFeed> query2 = from ca in lstdtonewsfeed
                                                       where ca.PremalinkId == item
                                                       select ca;
                    string str   = "";
                    int    index = 0;
                    foreach (DtoNewsFeed dto in query2)
                    {
                        str += "|" + dto.TagId + "," + dto.TagName + "," + dto.TotalVote + "," + dto.UpVote + "," +
                               dto.DownVote +
                               "," + dto.TaggedByUser + ",";
                        index += 1;

                        if (index == query2.Count())
                        {
                            newlstdtonewsfeed.Add(new DtoNewsFeed
                            {
                                PremalinkId = dto.PremalinkId,
                                Title       = dto.Title,
                                Description = dto.Description,
                                Image       = dto.Image,
                                CreatedOn   = dto.CreatedOn,
                                Tagstring   = str,
                                Link        = dto.Link
                            });
                        }
                    }
                }

                foreach (DtoNewsFeed newaa in newlstdtonewsfeed)
                {
                    lstemotion = dalemotion.GetPremalinkEmotions(newaa.Link, UserId);

                    string str1 = "";

                    if (lstemotion != null)
                    {
                        foreach (DtoEmotions dto in lstemotion)
                        {
                            str1 += "|" + dto.Emotionid + "," + dto.EmotionName + "," + dto.TotalCount + "," +
                                    dto.IsActive;
                        }

                        newaa.EmotionString = str1;
                    }
                }
                return(newlstdtonewsfeed);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Esempio n. 16
0
        public List <DtoNewsFeed> GetTagNewsFeed(long UserId, long tagId, long PageNumber, long RowsPerPage)
        {
            try
            {
                var dalemotion = new DalEmotions();

                var newlstdtonewsfeed = new List <DtoNewsFeed>();
                var lstemotion        = new List <DtoEmotions>();

                _daltag = new DalTag();

                List <DtoNewsFeed> lstdtonewsfeed = _daltag.GetTagNewsFeed(UserId, tagId, PageNumber, RowsPerPage);

                if (lstdtonewsfeed != null)
                {
                    IEnumerable <long> query = (from ca in lstdtonewsfeed
                                                select ca.PremalinkId).Distinct();

                    if (query != null)
                    {
                        foreach (long item in query)
                        {
                            IEnumerable <long> uniquetagid = (from ca in lstdtonewsfeed
                                                              where ca.PremalinkId == item && ca.TagId != 0
                                                              select ca.TagId).Distinct();

                            IEnumerable <long> uniqueemoid = (from ca in lstdtonewsfeed
                                                              where ca.PremalinkId == item && ca.EmotionId != 0
                                                              select ca.EmotionId).Distinct();
                            string tagstr = "";
                            int    index  = 0;
                            foreach (int str in uniquetagid)
                            {
                                DtoNewsFeed dto = (from ca in lstdtonewsfeed
                                                   where ca.PremalinkId == item &&
                                                   ca.TagId == str
                                                   select ca).FirstOrDefault();

                                tagstr += "|" + dto.TagId + "," + dto.TagName + "," + dto.TotalVote + "," + dto.UpVote +
                                          "," +
                                          dto.DownVote + "," + dto.TaggedByUser + ",";
                                index += 1;

                                if (index == uniquetagid.Count())
                                {
                                    newlstdtonewsfeed.Add(new DtoNewsFeed
                                    {
                                        PremalinkId  = dto.PremalinkId,
                                        Title        = dto.Title,
                                        Description  = dto.Description,
                                        Image        = dto.Image,
                                        CreatedOn    = dto.CreatedOn,
                                        Tagstring    = tagstr,
                                        Link         = dto.Link,
                                        WebsiteName  = dto.WebsiteName,
                                        WebsiteId    = dto.WebsiteId,
                                        WebsiteImage = dto.WebsiteImage
                                    });
                                }
                            }

                            string emostr = "";
                            index = 0;

                            foreach (long str in uniqueemoid)
                            {
                                DtoNewsFeed dto = (from ca in lstdtonewsfeed
                                                   where ca.PremalinkId == item &&
                                                   ca.EmotionId == str
                                                   select ca).FirstOrDefault();
                                index  += 1;
                                emostr += "|" + dto.EmotionId + "," + dto.EmotionName + "," + dto.TotalCount + "," +
                                          dto.IsActive;

                                if (index == uniqueemoid.Count())
                                {
                                    DtoNewsFeed q = (from c in newlstdtonewsfeed
                                                     where c.PremalinkId == dto.PremalinkId
                                                     select c).FirstOrDefault();
                                    q.EmotionString = emostr;
                                    emostr          = "";
                                }
                            }
                        }
                    }
                }
                return(newlstdtonewsfeed);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }