#pragma checksum "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0b7aff11b5393ac6ae40fa0b9db1782c832bede8"
// <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 13 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\_Imports.razor"
using Microsoft.AspNetCore.Identity;

#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 2 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
using SPWA.DataAccess.Data.CourseService;

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

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

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

    // AuthenticationState is available as a CascadingParameter
    [CascadingParameter]
    private Task<AuthenticationState>
    authenticationStateTask
    { get; set; }

    List<Evaluation> evaluation;


    protected override async Task OnInitializedAsync()
    {
        // Get the current user
        var user = (await authenticationStateTask).User;
        // Get the Evaluation for the current user
        // We access EvaluationService using @Service
        evaluation = await @Service.GetEvaluationAsync(user.Identity.Name);
    }
    string strError = "";
    Evaluation objEvaluation = new Evaluation();
    bool ShowPopup = false;
    bool ReadMorePopup = false;

    void ClosePopup()
    {
        // Close the Popup
        ShowPopup = false;
    }


    void AddNewEvaluation()
    {
        //System.Diagnostics.Debug.WriteLine("read value =" + ReadMorePopup);
        // Make new Evaluation
        objEvaluation = new Evaluation();
        // Set Id to 0 so we know it is a new record
        objEvaluation.EvaluationID = 0;
        // Open the Popup
        ShowPopup = true;

    }



    async Task SaveEvaluation()
    {
        // Close the Popup
        ShowPopup = false;
        // Get the current user
        var user = (await authenticationStateTask).User;
        // A new Evaluation will have newEvaluation set to true
        if (objEvaluation.EvaluationID == 0)
        {
            // Create new Evaluation
            Evaluation objNewEvaluation = new Evaluation();
            //objNewEvaluation.EvaluationID = objEvaluation.EvaluationID;
            objNewEvaluation.EvalType = objEvaluation.EvalType;
            objNewEvaluation.Sprint = objEvaluation.Sprint;
            objNewEvaluation.StudentId = objEvaluation.StudentId;
            objNewEvaluation.QAnswers = objEvaluation.QAnswers;



            // Save the result
            var result =
            @Service.CreateEvaluationAsync(objNewEvaluation);
        }
        else
        {
            // This is an update
            var result =
            @Service.UpdateEvaluationAsync(objEvaluation);
        }
        // Get the objEvaluation for the current user
        evaluation =
        await @Service.GetEvaluationAsync(user.Identity.Name);
    }


    void EditEvaluation(Evaluation evaluation)
    {
        //System.Diagnostics.Debug.WriteLine("read value =" + ReadMorePopup);
        // Set the selected Evaluation
        // as the current Evaluation
        objEvaluation = evaluation;
        // Open the Popup
        ShowPopup = true;
    }

    void ReadEvaluation(Evaluation evaluation)
    {
        //System.Diagnostics.Debug.WriteLine("In Readmorepopup ");
        // Set the selected Evaluation
        // as the current Evaluation
        objEvaluation = evaluation;
        // Open the Popup
        ReadMorePopup = true;
        //System.Diagnostics.Debug.WriteLine(ReadMorePopup);
    }

    async Task DeleteEvaluation()
    {
        // Close the Popup
        ShowPopup = false;
        // Get the user

    }



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