Пример #1
0
        public async Task <ApiResult> DeleteOrgNode(OrgTree node)
        {
            ApiResult ret = new ApiResult();

            try
            {
                OrgTree exist = await _orgRepo.GetNode(node.Id);

                if (exist == null)
                {
                    ret.code = Code.DataIsnotExist;
                    return(ret);
                }
                await _orgRepo.DeleteOrgNode(node);

                await _orgRepo.UnbindOrgNodeUsers(node);

                ret.code = Code.Success;
            }
            catch (Exception ex)
            {
                ret.code = Code.Failure;
                ret.msg  = ex.Message;
            }

            return(ret);
        }