// GET: Alerts/Create public IActionResult Create() { var vm = new AlertVM() { }; return(View(vm)); }
protected void SetAlertModel() { AlertVM alert = new AlertVM { Message = (string)this.TempData[AlertMessageKey], Success = (bool)this.TempData[AlertTypeKey] }; this.ViewBag.Alert = alert; this.TempData.Remove(HasAlertKey); this.TempData.Remove(AlertMessageKey); this.TempData.Remove(AlertTypeKey); }
// GET: Alerts/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } SetupUser(); var alert = await _context.Alerts.FirstAsync(c => c.AlertId == id && c.UserId == _userDetails.UserId); if (alert == null) { return(NotFound()); } var vm = new AlertVM(alert); return(View(vm)); }