Ejemplo n.º 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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static IEnumerable RateableEmotionIntellisense(string prefixText)
        {
            try
            {
                var         daltag = new BllEmotions();
                IEnumerable query  = "";
                var         lsttag = daltag.RateableEmotionIntellisense(prefixText);

                if (lsttag != null)
                {
                    query = from c in lsttag
                            select new
                    {
                        Value = c.Emotionid.ToString(),
                        Name  = c.EmotionName
                    };
                }
                return(query);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Ejemplo n.º 4
0
        public string GetEmotion(string websitename, string premalink)
        {
            try
            {
                _websiteurl = new Uri(premalink);

                GetCookie();
                _bltag      = new BllTag();
                _bllemo     = new BllEmotions();
                _bllwebsite = new BllWebsite();
                _lsttag     = new List <DtoTag>();
                _lstemo     = new List <DtoEmotions>();
                _dtowebsite = new DtoWebsite();

                _lstemo     = _bllemo.GetAllEmotion(websitename, premalink, _userId);
                _dtowebsite = _bllwebsite.GetWebsiteByName(websitename);

                if (_dtowebsite != null)
                {
                    ViewState["websiteid"]  = _dtowebsite.WebsiteId;
                    ViewState["addEmotion"] = _dtowebsite.AddEmotion;
                    Emotionflag             = _dtowebsite.Emotion;

                    if (Emotionflag)
                    {
                        if (Convert.ToBoolean(ViewState["addEmotion"]))
                        {
                            deleteemoanchor.Style.Add("display", "inline");
                            addemoanchor.Style.Add("display", "inline");
                        }
                        else
                        {
                            deleteemoanchor.Style.Add("display", "none");
                            addemoanchor.Style.Add("display", "none");
                        }
                    }
                }

                var emotion = "";
                if (_lstemo != null)
                {
                    foreach (var emo in _lstemo)
                    {
                        emotion += "|" + emo.EmotionName + "," + emo.Emotionid + "," + emo.TotalCount + "," +
                                   emo.IsActive;
                    }
                }
                return(emotion);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
            return(null);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                GetCookie();
                if (!IsPostBack)
                {
                    ViewState["websiteId"] = 0;
                    ViewState["UserID"]    = 0;

                    _bllwebsite  = new BllWebsite();
                    _blltag      = new BllTag();
                    _bllemotions = new BllEmotions();

                    if (Request.QueryString["WebsiteId"] != null)
                    {
                        ViewState["websiteId"] = Convert.ToInt64(Request.QueryString["WebsiteId"]);

                        Dtowebsite  = _bllwebsite.GetWebsiteById(Convert.ToInt64(ViewState["websiteId"]));
                        Lsttag      = _blltag.GetTagByWebsite(Convert.ToInt64(ViewState["websiteId"]));
                        Lstemotions = _bllemotions.GetEmotionByWebsite(Convert.ToInt64(ViewState["websiteId"]));

                        if (Lsttag != null && Lsttag.Count > 0)
                        {
                            foreach (DtoTag t in Lsttag)
                            {
                                Tagstring += t.TagId + ",";
                            }

                            hdntagstring.Value = Tagstring;
                        }
                        if (Lstemotions != null && Lstemotions.Count > 0)
                        {
                            foreach (DtoEmotions E in Lstemotions)
                            {
                                Emostring += E.Emotionid + ",";
                            }

                            hdnemostring.Value = Emostring;
                        }
                    }
                }
                else
                {
                    Response.Redirect("../Default.aspx");
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }
Ejemplo n.º 6
0
 public static IEnumerable EmotionIntellisense(string PrefixText, string Premalink)
 {
     try
     {
         var bllemotion = new BllEmotions();
         return(bllemotion.EmotionIntellisense(Premalink, PrefixText));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Ejemplo n.º 7
0
 public static string GetUserEmotion(long profileUserId)
 {
     try
     {
         HttpCookie cookie = HttpContext.Current.Request.Cookies["Tagged"];
         var        bllemo = new BllEmotions();
         return(bllemo.GetUserEmotion(profileUserId, Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"]))));
     }
     catch (Exception ex)
     {
         ex.ToExceptionless().Submit();
     }
     return(null);
 }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                GetCookie();

                _bllwebsite    = new BllWebsite();
                _blltag        = new BllTag();
                _bllemotion    = new BllEmotions();
                Lstdtonewsfeed = new List <DtoNewsFeed>();
                string[] items;


                if (!IsPostBack)
                {
                    ViewState["UserID"] = 0;
                }

                if (Request.QueryString["WebsiteId"] != null)
                {
                    Websiteid = Convert.ToInt64(Request.QueryString["WebsiteId"]);

                    if (Request.QueryString["TagId"] != null)
                    {
                        string tagarray = Request.QueryString["TagId"];
                        if (tagarray.Split(',').Length > 0)
                        {
                            items = tagarray.Split(',');
                            for (int i = 0; i < (items.Length - 1); i++)
                            {
                                if (!(Convert.ToInt64(items[i]) > 0))
                                {
                                    TagId = ""; // error SQL injection
                                    break;
                                }
                            }
                            TagId = Request.QueryString["TagId"];
                        }
                        else
                        {
                            TagId = Request.QueryString["TagId"];
                        }
                    }
                    else
                    {
                        TagId = "";
                    }

                    if (Request.QueryString["EmoId"] != null)
                    {
                        string emoarray = Request.QueryString["EmoId"];

                        if (emoarray.Split(',').Length > 0)
                        {
                            items = emoarray.Split(',');
                            for (int i = 0; i < (items.Length - 1); i++)
                            {
                                if (!(Convert.ToInt64(items[i]) > 0))
                                {
                                    EmoId = ""; // error SQL injection
                                    break;
                                }
                            }
                            EmoId = Request.QueryString["EmoId"];
                        }
                        else
                        {
                            EmoId = Request.QueryString["EmoId"];
                        }
                    }
                    else
                    {
                        EmoId = "";
                    }

                    if (EmoId.Length > 0)
                    {
                        EmoId = EmoId.Remove(EmoId.Length - 1, 1);
                    }
                    if (TagId.Length > 0)
                    {
                        TagId = TagId.Remove(TagId.Length - 1, 1);
                    }

                    Lstdtonewsfeed = _bllwebsite.GetWebsiteFeed(Convert.ToInt64(ViewState["UserID"]), Websiteid, TagId,
                                                                EmoId, 1, 10);
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                IsUser();

                if (!IsPostBack)
                {
                    ViewState["CurrentUserProfileID"] = 0;

                    if (Request.QueryString["Id"] != null)
                    {
                        ViewState["CurrentUserProfileID"] = Convert.ToInt64(Request.QueryString["Id"]);
                        if (Convert.ToInt64(ViewState["CurrentUserProfileID"]) == 0)
                        {
                            ViewState["CurrentUserProfileID"] = UserId;
                        }
                    }
                    else if (UserId > 0)
                    {
                        ViewState["CurrentUserProfileID"] = UserId;
                    }

                    Dtouser  = new DtoUser();
                    _blluser = new BllUser();
                    Dtouser  = _blluser.GetUserGeneralInfo(Convert.ToInt64(ViewState["CurrentUserProfileID"]));

                    if (Dtouser.ImageUrl != "")
                    {
                        Dtouser.ImageUrl = "/Uploads/" + Dtouser.ImageUrl + ".jpg";
                    }
                    else if (Dtouser.CoverPhoto != "")
                    {
                        Dtouser.CoverPhoto = "/Uploads/" + Dtouser.CoverPhoto + ".jpg";
                    }

                    if (Imageurl != null)
                    {
                    }
                    else
                    {
                        Ima = "../Images/no_photo.jpg";
                    }
                    _blltag     = new BllTag();
                    _bllemotion = new BllEmotions();
                    Lsttag      = _blltag.GetTagByUser(Convert.ToInt64(ViewState["CurrentUserProfileID"]));
                    Lstemotions = _bllemotion.spGetEmotionByUser(Convert.ToInt64(ViewState["CurrentUserProfileID"]));

                    if (Lsttag != null && Lsttag.Count > 0)
                    {
                        foreach (DtoTag t in Lsttag)
                        {
                            Tagstring += t.TagId + ",";
                        }

                        hdntagstring.Value = Tagstring;
                    }
                    if (Lstemotions != null && Lstemotions.Count > 0)
                    {
                        foreach (DtoEmotions E in Lstemotions)
                        {
                            Emostring += E.Emotionid + ",";
                        }

                        hdnemostring.Value = Emostring;
                    }
                }
                else
                {
                    Response.Redirect("../Default.aspx");
                }
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }
Ejemplo n.º 12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                var        bllemotion = new BllEmotions();
                HttpCookie cookie     = Request.Cookies["Tagged"];
                long       userId     = 0;

                if (cookie != null)
                {
                    userId = Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"]));
                }

                string   tag    = hdnemo.Value;
                string[] level1 = tag.Split('|');

                if (_flow.ToLower() == "userprofile")
                {
                    for (int i = 1; i < level1.Length; i++)
                    {
                        string[] level2 = level1[i].Split(',');
                        if (level2[3] == "new")
                        {
                            bllemotion.AddUserEmotion(level2[0], userId, Convert.ToInt64(ViewState["ProfileUserID"]));
                        }
                    }
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "Hidepopup",
                                                                "<script type='text/javascript'>HidePopup()</script>");
                }
                else if (_flow.ToLower() == "tagged")
                {
                    for (int i = 1; i < level1.Length; i++)
                    {
                        string[] level2 = level1[i].Split(',');
                        if (level2[3] == "new")
                        {
                            bllemotion.AddTaggedEmotion(level2[0], userId, Convert.ToInt64(ViewState["TagId"]));
                        }
                    }
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "Hidepopup",
                                                                "<script type='text/javascript'>HidePopup()</script>");
                }
                else
                {
                    for (int i = 1; i < level1.Length; i++)
                    {
                        string[] level2 = level1[i].Split(',');
                        if (level2[3] == "new")
                        {
                            bllemotion.AddEmotion(level2[0], ViewState["premalink"].ToString(),
                                                  Convert.ToInt32(level2[1]), userId);
                        }
                    }
                }

                Response.Redirect(Request.RawUrl);
            }
            catch (Exception ex)
            {
                ex.ToExceptionless().Submit();
            }
        }