#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
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)
        {
            __builder.OpenComponent<MatBlazor.MatCard>(0);
            __builder.AddAttribute(1, "Class", "mat-elevation-z1");
            __builder.AddAttribute(2, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
                __builder2.AddMarkupContent(3, "\r\n    ");
                __builder2.OpenComponent<MatBlazor.MatDialogTitle>(4);
                __builder2.AddAttribute(5, "Style", "font-family:\'Nunito\';font-size:x-large");
                __builder2.AddAttribute(6, "Class", "font-weight-bold");
                __builder2.AddAttribute(7, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => {
                    __builder3.AddContent(8, "Evaluations Table");
                }
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(9, "\r\n");
            }
            ));
            __builder.CloseComponent();
            __builder.AddMarkupContent(10, "\r\n");
            __builder.OpenComponent<MatBlazor.MatDivider>(11);
            __builder.CloseComponent();
            __builder.AddMarkupContent(12, "\r\n\r\n");
            __builder.OpenElement(13, "div");
            __builder.AddAttribute(14, "class", "mat-elevation-z1");
            __builder.AddAttribute(15, "style", "font-family:\'Nunito\'");
            __builder.AddMarkupContent(16, "\r\n    ");
            __Blazor.SPWA.Pages.Evaluations.TypeInference.CreateMatBlazor_MatTable_0(__builder, 17, 18, 
#nullable restore
#line 16 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                evaluation

#line default
#line hidden
#nullable disable
            , 19, "table-hover", 20, "flex-wrap:wrap", 21, (__builder2) => {
                __builder2.AddMarkupContent(22, "\r\n            ");
                __builder2.AddMarkupContent(23, "<th style=\"font-weight:bold\">EvaluationID</th>\r\n            ");
                __builder2.AddMarkupContent(24, "<th style=\"font-weight:bold\">Evaluation Name(int)</th>\r\n            ");
                __builder2.AddMarkupContent(25, "<th style=\"font-weight:bold\">TermID</th>\r\n            ");
                __builder2.AddMarkupContent(26, "<th style=\"font-weight:bold\">Active</th>\r\n\r\n\r\n        ");
            }
            , 27, (context) => (__builder2) => {
                __builder2.AddMarkupContent(28, "\r\n            ");
                __builder2.OpenElement(29, "td");
                __builder2.AddAttribute(30, "width", "25%");
                __builder2.AddContent(31, 
#nullable restore
#line 26 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                             context.EvaluationID

#line default
#line hidden
#nullable disable
                );
                __builder2.CloseElement();
                __builder2.AddMarkupContent(32, "\r\n            ");
                __builder2.OpenElement(33, "td");
                __builder2.AddAttribute(34, "width", "25%");
                __builder2.AddContent(35, 
#nullable restore
#line 27 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                             context.EvalType

#line default
#line hidden
#nullable disable
                );
                __builder2.CloseElement();
                __builder2.AddMarkupContent(36, "\r\n            ");
                __builder2.OpenElement(37, "td");
                __builder2.AddAttribute(38, "width", "25%");
                __builder2.AddContent(39, 
#nullable restore
#line 28 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                             context.Sprint

#line default
#line hidden
#nullable disable
                );
                __builder2.CloseElement();
                __builder2.AddMarkupContent(40, "\r\n            ");
                __builder2.OpenElement(41, "td");
                __builder2.AddAttribute(42, "width", "25%");
                __builder2.AddContent(43, 
#nullable restore
#line 29 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                             context.QAnswers

#line default
#line hidden
#nullable disable
                );
                __builder2.CloseElement();
                __builder2.AddMarkupContent(44, "\r\n\r\n            ");
                __builder2.OpenElement(45, "td");
                __builder2.OpenComponent<MatBlazor.MatIconButton>(46);
                __builder2.AddAttribute(47, "Icon", "edit");
                __builder2.AddAttribute(48, "OnClick", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 31 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                                       (_) =>EditEvaluation(@context)

#line default
#line hidden
#nullable disable
                )));
                __builder2.AddAttribute(49, "Style", "color:dodgerblue");
                __builder2.CloseComponent();
                __builder2.CloseElement();
                __builder2.AddMarkupContent(50, "\r\n        ");
            }
            );
            __builder.AddMarkupContent(51, "\r\n");
            __builder.CloseElement();
            __builder.AddMarkupContent(52, "\r\n\r\n");
