示例#1
0
        /// <summary>
        /// 添加或者编辑新闻
        /// </summary>
        /// <param name="news">新闻</param>
        /// <returns>返回添加或保存结果</returns>
        public Response CreateOrUpdate(News news)
        {
            return this.InvokeService(
                nameof(CreateOrUpdate),
                () =>
                {
                    this.Persistence.Update(NS, "CreateOrUpdate", news);

                    this.ClearCache<News>();
                    this.ClearCache<File>();
                }, news);
        }
示例#2
0
        public ActionResult CreateOrUpdate(News news)
        {
            var rspFile = this.FileStorageClient.Upload(WebHelper.GetLogOnAccount(), this.Request);

            if (rspFile.IsSuccess)
            {
                news.PublisherId = WebHelper.GetLogOnUserId();

                var rsp = this.NewsService.CreateOrUpdate(news);
            }

            return RedirectToAction("Index");
        }