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); }
private void GetCookie() { _cookie = Request.Cookies["Tagged"]; _userId = _cookie != null ? Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])) : 0; }
public static string voteTag(long premalinkId, long TagId, string vote) { try { HttpCookie _cookie; _cookie = HttpContext.Current.Request.Cookies["Tagged"]; long result; if (_cookie != null && Int64.TryParse(UtilityClass.DecryptStringAES(_cookie["d"]), out result)) { if (result > 0) { var blltag = new BllTag(); var news = new DtoNewsFeed(); news.TagId = TagId; news.UserId = Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])); news.Title = vote; news.PremalinkId = premalinkId; blltag.VoteContent(news); return("1"); } return(null); } return(null); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(null); }
private void IsRegisterUser() { try { _cookie = Request.Cookies["Tagged"]; if (_cookie != null) { if (_cookie["UserID"] != null) { _userId = Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["UserID"])); } var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(_userId); if (isWebsite != null) { Response.Redirect("~/WebsiteAdmin/WebsiteGeneralSetting.aspx"); } } else { Response.Redirect("Default.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
private int GetCookie() { _cookie = Request.Cookies["Tagged"]; if (_cookie != null) { _userId = Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])); } return(0); }
protected long GetUserId() { Cookie = Request.Cookies["Tagged"]; if (Cookie != null) { return(long.Parse(UtilityClass.DecryptStringAES(Cookie["d"]))); } Response.Redirect("~/Default.aspx"); return(0); }
private void GetCookie() { _cookie = Request.Cookies["Tagged"]; if (_cookie != null) { ViewState["UserID"] = Convert.ToInt64(UtilityClass.DecryptStringAES(_cookie["d"])); } else { Response.Redirect("~/Default.aspx"); } }
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); }
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); }
private void GetCookie() { try { cookie = Request.Cookies["Tagged"]; if (cookie != null) { ViewState["UserID"] = Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])); } else { Response.Redirect("~/Default.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public static void DeleteUserTagSubscription(string TagID) { try { var cookie = HttpContext.Current.Request.Cookies["Tagged"]; if (cookie != null) { var bllUserTagSubscription = new BllUserTagSubscription(); bllUserTagSubscription.DeleteUserTagSubscription( Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])), Convert.ToInt64(TagID)); } else { HttpContext.Current.Response.Redirect("Default.aspx"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void IsWebSite() { Cookie = Request.Cookies["Tagged"]; if (Cookie != null) { UserId = long.Parse(UtilityClass.DecryptStringAES(Cookie["d"])); var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(UserId); if (isWebsite == null) { Response.Redirect("~/MainPage.aspx"); } } else { Response.Redirect("~/Default.aspx"); } }
protected void IsUser() { Cookie = Request.Cookies["Tagged"]; if (Cookie != null) { if (Cookie["d"] != null) { UserId = long.Parse(UtilityClass.DecryptStringAES(Cookie["d"])); } var bllwebsite = new BllWebsite(); var isWebsite = bllwebsite.GetUserWebsite(UserId); if (isWebsite != null) { Response.Redirect("~/WebsiteAdmin/WebsiteGeneralSetting.aspx"); } } else { Response.Redirect("Default.aspx"); } }
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); }
public static void voteTag(string premalink, long tagId, string vote, string flow, long TagId, long profileUserId) { try { HttpCookie cookie = HttpContext.Current.Request.Cookies["Tagged"]; var blltag = new BllTag(); var tag = new DtoTag(); tag.TagId = tagId; tag.UserId = Convert.ToInt64(UtilityClass.DecryptStringAES(cookie["d"])); tag.VoteType = vote; tag.Link = premalink; if (flow.ToLower() == "userprofile") { tag.UserId = profileUserId; blltag.VoteUserTag(tag); } else if (flow.ToLower() == "tagged") { tag.TagId = tagId; tag.TagCount = TagId; blltag.VoteTagged(tag); } else { blltag.VoteTag(tag); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public static long voteTag(string premalink, long TagId, string vote) { try { var blltag = new BllTag(); var tag = new DtoTag(); var cookie1 = HttpContext.Current.Request.Cookies["Tagged"]; if (cookie1 != null) { tag.TagId = TagId; tag.UserId = Convert.ToInt64(UtilityClass.DecryptStringAES(cookie1["d"])); tag.VoteType = vote; tag.Link = premalink; return(blltag.VoteTag(tag)); } return(-2); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(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(); } }