public ActionResult AddNew(News news)
 {
     news.publictime = DateTime.Now;
     NewsService.GetInstance().Save(news);
     return RedirectToAction("news");
 }
Exemple #2
0
 public void Save(News news)
 {
     if (news.id > 0)
         _newsDao.Update(news);else
     _newsDao.Insert(news);
 }
 partial void DeleteNews(News instance);
 partial void UpdateNews(News instance);
 partial void InsertNews(News instance);
		private void detach_News(News entity)
		{
			this.SendPropertyChanging();
			entity.Category = null;
		}
		private void attach_News(News entity)
		{
			this.SendPropertyChanging();
			entity.Category = this;
		}