Exemplo n.º 1
0
        public async Task <bool> ConfirmNewArtist(PaskolUser User, ConfirmTypeAction Action, string Password
                                                  , string DeclineReason)
        {
            bool ActionSuccess = false;

            switch (Action)
            {
            case ConfirmTypeAction.Ok:
                User.Status = UserStatus.Active;
                break;

            case ConfirmTypeAction.Decline:
                User.Status = UserStatus.WaitingNewArtist;
                MAILService.DeclineNewUpdateArtist(User.Email, DeclineReason);
                break;

            case ConfirmTypeAction.Block:
                User.Status = UserStatus.Blocked;
                break;
            }

            if (await UpdateUserAsync(User, Password))
            {
                var res = service.Delete(User.Id);
                if (res.Success)
                {
                    ActionSuccess = true;
                }
                else
                {
                    ModelState.AddModelError("", res.Message);
                }
            }

            return(ActionSuccess);
        }