BigLitho/Large.Lito.Database/Make3_Treko3D/Data/BusinessService/ProjectService.cs

176 lines
5.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Data.BusinessService
{
using System.Data;
using Data.DataAccess;
using Data.DataModel;
using Data.BusinessService;
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 null; // 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)
{
bool result = projectSQL.AddProject(project);
if (result == true)
{
DataRow row = projectSQL.GetLastProject();
project.Id = (int)row["id"];
}
return result;
}
/// <summary>
/// Service method to update club member
/// </summary>
/// <param name="project">club member</param>
/// <returns>true / false</returns>
public bool UpdateProjectDefault(ProjectModel project)
{
bool result = this.projectSQL.UpdateProjectDefault(project); //UpdateProject(project);
return result;
}
/// <summary>
/// Service method to update club member
/// </summary>
/// <param name="project">club member</param>
/// <returns>true / false</returns>
public bool UpdateProject(ProjectModel project)
{
bool result = this.projectSQL.UpdateProject(project); //UpdateProject(project);
return result;
}
/// <summary>
/// Method to update club member details
/// </summary>
/// <param name="project">club member</param>
/// <returns></returns>
public bool UpdateProjectOutPath(int projectId, string outPath)
{
bool result = this.projectSQL.UpdateProjectOutPath(projectId, outPath); //UpdateProject(project);
return result;
}
/// <summary>
/// Service method to update club member
/// </summary>
/// <param name="project">club member</param>
/// <returns>true / false</returns>
public bool UpdateProjectIniGen(ProjectModel project)
{
return false; // this.projectSQL.UpdateProjectIniGen(project); //UpdateProject(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);
}
/// <summary>
/// Method to delete a club member
/// </summary>
/// <param name="id">member id</param>
/// <returns>true / false</returns>
public bool DeleteProjectLayers(int id)
{
return this.projectSQL.DeleteProjectLayers(id);
}
/// <summary>
/// Method to delete a club member
/// </summary>
/// <param name="id">member id</param>
/// <returns>true / false</returns>
public bool DeleteProjectColorProfiles(int id)
{
return this.projectSQL.DeleteProjectColorProfiles(id);
}
/// <summary>
/// Service method to get all club members
/// </summary>
/// <returns>Data table</returns>
public int GetCountOfLayers(int projectId)
{
return this.projectSQL.GetCountOfLayers(projectId);
}
/// <summary>
/// Service method to get all club members
/// </summary>
/// <returns>Data table</returns>
public DataTable GetProjectLayers(int projectId)
{
return this.projectSQL.GetProjectLayers(projectId);
}
}
}