Exemplo n.º 1
0
        public async Task DeleteManager_WhenDeletingAPendingHeadManager_NationalSocietyPendingManagerGetsNullified()
        {
            //arrange
            var manager         = _nyssContext.Users.Single(x => x.Id == _managerId);
            var nationalSociety = _nyssContext.NationalSocieties.Single(x => x.Id == _nationalSocietyId);

            nationalSociety.PendingHeadManager = manager;

            //act
            await _managerService.Delete(_managerId);

            //assert
            nationalSociety.PendingHeadManager.ShouldBe(null);
        }
Exemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            var manager = _service.GetManager(id);

            if (manager == null)
            {
                return(NotFound());
            }

            if (manager.UserId != UserId)
            {
                return(Problem(statusCode: 403));
            }

            var result = _service.Delete(manager);

            return(Ok(result));
        }
Exemplo n.º 3
0
 public void Delete()
 {
     try
     {
         var IsDeleted = objManagerService.Delete(CurrentManager);
         if (IsDeleted)
         {
             Message = "Менеджер удален !";
             LoadData();
         }
         else
         {
             Message = "Ошибка операции удаления !";
         }
     }
     catch (Exception ex)
     {
         Message = ex.Message;
     }
 }
Exemplo n.º 4
0
 public void Delete(Manager manager)
 => managerService.Delete(manager);