//------------------------------------------------------------------------------------------ public string getUserIdByName() { string str_val = ""; string username = ""; if (Request.QueryString["username"] != null) { username = Request.QueryString["username"]; } memberManagement memberManager = new memberManagement(); str_val = memberManager.getMemberByUserName(username).id.ToString(); return(str_val); }
//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------ public string addnewtag() { string ret_res = ""; string tag_name = ""; if (Request.QueryString["tag_name"] != null) { tag_name = Request.QueryString["tag_name"].ToString(); } int article_id = 0; if (Request.QueryString["article_id"] != null) { Int32.TryParse(Request.QueryString["article_id"], out article_id); } memberManagement memberManager = new memberManagement(); Member member = new Member(); member = memberManager.getMemberByUserName(User.Identity.Name); newsManagement newsManager = new newsManagement(); newsPost curr_article = new newsPost(); curr_article = newsManager.GetPostByID(article_id); if (curr_article.post_id != 0 && article_id == curr_article.post_id) { TagManagement tagManager = new TagManagement(); int tag_ID = 0; tag_ID = tagManager.AddNewTag(tag_name); tagManager.AddTagToNewsArticle(tag_ID, article_id); ret_res = tag_ID.ToString() + "|" + article_id.ToString(); } else { ret_res = "n/a"; } return(ret_res.ToString()); }
public string getPlaylistsByUsername() { string sel_list = ""; string username = ""; if (Request.QueryString["username"] != null) { username = Request.QueryString["username"]; } memberManagement memberManager = new memberManagement(); playlistManagement playlistManagement = new playlistManagement(); for (int i = 0; i < playlistManagement.GetUserPlaylists(memberManager.getMemberByUserName(username).id).Count; i++) { if (sel_list != "") { sel_list += ","; } sel_list += "{\"id\":" + playlistManagement.GetUserPlaylists(memberManager.getMemberByUserName(username).id)[i].id + ", \"name\":\"" + playlistManagement.GetUserPlaylists(memberManager.getMemberByUserName(username).id)[i].name + "\"}"; } return("[" + sel_list + "]"); }