123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using Attribute;
- using Model;
- using Service;
- namespace Services
- {
- /// <summary>
- /// 岗位管理
- /// </summary>
- [AppService(ServiceType = typeof(ISysPostService), ServiceLifetime = LifeTime.Transient)]
- public class SysPostService : BaseService<SysPost>, ISysPostService
- {
- /// <summary>
- /// 校验岗位编码是否唯一
- /// </summary>
- /// <param name="post"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 校验岗位名称是否唯一
- /// </summary>
- /// <param name="post"></param>
- /// <returns></returns>
- 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<SysPost> GetAll()
- {
- return GetAll(false);
- }
- }
- }
|