Teams creation and prizes creation are implemented
This commit is contained in:
@ -15,6 +15,7 @@ namespace TrackerLibrary.DataAccess
|
||||
void CompleteTournament(TournamentModel model);
|
||||
List<TeamModel> GetTeam_All();
|
||||
List<PersonModel> GetPerson_All();
|
||||
List<PrizeModel> GetPrizes_All();
|
||||
List<TournamentModel> GetTournament_All();
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,6 +225,16 @@ namespace TrackerLibrary.DataAccess
|
||||
return output;
|
||||
}
|
||||
|
||||
public List<PrizeModel> GetPrizes_All()
|
||||
{
|
||||
List<PrizeModel> output;
|
||||
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
|
||||
{
|
||||
output = connection.Query<PrizeModel>("dbo.spPrizes_GetAll").ToList();
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public List<TournamentModel> GetTournament_All()
|
||||
{
|
||||
List<TournamentModel> output;
|
||||
|
||||
@ -122,6 +122,13 @@ namespace TrackerLibrary.DataAccess
|
||||
.ConvertToTournamentModels();
|
||||
}
|
||||
|
||||
public List<PrizeModel> GetPrizes_All()
|
||||
{
|
||||
List<PrizeModel> output;
|
||||
output = GlobalConfig.PrizesFile.FullFilePath().LoadFile().ConvertToPrizeModels();
|
||||
return output;
|
||||
}
|
||||
|
||||
public void UpdateMatchup(MatchupModel model)
|
||||
{
|
||||
model.UpdateMatchupToFile();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace TrackerLibrary.Models
|
||||
@ -7,13 +8,26 @@ namespace TrackerLibrary.Models
|
||||
public class PrizeModel
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// The unique identifier for the prize
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// The unique identifier for the prize
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
[Display(Name = "Place Number")]
|
||||
[Range(1, 100)]
|
||||
[Required]
|
||||
public int PlaceNumber { get; set; }
|
||||
|
||||
[Display(Name = "Place Name")]
|
||||
[StringLength(100, MinimumLength = 3)]
|
||||
[Required]
|
||||
public string PlaceName { get; set; }
|
||||
|
||||
[Display(Name = "Prize Amount")]
|
||||
[DataType(DataType.Currency)]
|
||||
public decimal PrizeAmount { get; set; }
|
||||
|
||||
[Display(Name = "Prize Percentage")]
|
||||
public double PrizePercentage { get; set; }
|
||||
|
||||
public PrizeModel()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace TrackerLibrary.Models
|
||||
@ -7,7 +8,11 @@ namespace TrackerLibrary.Models
|
||||
public class TeamModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[Display(Name = "Team Member List")]
|
||||
public List<PersonModel> TeamMembers { get; set; } = new List<PersonModel>();
|
||||
[Display(Name = "Team Name")]
|
||||
//[StringLength(100, MinimumLength = 2)]
|
||||
//[Required]
|
||||
public string TeamName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user