public ActionResult DeleteJournal(int id) { JournalDAO journaldao = new JournalDAO(); journaldao.DeleteJournal(id); return(Redirect("/Home/Journals/")); }
public ActionResult AddJournal(string Title, HttpPostedFileBase upload) { if (upload != null) { string filename = System.IO.Path.GetFileName(upload.FileName); upload.SaveAs(Server.MapPath("~/Content/journal/" + filename)); Journal journal = new Journal() { Title = Title, File = upload.FileName, Date = DateTime.Now.Date }; JournalDAO journaldao = new JournalDAO(); journaldao.AddJournal(journal); return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Journals() { JournalDAO dao = new JournalDAO(); return(View(dao.GetJournalsAll())); }