using LeaRun.Application.Entity.BaseManage;
using LeaRun.Application.IService.BaseManage;
using LeaRun.Application.Service.BaseManage;
using LeaRun.Cache.Factory;
using LeaRun.Util.WebControl;
using System;
using System.Collections.Generic;
namespace LeaRun.Application.Busines.BaseManage
{
///
/// 版 本
/// Copyright (c) 2013-2016 上海力软信息技术有限公司
/// 创建人:佘赐雄
/// 日 期:2015.11.4 14:31
/// 描 述:职位管理
///
public class JobBLL
{
private IJobService service = new JobService();
///
/// 缓存key
///
public string cacheKey = "JobCache";
#region 获取数据
///
/// 职位列表
///
///
public IEnumerable GetList()
{
return service.GetList();
}
///
/// 职位列表
///
/// 分页
/// 查询参数
///
public IEnumerable GetPageList(Pagination pagination, string queryJson)
{
return service.GetPageList(pagination, queryJson);
}
///
/// 职位实体
///
/// 主键值
///
public RoleEntity GetEntity(string keyValue)
{
return service.GetEntity(keyValue);
}
#endregion
#region 验证数据
///
/// 职位编号不能重复
///
/// 编号
/// 主键
///
public bool ExistEnCode(string enCode, string keyValue)
{
return service.ExistEnCode(enCode, keyValue);
}
///
/// 职位名称不能重复
///
/// 名称
/// 主键
///
public bool ExistFullName(string fullName, string keyValue)
{
return service.ExistFullName(fullName, keyValue);
}
#endregion
#region 提交数据
///
/// 删除职位
///
/// 主键
public void RemoveForm(string keyValue)
{
try
{
service.RemoveForm(keyValue);
CacheFactory.Cache().RemoveCache(cacheKey);
}
catch (Exception)
{
throw;
}
}
///
/// 保存职位表单(新增、修改)
///
/// 主键值
/// 职位实体
///
public void SaveForm(string keyValue, RoleEntity jobEntity)
{
try
{
service.SaveForm(keyValue, jobEntity);
CacheFactory.Cache().RemoveCache(cacheKey);
}
catch (Exception)
{
throw;
}
}
#endregion
}
}