Ejemplo n.º 1
0
        public ActionResult UpdateColumn(ColumnView column)
        {
            try
            {
                var article = Article.Find(column.Id);
                if (article != null)
                {
                    article.Name = column.Name;
                    article.Order = column.Order;
                    article.Save();
                    return this.Json(new ActionResultStatus(), JsonRequestBehavior.AllowGet);
                }

                return this.Json(new ActionResultStatus(10, "栏目不存在!"), JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return this.Json(new ActionResultStatus(ex), JsonRequestBehavior.AllowGet);
            }
        }
Ejemplo n.º 2
0
 public ActionResult CreateColumn(ColumnView column)
 {
     try
     {
         var article = new Article() { Category = Category.Columns, Name = column.Name, Order = column.Order };
         article.Create();
         return this.Json(new ActionResultStatus(), JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex)
     {
         return this.Json(new ActionResultStatus(ex), JsonRequestBehavior.AllowGet);
     }
 }