Пример #1
0
        public static int RateEmotion(string premalink, int EmotionId, string Rate)
        {
            try
            {
                var bllemotion  = new BllEmotions();
                int returnvalue = 0;

                HttpCookie _cookie;
                _cookie = HttpContext.Current.Request.Cookies["Tagged"];

                if (Rate == "plus")
                {
                    returnvalue = bllemotion.IncrementEmotion(premalink, EmotionId,
                                                              Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])));
                }
                else if (Rate == "minus")
                {
                    returnvalue = bllemotion.DecrementEmotion(premalink, EmotionId,
                                                              Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])));
                }
                return(returnvalue);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(0);
        }
Пример #2
0
        public static int VoteTag(string premalink, int tagid, string vote)
        {
            System.Diagnostics.Debugger.Launch();
            try
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Tagged"];

                if (cookie == null)
                {
                    return(-2);
                }

                var bllemotion  = new BllEmotions();
                int returnvalue = 0;

                switch (vote)
                {
                case "UpVote":
                    returnvalue = bllemotion.IncrementEmotion(premalink, tagid,
                                                              Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])));
                    break;

                case "DownVote":
                    returnvalue = bllemotion.DecrementEmotion(premalink, tagid,
                                                              Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])));
                    break;
                }

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