CPL.Customizer/CPL.Customizer/OrgBaseEntityLogic.cs
Decompiler Source FileCPL.Customizer.OrgBaseEntityLogicDecompiled 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 153
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
Summary: classes OrgBaseEntityLogic; methods MoveNext, SetStateMachine, ComplianceCheckSimple; markers reads entity values
Classes
OrgBaseEntityLogicDB/Dialog object references
None extracted.
OIM key/entity markers
UID_OrgAPI/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.Runtime.CompilerServices;7using System.Runtime.InteropServices;8using System.Threading;9using System.Threading.Tasks;10using VI.DB;11using VI.DB.DataAccess;12using VI.DB.Entities;13using VI.DB.MetaData;1415namespace CPL.Customizer;1617public class OrgBaseEntityLogic : StateBasedEntityLogic18{19 [StructLayout((LayoutKind)3)]20 [CompilerGenerated]21 private struct _003CComplianceCheckSimple_003Ed__1 : IAsyncStateMachine22 {23 public int _003C_003E1__state;2425 public AsyncTaskMethodBuilder<CCSBaseTree[]> _003C_003Et__builder;2627 public ISession session;2829 public IEntity entity;3031 public CancellationToken ct;3233 private List<CCSBaseTree> _003CcolCCS_003E5__2;3435 private ISqlFormatter _003CfSql_003E5__3;3637 private IDbSession _003CdbSession_003E5__4;3839 private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;4041 private ConfiguredTaskAwaiter<DbDataReader> _003C_003Eu__2;4243 private void MoveNext()44 {45 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)46 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)47 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)48 //IL_010a: Unknown result type (might be due to invalid IL or missing references)49 //IL_0115: Unknown result type (might be due to invalid IL or missing references)50 //IL_011a: Unknown result type (might be due to invalid IL or missing references)51 //IL_011e: Unknown result type (might be due to invalid IL or missing references)52 //IL_0123: Unknown result type (might be due to invalid IL or missing references)53 //IL_0153: Unknown result type (might be due to invalid IL or missing references)54 //IL_0158: Unknown result type (might be due to invalid IL or missing references)55 //IL_0160: Unknown result type (might be due to invalid IL or missing references)56 //IL_0058: Unknown result type (might be due to invalid IL or missing references)57 //IL_0063: Unknown result type (might be due to invalid IL or missing references)58 //IL_0068: Unknown result type (might be due to invalid IL or missing references)59 //IL_006c: Unknown result type (might be due to invalid IL or missing references)60 //IL_0071: Unknown result type (might be due to invalid IL or missing references)61 //IL_0138: Unknown result type (might be due to invalid IL or missing references)62 //IL_013a: Unknown result type (might be due to invalid IL or missing references)63 //IL_0086: Unknown result type (might be due to invalid IL or missing references)64 //IL_0088: Unknown result type (might be due to invalid IL or missing references)65 int num = _003C_003E1__state;66 CCSBaseTree[] result2;67 try68 {69 ConfiguredTaskAwaiter<DbDataReader> val;70 ConfiguredTaskAwaiter<IMetaTable> val2;71 if (num != 0)72 {73 if (num == 1)74 {75 val = _003C_003Eu__2;76 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<DbDataReader>);77 num = (_003C_003E1__state = -1);78 goto IL_016f;79 }80 _003CcolCCS_003E5__2 = new List<CCSBaseTree>();81 _003CfSql_003E5__3 = session.SqlFormatter();82 _003CdbSession_003E5__4 = session.Resolve<IDbSession>();83 val2 = session.MetaData().GetTableAsync(entity.Tablename, ct).ConfigureAwait(false)84 .GetAwaiter();85 if (!val2.IsCompleted)86 {87 num = (_003C_003E1__state = 0);88 _003C_003Eu__1 = val2;89 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003CComplianceCheckSimple_003Ed__1>(ref val2, ref this);90 return;91 }92 }93 else94 {95 val2 = _003C_003Eu__1;96 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);97 num = (_003C_003E1__state = -1);98 }99 string columnname = val2.GetResult().PrimaryKeyColumns[0].Columnname;100 string sqlStatement = string.Format("select * from CPL_VCCSOrgCheckDetail where {0}", (object)_003CfSql_003E5__3.UidComparison("UID_Org", entity.GetValue(columnname).String));101 val = _003CdbSession_003E5__4.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false).GetAwaiter();102 if (!val.IsCompleted)103 {104 num = (_003C_003E1__state = 1);105 _003C_003Eu__2 = val;106 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbDataReader>, _003CComplianceCheckSimple_003Ed__1>(ref val, ref this);107 return;108 }109 goto IL_016f;110 IL_016f:111 IDataReader result = (IDataReader)(object)val.GetResult();112 try113 {114 while (result.Read())115 {116 _003CcolCCS_003E5__2.Add(new CCSBaseTree(result));117 }118 }119 finally120 {121 if (num < 0)122 {123 ((System.IDisposable)result)?.Dispose();124 }125 }126 result2 = _003CcolCCS_003E5__2.ToArray();127 }128 catch (System.Exception exception)129 {130 _003C_003E1__state = -2;131 _003CcolCCS_003E5__2 = null;132 _003CfSql_003E5__3 = null;133 _003CdbSession_003E5__4 = null;134 _003C_003Et__builder.SetException(exception);135 return;136 }137 _003C_003E1__state = -2;138 _003CcolCCS_003E5__2 = null;139 _003CfSql_003E5__3 = null;140 _003CdbSession_003E5__4 = null;141 _003C_003Et__builder.SetResult(result2);142 }143144 [DebuggerHidden]145 private void SetStateMachine(IAsyncStateMachine stateMachine)146 {147 _003C_003Et__builder.SetStateMachine(stateMachine);148 }149 }150151 public OrgBaseEntityLogic()152 {153 RegisterMethod("ComplianceCheckSimple").As(ComplianceCheckSimple).Enabled().From("[IsLoaded]", "Config(QER\\ComplianceCheck\\SimpleMode)")154 .As<bool, string>((Func<bool, string, bool>)((bool bLoaded, string strConfigParm) => bLoaded && strConfigParm == "1"))155 .Description("Method_OrgBase_ComplianceCheckSimple")156 .Behavior(MethodBehavior.ValidForReadOnlyUser);157 }158159 [AsyncStateMachine(typeof(_003CComplianceCheckSimple_003Ed__1))]160 private async System.Threading.Tasks.Task<CCSBaseTree[]> ComplianceCheckSimple(ISession session, IEntity entity, CancellationToken ct)161 {162 //IL_0002: Unknown result type (might be due to invalid IL or missing references)163 //IL_0007: Unknown result type (might be due to invalid IL or missing references)164 //IL_001e: Unknown result type (might be due to invalid IL or missing references)165 //IL_001f: Unknown result type (might be due to invalid IL or missing references)166 List<CCSBaseTree> colCCS = new List<CCSBaseTree>();167 ISqlFormatter fSql = session.SqlFormatter();168 IDbSession dbSession = session.Resolve<IDbSession>();169 string columnname = (await session.MetaData().GetTableAsync(entity.Tablename, ct).ConfigureAwait(false)).PrimaryKeyColumns[0].Columnname;170 string sqlStatement = string.Format("select * from CPL_VCCSOrgCheckDetail where {0}", (object)fSql.UidComparison("UID_Org", entity.GetValue(columnname).String));171 IDataReader val = (IDataReader)(object)(await dbSession.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false));172 try173 {174 while (val.Read())175 {176 colCCS.Add(new CCSBaseTree(val));177 }178 }179 finally180 {181 ((System.IDisposable)val)?.Dispose();182 }183 return colCCS.ToArray();184 }185}186