Add Blazor WebApp and rework data handling to utilize Entity Framework
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Core.Entities;
|
||||
|
||||
public class EventDefinition
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
public EventFormat EventFormat { get; set; }
|
||||
|
||||
[Range(1, 6)]
|
||||
public int MinTeamSize { get; set; }
|
||||
|
||||
[Range(1, 6)]
|
||||
public int MaxTeamSize { get; set; }
|
||||
|
||||
public string TeamSize =>
|
||||
MinTeamSize == MaxTeamSize
|
||||
? MinTeamSize.ToString()
|
||||
: $"{MinTeamSize.ToString()}-{MaxTeamSize.ToString()}";
|
||||
|
||||
public string? SemifinalistActivity { get; set; }
|
||||
|
||||
public bool InterviewOrPresentation
|
||||
=> SemifinalistActivity != null && (SemifinalistActivity.Contains("Interview") || SemifinalistActivity.Contains("Presentation"));
|
||||
|
||||
public bool OnSiteActivity
|
||||
=> SemifinalistActivity != null
|
||||
&& (SemifinalistActivity.Contains("Challenge")
|
||||
|| SemifinalistActivity.Contains("Race")
|
||||
|| SemifinalistActivity.Contains("Speech")
|
||||
|| SemifinalistActivity.Contains("Test")
|
||||
|| SemifinalistActivity.Contains("Flight")
|
||||
|| Name.Contains("Flight")
|
||||
|| SemifinalistActivity.Contains("Debate")
|
||||
|| SemifinalistActivity.Contains("Photography")
|
||||
|| SemifinalistActivity.Contains("Build")
|
||||
|| Name.Contains("Chapter")
|
||||
|| Name.Contains("Podcast"));
|
||||
|
||||
public string? Notes { get; set; }
|
||||
|
||||
[Range(1, 3)]
|
||||
public int MaxTeamCountState { get; set; }
|
||||
public bool RegionalEvent { get; set; }
|
||||
|
||||
public bool RegionalPresubmit { get; set; }
|
||||
public bool StatePresubmission { get; set; }
|
||||
public bool StatePretesting { get; set; }
|
||||
public bool StatePreliminaryRound { get; set; }
|
||||
|
||||
public string? Documentation { get; set; }
|
||||
|
||||
public string Eligibility { get; set; }
|
||||
public string? Theme { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public int? LevelOfEffort { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public static readonly EventDefinition GeneralSchedule = new(){Name = "General Schedule"};
|
||||
public static readonly EventDefinition VotingDelegates = new(){Name = "Voting Delegates"};
|
||||
|
||||
|
||||
public string EventAttributes ()
|
||||
{
|
||||
var st = new List<string>();
|
||||
|
||||
if (EventFormat is EventFormat.Individual)
|
||||
st.Add( "Ind.");
|
||||
if (RegionalEvent)
|
||||
st.Add( "Reg.");
|
||||
|
||||
return string.Join(", ", st);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user