Esempio n. 1
0
        public void DeleteUserTest()
        {
            //PAGE2 user
            var userIdPage2 = new Guid("e99516ff-e3c0-46c3-8cc1-1fcc108e4056");

            var deleted = _userDomainService.DeleteUser(userIdPage2).Result;

            Assert.IsTrue(deleted);
        }
Esempio n. 2
0
 /// <summary>
 /// 删除用户
 /// </summary>
 /// <param name="deleteInfo">删除信息</param>
 /// <returns></returns>
 public Result DeleteUser(DeleteUserCmdDto deleteInfo)
 {
     if (deleteInfo == null || deleteInfo.UserIds.IsNullOrEmpty())
     {
         return(Result.FailedResult("没有指定任何要删除的用户信息"));
     }
     using (var businessWork = WorkFactory.Create())
     {
         var deleteResult = UserDomainService.DeleteUser(deleteInfo.UserIds);
         if (!deleteResult.Success)
         {
             return(deleteResult);
         }
         var commitResult = businessWork.Commit();
         return(commitResult.ExecutedSuccess ? Result.SuccessResult("删除成功") : Result.FailedResult("删除失败"));
     }
 }