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