#nullable restore
#line 36 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
 if (ShowPopup)
{

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(53, "    \r\n    ");
            __builder.OpenElement(54, "div");
            __builder.AddAttribute(55, "class", "modal");
            __builder.AddAttribute(56, "tabindex", "-1");
            __builder.AddAttribute(57, "style", "display:block");
            __builder.AddAttribute(58, "role", "dialog");
            __builder.AddMarkupContent(59, "\r\n        ");
            __builder.OpenElement(60, "div");
            __builder.AddAttribute(61, "class", "modal-dialog");
            __builder.AddMarkupContent(62, "\r\n            ");
            __builder.OpenElement(63, "div");
            __builder.AddAttribute(64, "class", "modal-content");
            __builder.AddMarkupContent(65, "\r\n                ");
            __builder.OpenElement(66, "div");
            __builder.AddAttribute(67, "class", "modal-header");
            __builder.AddMarkupContent(68, "\r\n                    ");
            __builder.AddMarkupContent(69, "<h3 class=\"modal-title\">Edit Evaluation</h3>\r\n                    \r\n                    ");
            __builder.OpenElement(70, "button");
            __builder.AddAttribute(71, "type", "button");
            __builder.AddAttribute(72, "class", "close");
            __builder.AddAttribute(73, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 46 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                      ClosePopup

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(74, "\r\n                        ");
            __builder.AddMarkupContent(75, "<span aria-hidden=\"true\">X</span>\r\n                    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(76, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(77, "\r\n                \r\n                ");
            __builder.OpenElement(78, "div");
            __builder.AddAttribute(79, "class", "modal-body");
            __builder.AddMarkupContent(80, "\r\n                    \r\n");
#nullable restore
#line 53 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                     if (objEvaluation.EvaluationID != 0)
                    {

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(81, "                        <p></p>\r\n");
#nullable restore
#line 56 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                    }

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(82, "                    \r\n");
#nullable restore
#line 58 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                     if (objEvaluation.EvaluationID != 0)
                    {

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(83, "                        <p></p>\r\n");
#nullable restore
#line 61 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                    }
                    else
                    {

                    }

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(84, "\r\n                   \r\n                    ");
            __builder.AddMarkupContent(85, "<label for=\"Name\" class=\"control-label\">Evaluation Type</label>\r\n                    ");
            __builder.OpenElement(86, "input");
            __builder.AddAttribute(87, "class", "form-control");
            __builder.AddAttribute(88, "type", "text");
            __builder.AddAttribute(89, "placeholder", "Evaluation type");
            __builder.AddAttribute(90, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 71 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                  objEvaluation.EvalType

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(91, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objEvaluation.EvalType = __value, objEvaluation.EvalType));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(92, "\r\n                    ");
            __builder.AddMarkupContent(93, "<label for=\"Name\" class=\"control-label\">sprint</label>\r\n                    ");
            __builder.OpenElement(94, "input");
            __builder.AddAttribute(95, "class", "form-control");
            __builder.AddAttribute(96, "type", "text");
            __builder.AddAttribute(97, "placeholder", "sprint");
            __builder.AddAttribute(98, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 75 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                  objEvaluation.Sprint

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(99, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objEvaluation.Sprint = __value, objEvaluation.Sprint));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(100, "\r\n                    ");
            __builder.AddMarkupContent(101, "<label for=\"Name\" class=\"control-label\">Evaluation QAnswer</label>\r\n                    ");
            __builder.OpenElement(102, "input");
            __builder.AddAttribute(103, "class", "form-control");
            __builder.AddAttribute(104, "type", "text");
            __builder.AddAttribute(105, "placeholder", "Evaluation QAnswer");
            __builder.AddAttribute(106, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
#nullable restore
#line 79 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                  objEvaluation.QAnswers

#line default
#line hidden
#nullable disable
            ));
            __builder.AddAttribute(107, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => objEvaluation.QAnswers = __value, objEvaluation.QAnswers));
            __builder.SetUpdatesAttributeName("value");
            __builder.CloseElement();
            __builder.AddMarkupContent(108, "\r\n\r\n\r\n                    \r\n                    ");
            __builder.OpenElement(109, "button");
            __builder.AddAttribute(110, "class", "btn btn-primary");
            __builder.AddAttribute(111, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 84 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                      SaveEvaluation

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(112, "\r\n                        Save\r\n                    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(113, "\r\n                    \r\n");
#nullable restore
#line 88 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                     if (objEvaluation.EvaluationID != 0)
                    {

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(114, "                        \r\n                        ");
            __builder.OpenElement(115, "button");
            __builder.AddAttribute(116, "class", "btn btn-danger");
            __builder.AddAttribute(117, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 92 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                          DeleteEvaluation

#line default
#line hidden
#nullable disable
            ));
            __builder.AddMarkupContent(118, "\r\n                            Delete\r\n                        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(119, "\r\n");
#nullable restore
#line 95 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                    }

#line default
#line hidden
#nullable disable
            __builder.AddMarkupContent(120, "                    <br>\r\n                    ");
            __builder.OpenElement(121, "span");
            __builder.AddAttribute(122, "style", "color:red");
            __builder.AddContent(123, 
#nullable restore
#line 97 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                             strError

#line default
#line hidden
#nullable disable
            );
            __builder.CloseElement();
            __builder.AddMarkupContent(124, "\r\n                ");
            __builder.CloseElement();
            __builder.AddMarkupContent(125, "\r\n            ");
            __builder.CloseElement();
            __builder.AddMarkupContent(126, "\r\n        ");
            __builder.CloseElement();
            __builder.AddMarkupContent(127, "\r\n    ");
            __builder.CloseElement();
            __builder.AddMarkupContent(128, "\r\n");
#nullable restore
#line 102 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
}

#line default
#line hidden
#nullable disable
            __builder.OpenElement(129, "button");
            __builder.AddAttribute(130, "class", "btn btn-success");
            __builder.AddAttribute(131, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, 
#nullable restore
#line 103 "C:\Users\jayt7\Source\Repos\Senior-Project\SPWA\Pages\Evaluations.razor"
                                          AddNewEvaluation

#line default
#line hidden
#nullable disable
            ));
            __builder.AddContent(132, "Add Evaluation");
            __builder.CloseElement();
        }
        #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; }
    }
}
namespace __Blazor.SPWA.Pages.Evaluations
{
    #line hidden
    internal static class TypeInference
    {
        public static void CreateMatBlazor_MatTable_0<TableItem>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::System.Collections.Generic.IEnumerable<TableItem> __arg0, int __seq1, global::System.String __arg1, int __seq2, global::System.String __arg2, int __seq3, global::Microsoft.AspNetCore.Components.RenderFragment __arg3, int __seq4, global::Microsoft.AspNetCore.Components.RenderFragment<TableItem> __arg4)
        {
        __builder.OpenComponent<global::MatBlazor.MatTable<TableItem>>(seq);
        __builder.AddAttribute(__seq0, "Items", __arg0);
        __builder.AddAttribute(__seq1, "Class", __arg1);
        __builder.AddAttribute(__seq2, "Style", __arg2);
        __builder.AddAttribute(__seq3, "MatTableHeader", __arg3);
        __builder.AddAttribute(__seq4, "MatTableRow", __arg4);
        __builder.CloseComponent();
        }
    }
}
#pragma warning restore 1591
