Exemplo n.º 1
0
    public async Task SubmitRequest(ClubRequestViewModel request)
    {
        var coreRequest = _mapper.Map <Core.Model.ClubRequest>(request);

        coreRequest.RequestSubmitted = DateTime.Now;
        coreRequest.ClubInitials     = request.ClubInitials.ToUpper();
        var id = await _coreClubRequestService.Submit(coreRequest);

        await ProcessRequest(id, false, null);

        await SendUserNotice(request);
        await SendAdminNotice(coreRequest);
    }
Exemplo n.º 2
0
    public async Task <ActionResult> RequestClub(ClubRequestViewModel request)
    {
        if (!ModelState.IsValid)
        {
            return(View(request));
        }

        if (!(await _clubRequestService.AreInitialsAllowed(request.ClubInitials)))
        {
            ModelState.AddModelError("ClubInitials", "Initials not valid.");
            return(View(request));
        }

        await _clubRequestService.SubmitRequest(request);

        return(View("RequestSubmitted", request));
    }
Exemplo n.º 3
0
 public async Task UpdateRequest(ClubRequestViewModel vm)
 {
     var coreRequest = _mapper.Map <Core.Model.ClubRequest>(vm);
     await _coreClubRequestService.UpdateRequest(coreRequest);
 }
Exemplo n.º 4
0
    private async Task SendUserNotice(ClubRequestViewModel request)
    {
        var emailBody = await _emailSender.GetHtmlFromView("Templates/ClubCreated", request);

        await _emailSender.SendEmailAsync(request.ContactEmail, "SailScores Club Created", emailBody);
    }