This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>clock</title> | |
<script> | |
function counting() { | |
"use strict"; | |
var today = new Date(), | |
day = today.getDay(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataBase | |
{ | |
public static List<Product> GetProducts() | |
{ | |
List<Product> products = new List<Product> | |
{ | |
new Product | |
{ | |
Id=1, | |
Name= "Nice dress", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] | |
public class RangeUntilCurrentYearAttribute : RangeAttribute | |
{ | |
public RangeUntilCurrentYearAttribute(int minimum) : base(minimum, DateTime.Now.Year) | |
{ | |
} | |
} | |
// And use it like this: | |
//public class Foo | |
// { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Microsoft.AspNetCore.Components | |
@using Microsoft.AspNetCore.Components.Forms | |
@using Microsoft.AspNetCore.Components.Routing | |
@using Microsoft.AspNetCore.Components.Web | |
@using Microsoft.JSInterop | |
@using Microsoft.Extensions.DependencyInjection | |
@using AngleSharp.Dom | |
@using Bunit | |
@using Bunit.Xunit | |
@using Bunit.TestDoubles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MudContainer Class="pa-4" style="border:1px solid grey"> | |
@foreach(var c in chips){ | |
<MudChip Text="@c" OnClose="Remove"></MudChip> | |
} | |
<MudTextField T="string" TextChanged="Add"/> | |
</MudContainer> | |
@code { | |
private List<string> chips {get;set;} = new(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MudTable Items="@(GetPlaces())" T="AreaPlace" Dense="true" @bind-SelectedItem="selectedItem1" Filter="new Func<AreaPlace,bool>(FilterFunc1)"> | |
<ToolBarContent> | |
<MudItem xs="12" md="5"> | |
<MudTextField @bind-Value="searchString1" Placeholder="@L["Search"]" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField> | |
</MudItem> | |
<MudSpacer/> | |
<MudItem xs="12" md="4"> | |
<MudSelect T="string" @bind-SelectedValues="Options" @bind-Value="@tempArea" MultiSelection="true" Label="@L["Select Areas"]"> | |
@foreach (var area in areas) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Gets the first or default entity based on a predicate, orderby delegate and include delegate. This method default no-tracking query. | |
/// </summary> | |
/// <param name="selector">The selector for projection.</param> | |
/// <param name="predicate">A function to test each element for a condition.</param> | |
/// <param name="orderBy">A function to order elements.</param> | |
/// <param name="include">A function to include navigation properties</param> | |
/// <param name="disableTracking"><c>True</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param> | |
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns> | |
/// <remarks>This method default no-tracking query.</remarks> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Generic Data Manager Class | |
/// Uses an Entity Framework Data Context to do CRUD operations | |
/// on ANY entity. | |
/// Customize to your own liking. | |
/// </summary> | |
/// <typeparam name="TEntity"></typeparam> | |
/// <typeparam name="TDataContext"></typeparam> | |
public class DataManager<TEntity, TDataContext> : IRepository<TEntity> | |
where TEntity : class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (areas==null) | |
{ | |
<p>wait</p> | |
} | |
else | |
{ | |
<MudTable Items="@locations" T="AreaPlace" Dense="true" @bind-SelectedItem="selectedItem1" Filter="new Func<AreaPlace,bool>(FilterFunc1)"> | |
<ToolBarContent> | |
<MudItem xs="12" md="5"> |
OlderNewer