Ejemplo n.º 1
0
        public ActionResult _EditPresentAreaNavigation(string spaceKey, PresentAreaNavigationEditModel editModel)
        {
            User user = userService.GetFullUser(spaceKey);
            if (user == null)
                return HttpNotFound();

            //创建
            if (editModel.Id == 0)
            {
                new NavigationService().CreatePresentAreaNavigation(editModel.AsPresentAreaNavigation());
                return Json(new StatusMessageData(StatusMessageType.Success, "创建成功!"));
            }
            //编辑
            else
            {
                new NavigationService().UpdatePresentAreaNavigation(editModel.AsPresentAreaNavigation());
                return Json(new StatusMessageData(StatusMessageType.Success, "编辑成功!"));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建编辑呈现区域导航(页面)
        /// </summary>
        public ActionResult _EditPresentAreaNavigation(string spaceKey, long? id)
        {
            User user = userService.GetFullUser(spaceKey);
            if (user == null)
                return HttpNotFound();

            PresentAreaNavigationEditModel editModel = null;
            //创建
            if (id == null)
            {
                editModel = new PresentAreaNavigationEditModel();
                editModel.NavigationType = NavigationType.AddedByOwner;
                return View(editModel);
            }
            //编辑
            else
            {
                PresentAreaNavigation model = new NavigationService().GetPresentAreaNavigation(id.Value);
                return View(model.AsPresentAreaNavigationEditModel());
            }
        }