Example #1
0
        //------------------------------------------------------------------------------------------

        //------------------------------------------------------------------------------------------
        public ActionResult getNewsTags(int id)
        {
            TagManagement tagManager = new TagManagement();
            List <sp_Tag_GetNewsTags_Result> news_tags = new List <sp_Tag_GetNewsTags_Result>();

            news_tags = tagManager.GetNewsTags(id);
            return(View(news_tags));
        }
Example #2
0
        //------------------------------------------------------------------------------------------

        //------------------------------------------------------------------------------------------
        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());
        }
Example #3
0
        //------------------------------------------------------------------------------------------

        //------------------------------------------------------------------------------------------
        public string deletetag()
        {
            int tag_plst_id = 0;

            if (Request.QueryString["tag_plst_id"] != null)
            {
                Int32.TryParse(Request.QueryString["tag_plst_id"].ToString(), out tag_plst_id);
            }

            int article_id = 0;

            if (Request.QueryString["article_id"] != null)
            {
                Int32.TryParse(Request.QueryString["article_id"], out article_id);
            }

            TagManagement tagManager = new TagManagement();

            tagManager.DeleteNewsTag(tag_plst_id);

            return("");
        }
Example #4
0
 public TagsController(WorkFlowDbContext context)
 {
     tm        = new TagManagement(context);
     converter = new Converter();
 }