public IActionResult DoEditCategoryRank(int id, int rank)
        {
            ArticleCategory entity = ArticleCategory.Find(ArticleCategory._.Id == id);

            if (entity == null)
            {
                tip.Message = "系统找不到本记录";
                return(Json(tip));
            }
            entity.Rank = rank;
            entity.Update();
            Admin.WriteLogActions($"修改文章栏目排序(id:{id},排序:{rank});");
            tip.Message = "修改排序成功!";
            tip.Status  = JsonTip.SUCCESS;
            return(Json(tip));
        }
Exemple #2
0
    //Handles update comment
    public void Update_Category(Object s, EventArgs e)
    {
        //Instantiate article delete object
        ArticleCategory UpdateCat = new ArticleCategory();

        UpdateCat.CatID    = int.Parse(Request.Form["CategoryID"]);
        UpdateCat.Category = Request.Form["CategoryName"];

        Caching.PurgeCacheItems("ArticleCategory_SideMenu");

        //Notify user if error occured.
        if (UpdateCat.Update() != 0)
        {
            JSLiteral.Text = "Error occured while processing your submit.";
            return;
        }

        Response.Redirect("confirmarticlecatedit.aspx?catname=" + UpdateCat.Category + "&mode=update");
    }