using Attribute;
using Model;
using Service;
namespace Services
{
///
/// 岗位管理
///
[AppService(ServiceType = typeof(ISysPostService), ServiceLifetime = LifeTime.Transient)]
public class SysPostService : BaseService, ISysPostService
{
///
/// 校验岗位编码是否唯一
///
///
///
public string CheckPostCodeUnique(SysPost post)
{
SysPost info = GetFirst(it => it.postCode.Equals(post.postCode));
if (info != null && info.postId != post.postId)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
///
/// 校验岗位名称是否唯一
///
///
///
public string CheckPostNameUnique(SysPost post)
{
SysPost info = GetFirst(it => it.postName.Equals(post.postName));
if (info != null && info.postId != post.postId)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
public List GetAll()
{
return GetAll(false);
}
}
}