示例#1
0
        //
        // GET: /AdminNews/Create
        public ActionResult Create()
        {
            news_item news_item = new news_item()
            {
                date = DateTime.Now.AddDays(7)
            };

            return View(news_item);
        }
示例#2
0
        public ActionResult Create(news_item news_item)
        {
            try
            {

                UpdateModel(news_item);

                newsRepository.Add(news_item);
                newsRepository.Save();

                return RedirectToAction("Index", new { id = news_item.idnews });
            }
            catch
            {

                return View(news_item);
            }
        }
示例#3
0
 public void Delete(news_item news_item)
 {
     db.news_items.DeleteOnSubmit(news_item);
 }
示例#4
0
 public void Add(news_item news_item)
 {
     db.news_items.InsertOnSubmit(news_item);
 }
示例#5
0
 partial void Deletenews_item(news_item instance);
示例#6
0
 partial void Updatenews_item(news_item instance);
示例#7
0
 partial void Insertnews_item(news_item instance);