CPL.Customizer/CPL.Customizer/PersonInBaseTreeCCS.cs
Decompiler Source FileCPL.Customizer.PersonInBaseTreeCCSDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- Method registration: ComplianceCheckSimple at line 164
Typed Edges
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
C# source-derived context
Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.
reads entity values references DB/Dialog objects
Summary: classes PersonInBaseTreeCCS; methods MoveNext, SetStateMachine, ComplianceCheckSimple; references Person; markers reads entity values, references DB/Dialog objects
Classes
PersonInBaseTreeCCSDB/Dialog object references
OIM key/entity markers
UID_PersonAPI/entity calls
GetValue SqlFormatter MetaData GetValueRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections.Generic;3using System.Data;4using System.Data.Common;5using System.Diagnostics;6using System.Linq;7using System.Runtime.CompilerServices;8using System.Runtime.InteropServices;9using System.Threading;10using System.Threading.Tasks;11using VI.Base;12using VI.DB;13using VI.DB.DataAccess;14using VI.DB.Entities;15using VI.DB.MetaData;1617namespace CPL.Customizer;1819public class PersonInBaseTreeCCS : StateBasedEntityLogic20{21 [StructLayout((LayoutKind)3)]22 [CompilerGenerated]23 private struct _003CComplianceCheckSimple_003Ed__1 : IAsyncStateMachine24 {25 public int _003C_003E1__state;2627 public AsyncTaskMethodBuilder<CCSPersonInBaseTree[]> _003C_003Et__builder;2829 public ISession session;3031 public IEntity entity;3233 public CancellationToken ct;3435 private List<CCSPersonInBaseTree> _003CcolCCS_003E5__2;3637 private ISqlFormatter _003CfSql_003E5__3;3839 private IDbSession _003CdbSession_003E5__4;4041 private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;4243 private ConfiguredTaskAwaiter<DbDataReader> _003C_003Eu__2;4445 private void MoveNext()46 {47 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)48 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)49 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)50 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)51 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)52 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)53 //IL_0058: Unknown result type (might be due to invalid IL or missing references)54 //IL_0063: Unknown result type (might be due to invalid IL or missing references)55 //IL_0068: Unknown result type (might be due to invalid IL or missing references)56 //IL_006c: Unknown result type (might be due to invalid IL or missing references)57 //IL_0071: Unknown result type (might be due to invalid IL or missing references)58 //IL_0086: Unknown result type (might be due to invalid IL or missing references)59 //IL_0088: Unknown result type (might be due to invalid IL or missing references)60 //IL_017f: Unknown result type (might be due to invalid IL or missing references)61 //IL_018a: Unknown result type (might be due to invalid IL or missing references)62 //IL_018f: Unknown result type (might be due to invalid IL or missing references)63 //IL_0193: Unknown result type (might be due to invalid IL or missing references)64 //IL_0198: Unknown result type (might be due to invalid IL or missing references)65 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)66 //IL_01af: Unknown result type (might be due to invalid IL or missing references)67 int num = _003C_003E1__state;68 CCSPersonInBaseTree[] result;69 try70 {71 ConfiguredTaskAwaiter<DbDataReader> val;72 ConfiguredTaskAwaiter<IMetaTable> val2;73 if (num != 0)74 {75 if (num == 1)76 {77 val = _003C_003Eu__2;78 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<DbDataReader>);79 num = (_003C_003E1__state = -1);80 goto IL_01e4;81 }82 _003CcolCCS_003E5__2 = new List<CCSPersonInBaseTree>();83 _003CfSql_003E5__3 = session.SqlFormatter();84 _003CdbSession_003E5__4 = session.Resolve<IDbSession>();85 val2 = session.MetaData().GetTableAsync(entity.Tablename, ct).ConfigureAwait(false)86 .GetAwaiter();87 if (!val2.IsCompleted)88 {89 num = (_003C_003E1__state = 0);90 _003C_003Eu__1 = val2;91 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003CComplianceCheckSimple_003Ed__1>(ref val2, ref this);92 return;93 }94 }95 else96 {97 val2 = _003C_003Eu__1;98 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);99 num = (_003C_003E1__state = -1);100 }101 IMetaColumn metaColumn = Enumerable.FirstOrDefault<IMetaColumn>((System.Collections.Generic.IEnumerable<IMetaColumn>)val2.GetResult().PrimaryKeyColumns, (Func<IMetaColumn, bool>)((IMetaColumn mc) => !string.Equals(mc.Columnname, "UID_Person", (StringComparison)4)));102 if (metaColumn != null)103 {104 string sqlStatement = string.Format("select * from {0}", (object)_003CfSql_003E5__3.InlineFunctionCall(new SqlFunction("CPL", "GComplianceCheck", "FTCCSPersonCheckWithOrg")105 {106 TableFunction = true107 }, _003CfSql_003E5__3.FormatUidValue(entity.GetValue("UID_Person")), _003CfSql_003E5__3.FormatValue(entity.GetValue(metaColumn.Columnname), ValType.String, forUpdate: true)));108 val = _003CdbSession_003E5__4.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false).GetAwaiter();109 if (!val.IsCompleted)110 {111 num = (_003C_003E1__state = 1);112 _003C_003Eu__2 = val;113 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbDataReader>, _003CComplianceCheckSimple_003Ed__1>(ref val, ref this);114 return;115 }116 goto IL_01e4;117 }118 result = System.Array.Empty<CCSPersonInBaseTree>();119 goto end_IL_0007;120 IL_01e4:121 IDataReader result2 = (IDataReader)(object)val.GetResult();122 try123 {124 while (result2.Read())125 {126 _003CcolCCS_003E5__2.Add(new CCSPersonInBaseTree(result2));127 }128 }129 finally130 {131 if (num < 0)132 {133 ((System.IDisposable)result2)?.Dispose();134 }135 }136 result = _003CcolCCS_003E5__2.ToArray();137 end_IL_0007:;138 }139 catch (System.Exception exception)140 {141 _003C_003E1__state = -2;142 _003CcolCCS_003E5__2 = null;143 _003CfSql_003E5__3 = null;144 _003CdbSession_003E5__4 = null;145 _003C_003Et__builder.SetException(exception);146 return;147 }148 _003C_003E1__state = -2;149 _003CcolCCS_003E5__2 = null;150 _003CfSql_003E5__3 = null;151 _003CdbSession_003E5__4 = null;152 _003C_003Et__builder.SetResult(result);153 }154155 [DebuggerHidden]156 private void SetStateMachine(IAsyncStateMachine stateMachine)157 {158 _003C_003Et__builder.SetStateMachine(stateMachine);159 }160 }161162 public PersonInBaseTreeCCS()163 {164 RegisterMethod("ComplianceCheckSimple").As(ComplianceCheckSimple).Enabled().From("Config(QER\\ComplianceCheck\\SimpleMode)")165 .As<string>((Func<string, bool>)((string strConfigParm) => strConfigParm == "1"))166 .Description("Method_PersonInBaseTree_ComplianceCheckSimple")167 .Behavior(MethodBehavior.ValidForReadOnlyUser);168 }169170 [AsyncStateMachine(typeof(_003CComplianceCheckSimple_003Ed__1))]171 private async System.Threading.Tasks.Task<CCSPersonInBaseTree[]> ComplianceCheckSimple(ISession session, IEntity entity, CancellationToken ct)172 {173 //IL_0002: Unknown result type (might be due to invalid IL or missing references)174 //IL_0007: Unknown result type (might be due to invalid IL or missing references)175 //IL_001e: Unknown result type (might be due to invalid IL or missing references)176 //IL_001f: Unknown result type (might be due to invalid IL or missing references)177 List<CCSPersonInBaseTree> colCCS = new List<CCSPersonInBaseTree>();178 ISqlFormatter fSql = session.SqlFormatter();179 IDbSession dbSession = session.Resolve<IDbSession>();180 IMetaColumn metaColumn = Enumerable.FirstOrDefault<IMetaColumn>((System.Collections.Generic.IEnumerable<IMetaColumn>)(await session.MetaData().GetTableAsync(entity.Tablename, ct).ConfigureAwait(false)).PrimaryKeyColumns, (Func<IMetaColumn, bool>)((IMetaColumn mc) => !string.Equals(mc.Columnname, "UID_Person", (StringComparison)4)));181 if (metaColumn == null)182 {183 return System.Array.Empty<CCSPersonInBaseTree>();184 }185 string sqlStatement = string.Format("select * from {0}", (object)fSql.InlineFunctionCall(new SqlFunction("CPL", "GComplianceCheck", "FTCCSPersonCheckWithOrg")186 {187 TableFunction = true188 }, fSql.FormatUidValue(entity.GetValue("UID_Person")), fSql.FormatValue(entity.GetValue(metaColumn.Columnname), ValType.String, forUpdate: true)));189 IDataReader val = (IDataReader)(object)(await dbSession.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false));190 try191 {192 while (val.Read())193 {194 colCCS.Add(new CCSPersonInBaseTree(val));195 }196 }197 finally198 {199 ((System.IDisposable)val)?.Dispose();200 }201 return colCCS.ToArray();202 }203}204