/// <summary>
        /// 给节点分配角色
        /// </summary>
        /// <param name="relateRoleByNodeAddViewModel"></param>
        /// <returns></returns>

        public int NodeDefine_RoleToNode_Add(RelateRoleByNodeAddViewModel relateRoleByNodeAddViewModel)
        {
            //获取视图集合
            List <RelateRoleByNodeAddModelcs> relateNodeIdandRoleIdList = relateRoleByNodeAddViewModel.RelateNodeIdandRoleIdList;
            //将视图模型和转为领域模型集合
            List <Flow_Relate_NodeRole> node_Relate_Role = _IMapper.Map <List <RelateRoleByNodeAddModelcs>, List <Flow_Relate_NodeRole> >(relateNodeIdandRoleIdList);

            int AddNum = _IRelateRoleByNodeRepository
                         .RelateNodeToRoleAdd(node_Relate_Role);

            return(AddNum);
        }
Esempio n. 2
0
        public ActionResult <RelateRoleByNodeAddResModel> Manage_NodeToRole_Add(RelateRoleByNodeAddViewModel relateRoleByNodeAddViewModel)
        {
            RelateRoleByNodeAddResModel relateRoleByNodeAddResModel = new RelateRoleByNodeAddResModel();
            int UpdateRowNum = _IFlowNodeDefineService.NodeDefine_RoleToNode_Add(relateRoleByNodeAddViewModel);

            if (UpdateRowNum > 0)
            {
                relateRoleByNodeAddResModel.IsSuccess                  = true;
                relateRoleByNodeAddResModel.AddCount                   = UpdateRowNum;
                relateRoleByNodeAddResModel.baseViewModel.Message      = "节点配置角色成功";
                relateRoleByNodeAddResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("给节点配置角色成功");
                return(Ok(relateRoleByNodeAddResModel));
            }
            else
            {
                relateRoleByNodeAddResModel.IsSuccess                  = false;
                relateRoleByNodeAddResModel.AddCount                   = 0;
                relateRoleByNodeAddResModel.baseViewModel.Message      = "节点配置角色失败";
                relateRoleByNodeAddResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("给节点配置角色失败");
                return(Ok(relateRoleByNodeAddResModel));
            }
        }