104 lines
2.9 KiB
C#
104 lines
2.9 KiB
C#
|
|
|
|
namespace Big.Lito.Data.BusinessService
|
|
{
|
|
using System.Data;
|
|
using Big.Lito.Data.DataAccess;
|
|
using Big.Lito.Data.DataModel;
|
|
|
|
public class ProjectService : IProjectService
|
|
{
|
|
/// <summary>
|
|
/// interface of ProjectSQL
|
|
/// </summary>
|
|
private IProjectSQL projectSQL;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the ProjectService class
|
|
/// </summary>
|
|
public ProjectService()
|
|
{
|
|
this.projectSQL = new ProjectSQL();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by Id
|
|
/// </summary>
|
|
/// <param name="id">project id</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetProjectById(int id)
|
|
{
|
|
return this.projectSQL.GetProjectById(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by name
|
|
/// </summary>
|
|
/// <param name="name">project name</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetProjectByName(string name)
|
|
{
|
|
return this.projectSQL.GetProjectByName(name);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get all club members
|
|
/// </summary>
|
|
/// <returns>Data table</returns>
|
|
public DataTable GetAllProjects()
|
|
{
|
|
return this.projectSQL.GetAllProjects();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get all club members
|
|
/// </summary>
|
|
/// <returns>Data table</returns>
|
|
public DataTable GetAllProjectsForGridView()
|
|
{
|
|
return this.projectSQL.GetAllProjectsForGridView();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to create new member
|
|
/// </summary>
|
|
/// <param name="project">club member model</param>
|
|
/// <returns>true or false</returns>
|
|
public bool RegisterProject(ProjectModel project)
|
|
{
|
|
return this.projectSQL.AddProject(project);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to update club member
|
|
/// </summary>
|
|
/// <param name="project">club member</param>
|
|
/// <returns>true / false</returns>
|
|
public bool UpdateProject(ProjectModel project)
|
|
{
|
|
return this.projectSQL.UpdateProject(project);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to update club member
|
|
/// </summary>
|
|
/// <param name="project">club member</param>
|
|
/// <returns>true / false</returns>
|
|
public bool UpdateProjectIniGen(ProjectModel project)
|
|
{
|
|
return this.projectSQL.UpdateProjectIniGen(project);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to delete a club member
|
|
/// </summary>
|
|
/// <param name="id">member id</param>
|
|
/// <returns>true / false</returns>
|
|
public bool DeleteProject(int id)
|
|
{
|
|
return this.projectSQL.DeleteProject(id);
|
|
}
|
|
|
|
}
|
|
}
|