// // GET: /AdminNews/Create public ActionResult Create() { news_item news_item = new news_item() { date = DateTime.Now.AddDays(7) }; return View(news_item); }
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); } }
public void Delete(news_item news_item) { db.news_items.DeleteOnSubmit(news_item); }
public void Add(news_item news_item) { db.news_items.InsertOnSubmit(news_item); }
partial void Deletenews_item(news_item instance);
partial void Updatenews_item(news_item instance);
partial void Insertnews_item(news_item instance);