示例#1
0
        public ActionResult Create(AnnouncementInfo announcementInfo)
        {
            try
            {
                announcementInfo.CreatedByAccountId = CurrentUser.AccountId;
                announcementInfo.CreatedOn          = DateTime.Now;

                using (AnnouncementRepository Repo = new AnnouncementRepository())
                {
                    Repo.SaveAnnouncement(announcementInfo);
                }

                TempData["Msg"] = AlertMessageProvider.SuccessMessage("Announcement created successfully.");

                return(RedirectToAction("Manage", "Announcement"));
            }

            catch (Exception ex)
            {
                return(View("Error", new HandleErrorInfo(ex, "Announcement", "Create")));
            }
        }