127 lines
3.6 KiB
C#
127 lines
3.6 KiB
C#
|
|
namespace Data.BusinessService
|
|
{
|
|
using System.Data;
|
|
using Data.DataAccess;
|
|
using Data.DataModel;
|
|
using Data.BusinessService;
|
|
|
|
public class LayerService : ILayerService
|
|
{
|
|
/// <summary>
|
|
/// interface of layerSQL
|
|
/// </summary>
|
|
private ILayerSQL layerSQL;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the ProjectService class
|
|
/// </summary>
|
|
public LayerService()
|
|
{
|
|
this.layerSQL = new LayerSQL();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to create new member
|
|
/// </summary>
|
|
/// <param name="layer">club member model</param>
|
|
/// <returns>true or false</returns>
|
|
public bool RegisterLayer(LayerModel layer)
|
|
{
|
|
bool result = layerSQL.AddLayer(layer);
|
|
if (result == true)
|
|
{
|
|
DataRow row = layerSQL.GetLastLayer();
|
|
layer.Id = (int)row["id"];
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by Id
|
|
/// </summary>
|
|
/// <param name="id">project id</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetLayerById(int id)
|
|
{
|
|
return this.layerSQL.GetLayerById(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by Id
|
|
/// </summary>
|
|
/// <param name="id">project id</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetLayerByName(string layerName)
|
|
{
|
|
return this.layerSQL.GetLayerByName(layerName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by Id
|
|
/// </summary>
|
|
/// <param name="id">project id</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetLayerByNameTechnology(string layerName, string technology)
|
|
{
|
|
return this.layerSQL.GetLayerByNameTechnology(layerName, technology);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to update club member details
|
|
/// </summary>
|
|
/// <param name="layer">club member</param>
|
|
/// <returns></returns>
|
|
public bool UpdateLayer(LayerModel layer)
|
|
{
|
|
bool result = layerSQL.UpdateLayer(layer);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to delete member
|
|
/// </summary>
|
|
/// <param name="layer">club member model</param>
|
|
/// <returns>true or false</returns>
|
|
public bool DeleteLayer(LayerModel layer)
|
|
{
|
|
bool result = layerSQL.DeleteLayer(layer);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service method to get project by Id
|
|
/// </summary>
|
|
/// <param name="id">project id</param>
|
|
/// <returns>Data row</returns>
|
|
public DataRow GetColorProfileByLayerId(int layerId)
|
|
{
|
|
return this.layerSQL.GetColorProfileByLayerId(layerId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to delete member
|
|
/// </summary>
|
|
/// <param name="layer">club member model</param>
|
|
/// <returns>true or false</returns>
|
|
public bool DeleteColorProfile(LayerModel layer)
|
|
{
|
|
bool result = layerSQL.DeleteColorProfile(layer);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method to get all club members
|
|
/// </summary>
|
|
/// <returns>Data table</returns>
|
|
public int GetCountOfLayers(int projectId)
|
|
{
|
|
int result = layerSQL.GetCountOfLayers(projectId);
|
|
return result;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|