Every form is wired up and the system works in some meaning
This commit is contained in:
@ -282,7 +282,7 @@ namespace TrackerLibrary.DataAccess
|
||||
int currRound = 1;
|
||||
foreach (MatchupModel m in matchups)
|
||||
{
|
||||
if(m.MatchupRound > currRound)
|
||||
if (m.MatchupRound > currRound)
|
||||
{
|
||||
t.Rounds.Add(currRow);
|
||||
currRow = new List<MatchupModel>();
|
||||
@ -299,7 +299,28 @@ namespace TrackerLibrary.DataAccess
|
||||
|
||||
public void UpdateMatchup(MatchupModel model)
|
||||
{
|
||||
|
||||
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
|
||||
{
|
||||
var p = new DynamicParameters();
|
||||
if (model.Winner != null)
|
||||
{
|
||||
p.Add("@Id", model.Id);
|
||||
p.Add("@WinnerId", model.Winner.Id);
|
||||
|
||||
connection.Execute("dbo.spMatchups_Update", p, commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
foreach (MatchupEntryModel m in model.Entries)
|
||||
{
|
||||
if (m.TeamCompeting != null)
|
||||
{
|
||||
p = new DynamicParameters();
|
||||
p.Add("@Id", m.Id);
|
||||
p.Add("@TeamCompetingId", m.TeamCompeting.Id);
|
||||
p.Add("@Score", m.Score);
|
||||
connection.Execute("dbo.spMatchupEntries_Update", p, commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user