Ejemplo n.º 1
0
 public ActionResult Edit(int id)
 {
     if (this.Authorizer.IsLogedIn(this.Session, this.Request))
     {
         this.Authorizer.ReauthorizeLogin(this.Session);
         DBBlogArticle article = new DBBlogArticleRepository(this.DatabaseContext).Find(id);
         this.ViewBag.Header = "Editing article " + article.Name;
         return(View(article));
     }
     return(RedirectToAction("Index", "Login"));
 }
Ejemplo n.º 2
0
 public ActionResult Delete(int id)
 {
     if (this.Authorizer.IsLogedIn(this.Session, this.Request))
     {
         this.Authorizer.ReauthorizeLogin(this.Session);
         DBBlogArticleRepository repository = new DBBlogArticleRepository(this.DatabaseContext);
         DBBlogArticle           article    = repository.Find(id);
         repository.Remove(article, true);
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("Index", "Login"));
 }