示例#1
0
        public static string GetEmotionbyPremalink(string Premalink, string UserID)
        {
            try
            {
                var bllemotion = new BllEmotions();

                JObject o = JObject.FromObject(new
                {
                    Emotion = new
                    {
                        Item =
                            from p in bllemotion.GetPremalinkEmotions(Premalink, Convert.ToInt64(UserID))
                            select new
                        {
                            Id = p.Emotionid,
                            p.TotalCount,
                            p.EmotionName
                        }
                    }
                });

                return(o.ToString());
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
示例#2
0
        public static string GetPremalinkEmotions(string Premalink)
        {
            try
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Tagged"];
                JObject    o;

                if (cookie != null)
                {
                    var bllemotion = new BllEmotions();
                    var lstemotion = new List <DtoEmotions>();
                    lstemotion = bllemotion.GetPremalinkEmotions(Premalink,
                                                                 Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])));

                    if (lstemotion != null && lstemotion.Count > 0)
                    {
                        o = JObject.FromObject(new
                        {
                            Emotion = new
                            {
                                Item =
                                    from E in lstemotion
                                    select new
                                {
                                    Id          = E.Emotionid,
                                    Vote        = E.TotalCount,
                                    Name        = E.EmotionName,
                                    UserEmotion = E.IsActive
                                }
                            }
                        });
                        return(o.ToString());
                    }
                }
                else
                {
                    return(null);
                }

                return(null);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }

            return(null);
        }