Wireup window with access methods + refaktor structure
This commit is contained in:
12
TrackerLibrary/DataAccess/IDataConnection.cs
Normal file
12
TrackerLibrary/DataAccess/IDataConnection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using TrackerLibrary.Models;
|
||||
|
||||
namespace TrackerLibrary.DataAccess
|
||||
{
|
||||
public interface IDataConnection
|
||||
{
|
||||
PrizeModel CreatePrize(PrizeModel model);
|
||||
}
|
||||
}
|
||||
21
TrackerLibrary/DataAccess/SqlConnector.cs
Normal file
21
TrackerLibrary/DataAccess/SqlConnector.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace TrackerLibrary.DataAccess
|
||||
{
|
||||
public class SqlConnector : IDataConnection
|
||||
{
|
||||
// TODO - Make the CreatePrize method actually save to the database
|
||||
/// <summary>
|
||||
/// Saves a prize to the database
|
||||
/// </summary>
|
||||
/// <param name="model">The prize information.</param>
|
||||
/// <returns>The prize information, including the unique identifier.</returns>
|
||||
public Models.PrizeModel CreatePrize(Models.PrizeModel model)
|
||||
{
|
||||
model.Id = 1;
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
TrackerLibrary/DataAccess/TextConnector.cs
Normal file
17
TrackerLibrary/DataAccess/TextConnector.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using TrackerLibrary.Models;
|
||||
|
||||
namespace TrackerLibrary.DataAccess
|
||||
{
|
||||
public class TextConnector : IDataConnection
|
||||
{
|
||||
// TODO - Wire up the createPrize for textFiles
|
||||
public PrizeModel CreatePrize(PrizeModel model)
|
||||
{
|
||||
model.Id = 1;
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user