Пример #1
0
    public string commandcolumn_direct_recover(string obj_id)
    {
        try
        {
            SsbDept         dep           = deptManager.GetByObjId(Convert.ToInt32(obj_id));
            IList <SsbDept> parentDepList = deptManager.GetEntityList(new SsbDept()
            {
                ObjId = dep.ParentId, DeleteFlag = 1
            });
            if (parentDepList.Count > 0)
            {
                return("恢复失败:请先恢复父级部门[" + parentDepList[0].DeptName + "]");
            }
            int objid = Convert.ToInt32(obj_id);
            deptManager.Update(new SsbDept()
            {
                DeleteFlag = 0
            }, new SsbDept()
            {
                ObjId = objid
            });

            this.AppendWebLog("部门信息恢复", "部门编码:" + objid);
            pageToolBar.DoRefresh();

            //左侧树刷新
            ReloadLeftDeptTree();
        }
        catch (Exception e)
        {
            return("恢复失败:" + e);
        }
        return("恢复成功");
    }