public ActionResult Create(Artigo form)
 {
     try
     {
         rep.Add(form);
         rep.Save();
         rep.Dispose();
         return RedirectToAction("Details", new { id = form.ArtigoID });
     }
     catch
     {
         return View();
     }
 }
 public ActionResult Edit(int id, Artigo form)
 {
     var art = rep.GetArtigo(id);
     if (art.isOwnerOrAdmin)
     {
         UpdateModel(art);
         rep.Save();
         rep.Dispose();
         return RedirectToAction("Details", new { id = id });
     }
     else
         return View("AcessoNegado");
 }
Beispiel #3
0
 partial void DeleteArtigo(Artigo instance);
Beispiel #4
0
 partial void UpdateArtigo(Artigo instance);
Beispiel #5
0
 partial void InsertArtigo(Artigo instance);
Beispiel #6
0
		private void detach_Artigos(Artigo entity)
		{
			this.SendPropertyChanging();
			entity.Editor = null;
		}
Beispiel #7
0
		private void attach_Artigos(Artigo entity)
		{
			this.SendPropertyChanging();
			entity.Editor = this;
		}