コード例 #1
0
        public ActionResult Create(Guid OnlineCommentsId)
        {
            OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel();

            model.OnlineCommentsId = OnlineCommentsId;

            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
コード例 #2
0
        public ActionResult Details(Guid id)
        {
            OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel();
            var info = service.GetById(id);

            model.UserId           = info.UserId;
            model.OnlineCommentsId = info.OnlineCommentsId;
            model.UserName         = info.UserName;
            model.Content          = info.Content;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Details"), model));
        }
コード例 #3
0
        public ActionResult Delete(Guid id)
        {
            OnlineCommentsOpinionModel model = new OnlineCommentsOpinionModel();
            var info = service.GetById(id);

            if (info != null)
            {
                service.Delete(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }

            return(View());
        }
コード例 #4
0
        public ActionResult Edit(OnlineCommentsOpinionModel model)
        {
            if (ModelState.IsValid)
            {
                OnlineCommentsOpinion info = service.GetById(model.Id);

                info.UserId           = model.UserId;
                info.OnlineCommentsId = model.OnlineCommentsId;
                info.UserName         = model.UserName;
                info.Content          = model.Content;
                service.Update(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
コード例 #5
0
        public ActionResult Create(OnlineCommentsOpinionModel model)
        {
            if (ModelState.IsValid)
            {
                OnlineCommentsOpinion info = new OnlineCommentsOpinion();
                info.Id               = Guid.NewGuid();
                info.UserId           = model.UserId;
                info.OnlineCommentsId = model.OnlineCommentsId;
                info.UserName         = model.UserName;
                info.Content          = model.Content;

                service.Add(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }