You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.4 KiB
93 lines
2.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace FangYar.BLL.TBL
|
|
{
|
|
public class SysDeptBLL
|
|
{
|
|
private static readonly FangYar.IDAL.TBL.SysDeptIDAL dal = FangYar.DALFactory.Factory.GetSysDeptDAL();
|
|
/// <summary>
|
|
/// 根据ID获取model
|
|
/// </summary>
|
|
public FangYar.Model.TBL.TBL_SYS_DEPT_Model GetModelByID(string ID)
|
|
{
|
|
return dal.GetModelByID(ID);
|
|
}
|
|
/// <summary>
|
|
/// 添加菜单
|
|
/// </summary>
|
|
public bool Add(FangYar.Model.TBL.TBL_SYS_DEPT_Model model)
|
|
{
|
|
return dal.Add(model);
|
|
}
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
public bool Delete(string IDList)
|
|
{
|
|
return dal.Delete(IDList);
|
|
}
|
|
/// <summary>
|
|
/// 编辑
|
|
/// </summary>
|
|
public bool Edit(FangYar.Model.TBL.TBL_SYS_DEPT_Model model)
|
|
{
|
|
|
|
return dal.Edit(model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页获取数据列表
|
|
/// </summary>
|
|
public int GetRecordCount(string strWhere)
|
|
{
|
|
return dal.GetRecordCount(strWhere);
|
|
}
|
|
|
|
public List<FangYar.Model.TBL.TBL_SYS_DEPT_Model> QueryList(int PageIndex, int PageSize, string strwhere, string order)
|
|
{
|
|
return dal.QueryList(PageIndex, PageSize, strwhere, order);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加部门
|
|
/// </summary>
|
|
public bool AddDept(FangYar.Model.TBL.TBL_SYS_DEPT_Model model)
|
|
{
|
|
return dal.AddDept(model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改部门信息
|
|
/// </summary>
|
|
public bool EditDept(FangYar.Model.TBL.TBL_SYS_DEPT_Model model)
|
|
{
|
|
return dal.EditDept(model);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除部门
|
|
/// </summary>
|
|
public int DelDept(string DeptList)
|
|
{
|
|
int deptCount = dal.GetEmpCount("DEPT_ID in(" + DeptList + ")");
|
|
if (0 == deptCount)
|
|
{
|
|
if (dal.DelDept(DeptList))
|
|
{
|
|
return 0;
|
|
}
|
|
else
|
|
{
|
|
return 2;
|
|
}
|
|
} if (0 < deptCount)
|
|
{
|
|
return 1;
|
|
}
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
|