예제 #1
0
        // GET: Alerts/Create
        public IActionResult Create()
        {
            var vm = new AlertVM()
            {
            };

            return(View(vm));
        }
예제 #2
0
        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);
        }
예제 #3
0
        // 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));
        }