コード例 #1
0
        public async SystemTask DeleteAsync(Guid id)
        {
            using (var dbContext = _dbContextScopeFactory.Create())
            {
                var notificationType = await _notificationTypeRepository.FindAsync(p => p.Id == id);

                _notificationTypeRepository.Delete(notificationType);
                dbContext.SaveChanges();
                await GetListAsync(true);
            }
        }
コード例 #2
0
 public ActionResult Delete(int id)
 {
     try
     {
         NotificationType group = _notificationtypeReporRepository.GetById(id);
         _notificationtypeReporRepository.Delete(group);
         _notificationtypeReporRepository.SaveChanges();
         _viewMessageLogic.SetNewMessage("Eliminado", "Eliminado exitosamente.", ViewMessageType.SuccessMessage);
         return(RedirectToAction("Index"));
     }
     catch
     {
         _viewMessageLogic.SetNewMessage("Error en eliminación",
                                         "El Tipo de Notificacion no pudo ser eliminado correctamente, por favor intente nuevamente.",
                                         ViewMessageType.ErrorMessage);
         return(View("Index"));
     }
 }