Пример #1
0
        public ActionResult DeleteJournal(int id)
        {
            JournalDAO journaldao = new JournalDAO();

            journaldao.DeleteJournal(id);
            return(Redirect("/Home/Journals/"));
        }
Пример #2
0
        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());
            }
        }
Пример #3
0
        public ActionResult Journals()
        {
            JournalDAO dao = new JournalDAO();

            return(View(dao.GetJournalsAll()));
        }