コード例 #1
0
        public ActionResult Create()
        {
            var announcement = new Announcement();

            InitializeViewBagForAnnouncement();

            return View(announcement);
        }
コード例 #2
0
        public ActionResult Create(Announcement announcement)
        {
            if (ModelState.IsValid)
            {
                AnnouncementService.AddAnnouncement(announcement);
            }

            return View(announcement);
        }
コード例 #3
0
        public ActionResult Edit(Announcement announcement)
        {
            if (ModelState.IsValid)
            {
                AnnouncementService.UpdateAnnouncement(announcement);

                return RedirectToAction("Index");
            }

            InitializeViewBagForAnnouncement();

            return View(announcement);
        }
コード例 #4
0
        public void AddAnnouncement(Announcement announcement)
        {
            UnitOfWork.Announcements.Insert(announcement);

            UnitOfWork.Commit();
        }
コード例 #5
0
 public void AddAnnouncement(Announcement announcement)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
        public ActionResult Create()
        {
            var announcement = new Announcement();

            return View(announcement);
        }
コード例 #7
0
        public void UpdateAnnouncement(Announcement announcement)
        {
            UnitOfWork.Announcements.Update(announcement);

            UnitOfWork.Commit();
        }