public async Task <ActionResult> AddSiteNotification() { AddEditSiteNotificationViewModel model = new AddEditSiteNotificationViewModel(); model.LoggedInUser = await siteService.GetCurrentUser(); model.FullNavList = CreateHomeAdminNavList(); return(View(model)); }
public async Task <ActionResult> AddSiteNotification(AddEditSiteNotificationViewModel model) { if (ModelState.IsValid) { siteService.AddSiteNotification(model.SiteNotification); } model.SiteNotification = siteService.GetSiteNotificationByID(model.SiteNotification.SiteNotificationID); model.LoggedInUser = await siteService.GetCurrentUser(); model.FullNavList = CreateHomeAdminNavList(); return(View("EditSiteNotification", model)); }
public async Task <ActionResult> EditSiteNotification(int id) { AddEditSiteNotificationViewModel model = new AddEditSiteNotificationViewModel(); model.SiteNotification = siteService.GetSiteNotificationByID(id); model.LoggedInUser = await siteService.GetCurrentUser(); model.FullNavList = CreateHomeAdminNavList(); if (model.SiteNotification == null) { return(View("AdminSiteNotifications")); } return(View(model)); }