|
|
@@ -17,6 +17,8 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers |
|
|
|
private DepartmentIBLL departmentIBLL = new DepartmentBLL(); |
|
|
|
private CompanyIBLL companyIBLL = new CompanyBLL(); |
|
|
|
|
|
|
|
private static DepartmentIBLL departmentIBLL_static = new DepartmentBLL(); |
|
|
|
private static Dictionary<string, DepartmentModel> mapData = departmentIBLL_static.GetModelMap(); |
|
|
|
#region 获取视图 |
|
|
|
/// <summary> |
|
|
|
/// 主页 |
|
|
@@ -150,6 +152,10 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers |
|
|
|
return Fail("部门编号已存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (keyValue == entity.F_ParentId) |
|
|
|
{ |
|
|
|
return Fail("操作失败,当前项不允许"); |
|
|
|
} |
|
|
|
//发送标识false |
|
|
|
entity.SendFlag = false; |
|
|
|
departmentIBLL.SaveEntity(keyValue, entity); |
|
|
@@ -164,8 +170,16 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers |
|
|
|
[AjaxOnly] |
|
|
|
public ActionResult DeleteForm(string keyValue) |
|
|
|
{ |
|
|
|
departmentIBLL.VirtualDelete(keyValue); |
|
|
|
return Success("删除成功!"); |
|
|
|
var list = departmentIBLL.GetAllList().Where(x => x.F_ParentId == keyValue); |
|
|
|
if (list.Count() > 0) |
|
|
|
{ |
|
|
|
return Fail("删除失败!拥有下辖项不可直接删除"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
departmentIBLL.VirtualDelete(keyValue); |
|
|
|
return Success("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |