/*--------------------------------------------------------------------------------------------*/ private Result ExecuteSession() { long appId = vOpCtx.GetSharpflakeId <Vertex>(); long memId = vOpCtx.GetSharpflakeId <Vertex>(); var appCre = new CreateFabApp(); appCre.Name = vName; appCre.Secret = vOpCtx.Code32; appCre.CreatedByMemberId = vCreatorMemberId; var memCre = new CreateFabMember(); memCre.Type = (byte)MemberType.Id.DataProv; memCre.DefinedByAppId = appId; memCre.DefinedByUserId = vUserId; //// var appOp = new CreateAppOperation(); appOp.SetExecuteData(vOpCtx, vBuild, vTasks, appCre, appId, vDataAcc, false); var memOp = new CreateMemberOperation(); memOp.SetExecuteData(vOpCtx, vBuild, vTasks, memCre, memId, vDataAcc, false); //// vBuild.StartSession(); appOp.CheckAndAddVertex(); memOp.CheckAndAddVertex(); appOp.AddEdges(); memOp.AddEdges(); vBuild.CommitAndCloseSession(); //// IDataResult res = vDataAcc.Execute(GetType().Name); vBuild.PerformChecks(res); int appCmdI = res.GetCommandIndexByCmdId(appOp.AddVertexCommandId); int memCmdI = res.GetCommandIndexByCmdId(memOp.AddVertexCommandId); return(new Result { Status = ResultStatus.Success, NewApp = res.ToElementAt <App>(appCmdI, 0), NewMember = res.ToElementAt <Member>(memCmdI, 0) }); }
/*--------------------------------------------------------------------------------------------*/ private Result ExecuteSession() { long userId = vOpCtx.GetSharpflakeId <Vertex>(); long memId = vOpCtx.GetSharpflakeId <Vertex>(); long emailId = vOpCtx.GetSharpflakeId <Vertex>(); var userCre = new CreateFabUser(); userCre.Name = vUsername; userCre.Password = vPassword; userCre.CreatedByMemberId = memId; var memCre = new CreateFabMember(); memCre.Type = (byte)MemberType.Id.Member; memCre.DefinedByAppId = (long)SetupAppId.FabSys; memCre.DefinedByUserId = userId; var emailCre = new CreateFabEmail(); emailCre.Address = vEmail; emailCre.Code = vOpCtx.Code32; emailCre.UsedByArtifactId = userId; //// var userOp = new CreateUserOperation(); userOp.SetExecuteData(vOpCtx, vBuild, vTasks, userCre, userId, vDataAcc, false); var memOp = new CreateMemberOperation(); memOp.SetExecuteData(vOpCtx, vBuild, vTasks, memCre, memId, vDataAcc, false); var emailOp = new CreateEmailOperation(); emailOp.SetExecuteData(vOpCtx, vBuild, vTasks, emailCre, emailId, vDataAcc, false); //// vBuild.StartSession(); userOp.CheckAndAddVertex(); memOp.CheckAndAddVertex(); emailOp.CheckAndAddVertex(); userOp.AddEdges(); memOp.AddEdges(); emailOp.AddEdges(); vBuild.CommitAndCloseSession(); //// IDataResult res = vDataAcc.Execute(GetType().Name); vBuild.PerformChecks(res); int userCmdI = res.GetCommandIndexByCmdId(userOp.AddVertexCommandId); int memCmdI = res.GetCommandIndexByCmdId(memOp.AddVertexCommandId); int emailCmdI = res.GetCommandIndexByCmdId(emailOp.AddVertexCommandId); return(new Result { Status = ResultStatus.Success, NewUser = res.ToElementAt <User>(userCmdI, 0), NewMember = res.ToElementAt <Member>(memCmdI, 0), NewEmail = res.ToElementAt <Email>(emailCmdI, 0) }); }