Exemple #1
0
        public async Task <IActionResult> AddAlert(AlertsViewModel model)
        {
            if (ModelState.IsValid)
            {
                var alert = await _converterHelper.ToAlertAsync(model, true);

                _datacontext.Alerts.Add(alert);
                await _datacontext.SaveChangesAsync();

                return(RedirectToAction($"AlertList/{model.Status_id}"));
            }

            return(View(model));
        }