public long AssociateTag(DtoTag Tag) { long TagId = 0; try { _command = new SqlCommand(StoredProcedure.Names.spAssociateTag.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagId", SqlDbType.Int); _command.Parameters.Add("@Link", SqlDbType.VarChar); _command.Parameters.Add("@WebsiteName", SqlDbType.VarChar); _command.Parameters.Add("@TagType", SqlDbType.VarChar); _command.Parameters[0].Value = Tag.TagId; _command.Parameters[1].Value = Tag.Link; _command.Parameters[2].Value = Tag.WebsiteName; _command.Parameters[3].Value = Tag.TagType; _connection.Open(); TagId = Convert.ToInt64(_command.ExecuteScalar().ToString()); } catch (Exception error) { } finally { _connection.Close(); } return(TagId); }
public long VoteTagged(DtoTag Tag) { long TagId = 0; try { _command = new SqlCommand(StoredProcedure.Names.spVoteTagged.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagId", SqlDbType.BigInt); _command.Parameters.Add("@VoteType", SqlDbType.VarChar); _command.Parameters.Add("@UserId", SqlDbType.BigInt); _command.Parameters.Add("@TaggedoneId", SqlDbType.BigInt); _command.Parameters[0].Value = Tag.TagCount; _command.Parameters[1].Value = Tag.VoteType; _command.Parameters[2].Value = Tag.UserId; _command.Parameters[3].Value = Tag.TagId; _connection.Open(); TagId = Convert.ToInt64(_command.ExecuteScalar()); } catch (Exception error) { throw error; } finally { _connection.Close(); } return(TagId); }
public long IncrementTag(DtoTag Tag) { long TagId = 0; try { _command = new SqlCommand(StoredProcedure.Names.IncrementTag.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagID", SqlDbType.BigInt); _command.Parameters[0].Value = Tag.TagId; _connection.Open(); TagId = _command.ExecuteNonQuery(); } catch (Exception) { throw; } finally { _connection.Close(); } return(TagId); }
public DtoTag GetTagById(long tagId) { try { _command = new SqlCommand(StoredProcedure.Names.spGetTagById.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagId", SqlDbType.BigInt); _command.Parameters[0].Value = tagId; _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagName = _datareader["Name"].ToString(); _tag.About = _datareader["About"].ToString(); break; } } catch (Exception error) { throw error; } finally { _connection.Close(); } return(_tag); }
protected void btnadd_Click(object sender, EventArgs e) { try { _dtotag = new DtoTag { Link = ViewState["_link"].ToString(), WebsiteName = ViewState["_websiteName"].ToString(), UserId = UserId, TagName = txttag.Text }; var blltag = new BllTag(); blltag.AddTag(_dtotag); _bllpremalink = new BllPremalink(); GridPremalinkTags.DataSource = _bllpremalink.GetPremalinkTagsById(Convert.ToInt64(ViewState["_premalinkId"])); GridPremalinkTags.DataBind(); txttag.Text = ""; } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public long AddTagged(DtoTag Tag) { long TagId = 0; try { _command = new SqlCommand(StoredProcedure.Names.spAddTagged.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagId", SqlDbType.BigInt); _command.Parameters.Add("@TagName", SqlDbType.VarChar); _command.Parameters.Add("@UserId", SqlDbType.BigInt); _command.Parameters[0].Value = Tag.TagId; _command.Parameters[1].Value = Tag.TagName; _command.Parameters[2].Value = Tag.UserId; _connection.Open(); TagId = _command.ExecuteNonQuery(); } catch (Exception error) { throw; } finally { _connection.Close(); } return(TagId); }
public List <DtoTag> GetPremalinkTagsById(Int64 premalinkId) { _command = new SqlCommand(StoredProcedure.Names.spGetPremalinkTagsById.ToString(), _connection) { CommandType = CommandType.StoredProcedure }; _command.Parameters.Add("@PremaLinkID", SqlDbType.BigInt); _command.Parameters[0].Value = premalinkId; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _dtotag = new DtoTag { TagId = Convert.ToInt64(_datareader["TagID"]), TagName = _datareader["TagName"].ToString() }; _lsttag.Add(_dtotag); } _connection.Close(); return(_lsttag); }
public void Edit(DtoTag tag) { var editTag = new Tag(); editTag.Id = tag.Id; editTag.Name = tag.Name; editTag.Active = tag.Active; base.Update(editTag, tag.Id); base.Save(); }
public DtoTag GetById(int id) { var data = base.Get(id); DtoTag tag = new DtoTag(); tag.Id = data.Id; tag.Name = data.Name; tag.Active = data.Active; return(tag); }
public long VoteTagged(DtoTag Tag) { try { _daltag = new DalTag(); return(_daltag.VoteTagged(Tag)); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(0); }
public long AssociateTag(DtoTag tag) { try { _daltag = new DalTag(); return(_daltag.AssociateTag(tag)); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(0); }
public Int64 IncrementTag(DtoTag Tag) { try { _daltag = new DalTag(); return(_daltag.IncrementTag(Tag)); } catch (Exception ex) { ex.ToExceptionless().Submit(); } return(0); }
public List <DtoTag> GetAllTags(long UserID, string Tagname, int CurrentPage, int TotalRecord, string flow) { try { _command = new SqlCommand(StoredProcedure.Names.spGetAllTags.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@UserID", SqlDbType.BigInt); _command.Parameters.Add("@TagName", SqlDbType.VarChar); _command.Parameters.Add("@PageNo", SqlDbType.Int); _command.Parameters.Add("@PageSize", SqlDbType.Int); _command.Parameters.Add("@Flow", SqlDbType.VarChar); _command.Parameters[0].Value = UserID; _command.Parameters[1].Value = Tagname; _command.Parameters[2].Value = Convert.ToInt32(CurrentPage); _command.Parameters[3].Value = Convert.ToInt32(TotalRecord); _command.Parameters[4].Value = flow; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["TagId"].ToString()); _tag.TagName = _datareader["TagName"].ToString(); _tag.TotalPage = Convert.ToInt32(_datareader["TotalPage"]); _tag.UserId = Convert.ToInt64(_datareader["UserId"]); _tag.TagCount = Convert.ToInt64(_datareader["userFollow"]); _lsttag.Add(_tag); } } catch (Exception error) { throw error; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> GetAllTag(string WebSiteName, string Premalink, long userid) { try { _command = new SqlCommand(StoredProcedure.Names.spGetAllTag.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@WebSiteName", SqlDbType.VarChar); _command.Parameters.Add("@Premalink", SqlDbType.VarChar); _command.Parameters.Add("@UserId", SqlDbType.BigInt); _command.Parameters[0].Value = WebSiteName; _command.Parameters[1].Value = Premalink; _command.Parameters[2].Value = userid; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } else { while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["Tagid"]); _tag.TagName = _datareader["TagName"].ToString(); _tag.TagCount = Convert.ToInt64(_datareader["TotalVote"]); _tag.MetaTagCheck = Convert.ToBoolean(_datareader["MetaTagCheck"]); _tag.IsActive = Convert.ToBoolean(_datareader["IsActive"]); _lsttag.Add(_tag); } } } catch (Exception) { throw; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> GetWebsiteTags(long Id) { try { _command = new SqlCommand(StoredProcedure.Names.spGetWebsiteTags.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@Id", SqlDbType.BigInt); _command.Parameters[0].Value = Id; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } else { while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["Id"]); _tag.TagName = _datareader["Name"].ToString(); _tag.TagCount = Convert.ToInt64(_datareader["Count"]); _tag.WebsiteName = _datareader["WebsiteName"].ToString(); _lsttag.Add(_tag); } } } catch (Exception) { throw; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> GetUserTags(long CurrentUserID, long LoggedInUser) { try { _command = new SqlCommand(StoredProcedure.Names.spGetUserTags.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@CurrentUserID", SqlDbType.BigInt); _command.Parameters.Add("@LoggedInUser", SqlDbType.BigInt); _command.Parameters[0].Value = CurrentUserID; _command.Parameters[1].Value = LoggedInUser; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt64(_datareader["TagID"].ToString()); _tag.TagName = _datareader["TagName"].ToString(); _tag.TagCount = Convert.ToInt64(_datareader["Count"].ToString()); _tag.UserId = Convert.ToInt64(_datareader["LoggedUserTag"]); _lsttag.Add(_tag); } } catch (Exception error) { throw error; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> WhyTagIntellisense(string TagName, string premalink, string websitename) { try { _command = new SqlCommand(StoredProcedure.Names.spWhyTagIntellisense.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagName", SqlDbType.VarChar); _command.Parameters.Add("@premalink", SqlDbType.VarChar); _command.Parameters.Add("@websitename", SqlDbType.VarChar); _command.Parameters[0].Value = TagName; _command.Parameters[1].Value = premalink; _command.Parameters[2].Value = websitename; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["TagId"].ToString()); _tag.TagName = _datareader["TagName"].ToString(); _lsttag.Add(_tag); } } catch (Exception) { throw; } finally { _connection.Close(); } return(_lsttag); }
protected void Page_Load(object sender, EventArgs e) { try { IsUser(); if (!IsPostBack) { var uId = GetUserId(); ViewState["tagid"] = 0; //cookie = this.Request.Cookies["Tagged"]; _dtotag = new DtoTag(); _blltag = new BllTag(); //BtnTagFollow.Attributes.Add("onclick", "AddUserTagSubscription('" + tagid.ToString() + "')"); if (Request.QueryString["flow"] != null) { if (Request.QueryString["flow"].ToLower() == "explore") { ViewState["tagid"] = Convert.ToInt64(Request.QueryString["Id"]); Lstdtonewsfeed = _blltag.GetTagNewsFeed(uId, Convert.ToInt64(ViewState["tagid"]), 1, 10); _dtotag = _blltag.GetTagById(Convert.ToInt64(ViewState["tagid"])); lbltagname.Text = _dtotag.TagName; } else if (Request.QueryString["flow"].ToLower() == "inlinecode") { ViewState["tagid"] = Convert.ToInt64(Request.QueryString["Id"]); Websiteid = Convert.ToInt64(Request.QueryString["WebsiteId"]); Lstdtonewsfeed = _blltag.GetTagNewsFeed(uId, Convert.ToInt64(ViewState["tagid"]), 1, 10); _dtotag = _blltag.GetTagById(Convert.ToInt64(ViewState["tagid"])); lbltagname.Text = _dtotag.TagName; Lsttag = _blltag.GetWebsiteTags(Websiteid); } } } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void GridPremalinkTags_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { _dtotag = new DtoTag(); _dtotag = (DtoTag)e.Row.DataItem; var lnkTagName = ((Label)e.Row.FindControl("lbltagname")); lnkTagName.Text = _dtotag.TagName; var linkDeletePremalinkTag = (HtmlImage)e.Row.FindControl("imgdelete"); linkDeletePremalinkTag.Attributes.Add("onclick", "SetSelectedValue('" + Convert.ToInt64(ViewState["_premalinkId"]) + "','" + _dtotag.TagId + "')"); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public List <DtoTag> GetTagged(long tagId) { try { _command = new SqlCommand(StoredProcedure.Names.spGetTagged.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@TagId", SqlDbType.BigInt); _command.Parameters[0].Value = tagId; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt64(_datareader["TaggedoneId"].ToString()); _tag.TagName = _datareader["TagName"].ToString(); _tag.TagCount = Convert.ToInt64(_datareader["TotalVote"].ToString()); _lsttag.Add(_tag); } } catch (Exception error) { throw error; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> GetTagsbyPremalink(string Premalink) { try { _command = new SqlCommand(StoredProcedure.Names.spGetTagsbyPremalink.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@Premalink", SqlDbType.VarChar); _command.Parameters[0].Value = Premalink; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["Tag_Id"].ToString()); _tag.VoteType = _datareader["TotalVote"].ToString(); _tag.TagName = _datareader["TagName"].ToString(); _lsttag.Add(_tag); } } catch (Exception error) { throw; } finally { _connection.Close(); } return(_lsttag); }
public List <DtoTag> TagIntellisense(string prefixText) { try { _command = new SqlCommand(StoredProcedure.Names.spTagIntellisense.ToString(), _connection); _command.CommandType = CommandType.StoredProcedure; _command.Parameters.Add("@PrefixText", SqlDbType.VarChar); _command.Parameters[0].Value = prefixText; _lsttag = new List <DtoTag>(); _connection.Open(); _datareader = _command.ExecuteReader(); if (!_datareader.HasRows) { return(null); } while (_datareader.Read()) { _tag = new DtoTag(); _tag.TagId = Convert.ToInt32(_datareader["Id"].ToString()); _tag.TagName = _datareader["Name"].ToString(); _lsttag.Add(_tag); } } catch (Exception error) { throw; } finally { _connection.Close(); } return(_lsttag); }
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) { bltag = new BllTag(); DtoTag t = new DtoTag(); try { if (hdnWhattag.Value != null && hdnWhattag.Value.ToString() != "") { string[] Whatoldtags = ViewState["Whattags"].ToString().Split('|'); string[] Whatnewtags = hdnWhattag.Value.Split('|'); for (int i = 1; i < Whatnewtags.Length; i++) { if (Convert.ToInt64(Whatnewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Whatnewtags[i].Split(',')[1]); t.TagName = Whatnewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "What"; if (Convert.ToInt32(Whatnewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } if (hdnWheretag.Value != null && hdnWheretag.Value.ToString() != "") { string[] Whereoldtags = ViewState["Wheretags"].ToString().Split('|'); string[] Wherenewtags = hdnWheretag.Value.Split('|'); for (int i = 1; i < Wherenewtags.Length; i++) { if (Convert.ToInt64(Wherenewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Wherenewtags[i].Split(',')[1]); t.TagName = Wherenewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "Where"; if (Convert.ToInt64(Wherenewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } if (hdnWhentag.Value != null && hdnWhentag.Value.ToString() != "") { string[] Whenoldtags = ViewState["Whentags"].ToString().Split('|'); string[] Whennewtags = hdnWhentag.Value.Split('|'); for (int i = 1; i < Whennewtags.Length; i++) { if (Convert.ToInt64(Whennewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Whennewtags[i].Split(',')[1]); t.TagName = Whennewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "When"; if (Convert.ToInt64(Whennewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } if (hdnWhotag.Value != null && hdnWhotag.Value.ToString() != "") { string[] Whooldtags = ViewState["Whotags"].ToString().Split('|'); string[] Whonewtags = hdnWhotag.Value.Split('|'); for (int i = 1; i < Whonewtags.Length; i++) { if (Convert.ToInt64(Whonewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Whonewtags[i].Split(',')[1]); t.TagName = Whonewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "Who"; if (Convert.ToInt64(Whonewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } if (hdnHowtag.Value != null && hdnHowtag.Value.ToString() != "") { string[] Howoldtags = ViewState["Howtags"].ToString().Split('|'); string[] Hownewtags = hdnHowtag.Value.Split('|'); for (int i = 1; i < Hownewtags.Length; i++) { if (Convert.ToInt64(Hownewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Hownewtags[i].Split(',')[1]); t.TagName = Hownewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "How"; if (Convert.ToInt64(Hownewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } if (hdnWhytag.Value != null && hdnWhytag.Value.ToString() != "") { string[] Whyoldtags = ViewState["Whytags"].ToString().Split('|'); string[] Whynewtags = hdnWhytag.Value.Split('|'); for (int i = 1; i < Whynewtags.Length; i++) { if (Convert.ToInt64(Whynewtags[i].Split(',')[2]) == 1) { t = new DtoTag(); t.TagId = Convert.ToInt64(Whynewtags[i].Split(',')[1]); t.TagName = Whynewtags[i].Split(',')[0]; t.Link = Premalink; t.WebsiteName = WebsiteName; t.TagType = "Why"; if (Convert.ToInt64(Whynewtags[i].Split(',')[1]) == 0) { bltag.AddTag(t); } else { bltag.AssociateTag(t); } } } } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
public object TagEdit([FromBody] DtoTag tag) { _Tag.Edit(tag); return(tag.Id); }