#pragma checksum "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "df3b1b60aa92d71208f0921f9d214310bce9341b"
// <auto-generated/>
#pragma warning disable 1591
#pragma warning disable 0414
#pragma warning disable 0649
#pragma warning disable 0169

namespace SPWA.Pages
{
    #line hidden
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Components;
#nullable restore
#line 2 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using System.Net.Http;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Authorization;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Forms;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Routing;

#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Components.Web;

#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.JSInterop;

#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA;

#line default
#line hidden
#nullable disable
#nullable restore
#line 10 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA.Shared;

#line default
#line hidden
#nullable disable
#nullable restore
#line 11 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using MatBlazor;

#line default
#line hidden
#nullable disable
#nullable restore
#line 12 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using BlazorInputFile;

#line default
#line hidden
#nullable disable
#nullable restore
#line 14 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.DataProtection;

#line default
#line hidden
#nullable disable
#nullable restore
#line 15 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using SPWA.LoginFeatures.Account.Pages.GoogleLogin;

#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor"
using Project.Data;

#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor"
using Project.Data.Project;

#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor"
using Microsoft.AspNetCore.Identity;

#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor"
using SPWA.DataAccess.Data;

#line default
#line hidden
#nullable disable
    [Microsoft.AspNetCore.Components.RouteAttribute("/ProjectDetails/{projectId:int}")]
    public partial class ProjectDetails : OwningComponentBase<ProjectService>
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
        }
        #pragma warning restore 1998
#nullable restore
#line 246 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\ProjectDetails.razor"
       

    [CascadingParameter]
    private Task<AuthenticationState> authenticationStateTask { get; set; }
    System.Security.Claims.ClaimsPrincipal CurrentUser;
    Project project;
    [Parameter]
    public int projectId { get; set; }
    ApplicationUser objUser = new ApplicationUser();
    ApplicationUser objUser2 = new ApplicationUser();
    List<ApplicationUser> ColUsers = new List<ApplicationUser>();
    bool AddMemberPopup = false;

    protected override async Task OnInitializedAsync()
    {
        await GetUsers();
        // Get the current user
        var user = (await authenticationStateTask).User;
        // Get the Projects for the current user
        // We access ProjectService using @Service
        project = await @Service.GetSelectProjectAsync(projectId);
        CurrentUser = (await authenticationStateTask).User;
    }

    void ClosePopup()
    {
        AddMemberPopup = false;
    }
    void AddMemberPopupselect()
    {
        AddMemberPopup = true;
    }
    void AddUserToProject(ApplicationUser userToAdd)
    {
        objUser2 = userToAdd;
       
        //project.Members.Add(objUser2);
        //var result = @Service.UpdateProjectAsync(project);
        AddMemberPopup = false;
    }




    public async Task GetUsers()
    {
        // Collection to hold users
        ColUsers = new List<ApplicationUser>();
        // get users from _UserManager
        var user = _UserManager.Users.Select(x => new ApplicationUser
        {
            Id = x.Id,
            UserName = x.UserName,
            Email = x.Email,
            PasswordHash = "*****"
        });
        foreach (var item in user)
        {
            var UserResult = await _UserManager.IsInRoleAsync(item, "Administrators");
            if (!UserResult)
            {
                ColUsers.Add(item);
            }
        }
    }


#line default
#line hidden
#nullable disable
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private UserManager<ApplicationUser> _UserManager { get; set; }
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private NavigationManager NavigationManager { get; set; }
    }
}
#pragma warning restore 1591
