예제 #1
0
 public static string GetPathNewsHotel(NewsModel News)
 {
     string pattern = "{0}{1}";
     string filePath = System.Configuration.ConfigurationManager.AppSettings["ZDSL.Webapp.path.News.NewsHotel"];
     filePath = string.Format(filePath, News.id);
     if (IsDebug())
     {
         return string.Format(pattern, WebUtil.GetWebRootPath(), "/Public/News/NewsHotel?newsId=" + News.id);
     }
     else
     {
         return string.Format(pattern, WebUtil.GetWebRootPath(), filePath);
     }
 }
예제 #2
0
        public ActionResult Save()
        {
            NewsModel news = new NewsModel();
            news.status = BaseModel.STATUS_ACTIVATE;

            news = ObjectUtil.Eval(news, Request.Params, "", "");
            if (string.IsNullOrEmpty(news.id))
            {
                news.id = news.createPk().ToString();
            }
            JsResultObject result = BaseZdBiz.SaveOrUpdate(news, "新闻");
            return JsonText(result, JsonRequestBehavior.AllowGet);
        }