예제 #1
0
 public ActionResult RemoveBookToArticle(BookToArticle vm)
 {
     var link = Repository.GetBookToArticle(vm.Id);
     Repository.Delete(link);
     Repository.Save();
     return RedirectToAction("editarticle", new { id = link.ArticleId });
 }
예제 #2
0
 public ActionResult CreateBookToArticle(int id)
 {
     var article = Repository.GetArticle(id);
     if (article == null) return HttpNotFound();
     var vm = new BookToArticle
         {
             ArticleId = id,
             Article = article,
             SequenceIdentifier = int.MaxValue
         };
     ViewBag.Books = LinkableBooksList(vm.BookId);
     return View(vm);
 }
예제 #3
0
 public ActionResult CreateBookToArticle(BookToArticle vm)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.Books = LinkableBooksList(vm.BookId);
         vm.Article = Repository.GetArticle(vm.ArticleId);
         return View(vm);
     }
     Repository.Add(vm);
     Repository.Save();
     return RedirectToAction("editarticle", new { id = vm.ArticleId });
 }
예제 #4
0
 partial void UpdateBookToArticle(BookToArticle instance);
예제 #5
0
 partial void DeleteBookToArticle(BookToArticle instance);
예제 #6
0
 partial void InsertBookToArticle(BookToArticle instance);
예제 #7
0
		private void detach_BookToArticles(BookToArticle entity)
		{
			this.SendPropertyChanging();
			entity.Article = null;
		}
예제 #8
0
		private void attach_BookToArticles(BookToArticle entity)
		{
			this.SendPropertyChanging();
			entity.Article = this;
		}
예제 #9
0
 public void Delete(BookToArticle link)
 {
     _db.BookToArticles.DeleteOnSubmit(link);
 }
예제 #10
0
 public void Add(BookToArticle link)
 {
     _db.BookToArticles.InsertOnSubmit(link);
 }