@page "/fetchdata"
@inherits APageComponent
@{try{
<!--=============================================================================================-->
/*
// Rendering error test:
try {
   throw new ApplicationException( "Test error #1 has been thrown." );
}
catch (Exception e) {
   throw new ApplicationException( "Test error #2 has been thrown.", e );
}
*/
<p class="page_ImpressiveTitle">
   Weather forecast <i>FetchDataPage</i>-page (originated from Blazor-WASM app.template)
</p>
<p>
   <AButton @ref=@GetDataButton ID="pg_fetchdata_GetDataBUTTON"
            Classes_0="btn btn-primary" Title="Perform server request"
            ON_Click_A=@GetDataButton_OnClick_A>Obtain week forecast (fake data)</AButton>
   <span class="faint_text ml-1"><b>F9</b></span>
</p>
<div>
   <ACheckBox @ref=@WithTestDelayCBox
              Title=@NonBlockingPauseTooltip AccessKey="l"
              ON_Click=@CheckBox_OnClick>
      Perform test de<u><b>l</b></u>ay at Web-server (3 sec.)
   </ACheckBox>
   <br>
   <ACheckBox @ref=@SimulateErrorCBox
              Title=@StoredProcBehaviourTooltip AccessKey="s"
              ON_Click=@CheckBox_OnClick>
      <u>S</u>imulate error (with corresponding message from T-SQL stored proc.)
   </ACheckBox>
</div>
<div class="mt-1">
   <span class="faint_text line_height_1" style="margin-top: 5px">
      // Query language (for C#-back-end and T-SQL) is specified in <b><i>wwwroot/appconfig.json</i></b>:<br>
      // { "Query": { "Language": "<b>EN</b>"/"<b>RU</b>" } }
   </span>
</div>
<p id="pg_fetchdata_PageErrorMessageP">@PageErrorMessage</p>
@if (Summaries != null)
{
<table class="table">
   <thead>
      <tr>
         <th>Date</th>
         <th>Temp. (C)</th>
         <th>Temp. (F)</th>
         <th>Summary</th>
      </tr>
   </thead>
   <tbody>
      @foreach (var forecast in Summaries)
      {
      <tr>
         <td>@forecast.Date.ToShortDateString()</td>
         <td>@forecast.TemperatureC</td>
         <td>@forecast.TemperatureF</td>
         <td>@forecast.Summary</td>
      </tr>
      }
   </tbody>
</table>
}
<!--=============================================================================================-->
}catch(Exception e){ProcessRenderingError(GetType(),e);}}
