/// <summary> /// 删除组织机构 /// </summary> /// <param name="id"></param> /// <returns>执行结果</returns> public Result Del(int id) { Result res = new Result(); OrganizationDAL orgDAL = new OrganizationDAL(); try { List <sys_org> org = orgDAL.SelectByparentid(id); foreach (var item in org) { Del(item.id); } if (orgDAL.Del(id) == 1) { res.Code = RES.OK; res.Message = "删除成功!"; return(res); } else { res.Code = RES.ERROR; res.Message = "删除失败!"; return(res); } } catch { res.Code = RES.ERROR; res.Message = "删除失败!"; return(res); } }