public ActionResult _EditPointRules(string itemKey) { PointItemEditModel editModel = new PointItemEditModel(); PointItem pointItem = pointService.GetPointItem(itemKey); if (pointItem != null) editModel = pointItem.AsEditModel(); IEnumerable<PointCategory> pointCategories = pointService.GetPointCategories(); ViewData["traPoint"] = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("TradePoints")).CategoryName; ViewData["expPoint"] = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("ExperiencePoints")).CategoryName; ViewData["prePoint"] = pointCategories.FirstOrDefault(n => n.CategoryKey.Equals("ReputationPoints")).CategoryName; return View(editModel); }
public ActionResult _EditPointRules(PointItemEditModel model) { PointItem pointItem = model.AsPointItem(); pointService.UpdatePointItem(pointItem); return Json(new StatusMessageData(StatusMessageType.Success, "编辑成功!")); }