BigLitho/Large.Lito.Data/BusinessService/ProgressService.cs

98 lines
2.8 KiB
C#

namespace Big.Lito.Data.BusinessService
{
using System.Data;
using Big.Lito.Data.DataAccess;
using Big.Lito.Data.DataModel;
public class ProgressService : IProgressService
{
/// <summary>
/// interface of ProjectSQL
/// </summary>
private IProgressSQL progressSQL;
/// <summary>
/// Initializes a new instance of the ClubMemberService class
/// </summary>
public ProgressService()
{
this.progressSQL = new ProgressSQL();
}
/// <summary>
/// Service method to get project by Id
/// </summary>
/// <param name="id">project id</param>
/// <returns>Data row</returns>
public DataRow GetProgressById(int id)
{
return this.progressSQL.GetProgressById(id);
}
/// <summary>
/// Service method to get project by name
/// </summary>
/// <param name="name">project name</param>
/// <returns>Data row</returns>
public DataRow GetProgressByName(string name)
{
return this.progressSQL.GetProgressByName(name);
}
/// <summary>
/// Service method to get all club members
/// </summary>
/// <returns>Data table</returns>
public DataTable GetAllProgress()
{
return this.progressSQL.GetAllProgress();
}
/// <summary>
/// Service method to create new member
/// </summary>
/// <param name="project">club member model</param>
/// <returns>true or false</returns>
public bool RegisterProgress(ProgressModel progress)
{
return this.progressSQL.AddProgress(progress);
}
/// <summary>
/// Service method to update club member
/// </summary>
/// <param name="progress">club member</param>
/// <returns>true / false</returns>
public bool UpdateProgress(ProgressModel progress)
{
return this.progressSQL.UpdateProgress(progress); //UpdateProject(project);
}
/// <summary>
/// Service method to create new member
/// </summary>
/// <param name="project">club member model</param>
/// <returns>true or false</returns>
public bool ResetProgress(ProgressModel progress)
{
progress.MinValue = 0;
progress.MaxValue = 100;
progress.CurValue = 0;
return this.progressSQL.UpdateProgress(progress);
}
/// <summary>
/// Method to delete a club member
/// </summary>
/// <param name="id">member id</param>
/// <returns>true / false</returns>
public bool DeleteProgress(int id)
{
return this.progressSQL.DeleteProgress(id);
}
}
}