Esempio n. 1
0
 //
 // GET: /Admin/Announcements/Create
 public ActionResult Create()
 {
     var opportunities = _svc.GetAvailableOpportunities();
     var vm = new AnnouncementBindingModel(new Announcement
                                           {
                                               StartDate = DateTime.UtcNow,
                                               Deadline = DateTime.UtcNow,
                                               PostDate = DateTime.UtcNow
                                           }, opportunities);
     return View(vm);
 }
Esempio n. 2
0
        public ActionResult Create(Announcement announcement)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                    _svc.CreateAnnoucement(announcement);

                return RedirectToAction("Index");
            }
            catch
            {
                var opportunities = _svc.GetAvailableOpportunities();
                var vm = new AnnouncementBindingModel(announcement, opportunities);

                return View(vm);
            }
        }
Esempio n. 3
0
        //
        // GET: /Admin/Announcements/Edit/5
        public ActionResult Edit(Guid id)
        {
            var opportunities = _svc.GetAvailableOpportunities();
            var announcement = _svc.GetAnnouncementsById(id);
            var vm = new AnnouncementBindingModel(announcement, opportunities);

            return View(vm);
        }