Back to OIM Explorer

QER.Customizer/QER.Customizer/Delegation.cs

Decompiler Source FileQER.Customizer.DelegationDecompiled Source

4 extracted method/event/call references in Delegation.

Source: F:\Claude\.tmp\oim-decompiled-full\0991_One_Identity_Manager_QER.Customizer.dll\QER.Customizer\Delegation.cs

Source size: 35.260 characters

Interpretation

  • Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.

Relations

  • ExtendedMethod registration: Abort at line 725
  • CallMethodAsync: Abort at line 128
  • CallFunctionAsync: GetPwOState at line 615
  • CallMethodAsync: Abort at line 645

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 IT Shop related markers

Summary: classes Delegation; methods MoveNext, SetStateMachine, OnSavingAsync, GetParentInformed, _CheckDelegation, _CheckPwO; references DelegableItem, Delegation, Person, PersonWantsOrg, PWOState; markers reads entity values, references DB/Dialog objects, IT Shop related markers

Classes

Delegation

OIM key/entity markers

UID_PersonWantsOrg ObjectKeyDelegated ObjectKeyAssignment UID_PersonSender ObjectKeyToDelegate UID_Person

API/entity calls

GetValue TryResult GetObjectKey Source SqlFormatter From IsDeleted

Registrations / handlers

None extracted.

Complete Source

C#816 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using VI.Base;10using VI.DB;11using VI.DB.Entities;12using VI.DB.MetaData;1314namespace QER.Customizer;1516public class Delegation : StateBasedEntityLogic17{18	[StructLayout((LayoutKind)3)]19	[CompilerGenerated]20	private struct _003CAbort_OnSaving_003Ed__6 : IAsyncStateMachine21	{22		public int _003C_003E1__state;2324		public AsyncTaskMethodBuilder _003C_003Et__builder;2526		public IEntity entity;2728		public LogicReadWriteParameters parameter;2930		public CancellationToken ct;3132		public Delegation _003C_003E4__this;3334		public string strReasonText;3536		private LogicParameter _003Clp_003E5__2;3738		private IEntity _003CePwO_003E5__3;3940		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__1;4142		private System.IDisposable _003C_003E7__wrap3;4344		private ConfiguredValueTaskAwaiter _003C_003Eu__2;4546		private ConfiguredTaskAwaiter _003C_003Eu__3;4748		private void MoveNext()49		{50			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)51			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)52			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)53			//IL_002b: Unknown result type (might be due to invalid IL or missing references)54			//IL_0080: Unknown result type (might be due to invalid IL or missing references)55			//IL_008b: Unknown result type (might be due to invalid IL or missing references)56			//IL_0090: Unknown result type (might be due to invalid IL or missing references)57			//IL_0094: Unknown result type (might be due to invalid IL or missing references)58			//IL_0099: Unknown result type (might be due to invalid IL or missing references)59			//IL_016d: Unknown result type (might be due to invalid IL or missing references)60			//IL_0172: Unknown result type (might be due to invalid IL or missing references)61			//IL_017a: Unknown result type (might be due to invalid IL or missing references)62			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)63			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)64			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)65			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)66			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)67			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)68			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)69			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)70			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)71			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)72			//IL_0120: Unknown result type (might be due to invalid IL or missing references)73			//IL_012f: Unknown result type (might be due to invalid IL or missing references)74			//IL_0134: Unknown result type (might be due to invalid IL or missing references)75			//IL_0138: Unknown result type (might be due to invalid IL or missing references)76			//IL_013d: Unknown result type (might be due to invalid IL or missing references)77			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)78			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)79			//IL_0152: Unknown result type (might be due to invalid IL or missing references)80			//IL_0154: Unknown result type (might be due to invalid IL or missing references)81			int num = _003C_003E1__state;82			Delegation delegation = _003C_003E4__this;83			try84			{85				ConfiguredTaskAwaiter<IEntity> val;86				if (num == 0)87				{88					val = _003C_003Eu__1;89					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntity>);90					num = (_003C_003E1__state = -1);91					goto IL_00e5;92				}93				if ((uint)(num - 1) <= 1u)94				{95					goto IL_0103;96				}97				_003Clp_003E5__2 = new LogicParameter(entity, parameter, ct);98				string value = _003Clp_003E5__2.Entity.GetValue<string>("UID_PersonWantsOrg");99				if (!string.IsNullOrEmpty(value))100				{101					DbObjectKey objectKey = DbObjectKey.GetObjectKey("PersonWantsOrg", value);102					val = _003Clp_003E5__2.Session.Source().GetAsync(objectKey, _003Clp_003E5__2.CancellationToken).ConfigureAwait(false)103						.GetAwaiter();104					if (!val.IsCompleted)105					{106						num = (_003C_003E1__state = 0);107						_003C_003Eu__1 = val;108						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CAbort_OnSaving_003Ed__6>(ref val, ref this);109						return;110					}111					goto IL_00e5;112				}113				goto end_IL_000e;114				IL_0103:115				try116				{117					ConfiguredTaskAwaiter val2;118					ConfiguredValueTaskAwaiter val4;119					if (num != 1)120					{121						if (num == 2)122						{123							val2 = _003C_003Eu__3;124							_003C_003Eu__3 = default(ConfiguredTaskAwaiter);125							num = (_003C_003E1__state = -1);126							goto IL_020c;127						}128						ConfiguredValueTaskAwaitable val3 = _003CePwO_003E5__3.CallMethodAsync("Abort", strReasonText, ct).ConfigureAwait(false);129						val4 = ((ConfiguredValueTaskAwaitable)(ref val3)).GetAwaiter();130						if (!((ConfiguredValueTaskAwaiter)(ref val4)).IsCompleted)131						{132							num = (_003C_003E1__state = 1);133							_003C_003Eu__2 = val4;134							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter, _003CAbort_OnSaving_003Ed__6>(ref val4, ref this);135							return;136						}137					}138					else139					{140						val4 = _003C_003Eu__2;141						_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter);142						num = (_003C_003E1__state = -1);143					}144					((ConfiguredValueTaskAwaiter)(ref val4)).GetResult();145					ConfiguredTaskAwaitable val5 = _003Clp_003E5__2.UnitOfWork.PutAsync(_003CePwO_003E5__3, _003Clp_003E5__2.CancellationToken).ConfigureAwait(false);146					val2 = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();147					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)148					{149						num = (_003C_003E1__state = 2);150						_003C_003Eu__3 = val2;151						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CAbort_OnSaving_003Ed__6>(ref val2, ref this);152						return;153					}154					goto IL_020c;155					IL_020c:156					((ConfiguredTaskAwaiter)(ref val2)).GetResult();157				}158				finally159				{160					if (num < 0 && _003C_003E7__wrap3 != null)161					{162						_003C_003E7__wrap3.Dispose();163					}164				}165				_003C_003E7__wrap3 = null;166				goto end_IL_000e;167				IL_00e5:168				IEntity result = val.GetResult();169				_003CePwO_003E5__3 = result;170				_003C_003E7__wrap3 = delegation.StartInternalProcess();171				goto IL_0103;172				end_IL_000e:;173			}174			catch (System.Exception exception)175			{176				_003C_003E1__state = -2;177				_003Clp_003E5__2 = null;178				_003CePwO_003E5__3 = null;179				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);180				return;181			}182			_003C_003E1__state = -2;183			_003Clp_003E5__2 = null;184			_003CePwO_003E5__3 = null;185			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();186		}187188		[DebuggerHidden]189		private void SetStateMachine(IAsyncStateMachine stateMachine)190		{191			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);192		}193	}194195	[StructLayout((LayoutKind)3)]196	[CompilerGenerated]197	private struct _003CGetParentInformed_003Ed__2 : IAsyncStateMachine198	{199		public int _003C_003E1__state;200201		public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;202203		public IEntity entity;204205		public ISession session;206207		public CancellationToken ct;208209		private ConfiguredTaskAwaiter<TryResult<bool>> _003C_003Eu__1;210211		private void MoveNext()212		{213			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)214			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)215			//IL_00df: Unknown result type (might be due to invalid IL or missing references)216			//IL_008c: Unknown result type (might be due to invalid IL or missing references)217			//IL_0097: Unknown result type (might be due to invalid IL or missing references)218			//IL_009c: Unknown result type (might be due to invalid IL or missing references)219			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)220			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)221			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)222			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)223			int num = _003C_003E1__state;224			bool result;225			try226			{227				ConfiguredTaskAwaiter<TryResult<bool>> val;228				if (num == 0)229				{230					val = _003C_003Eu__1;231					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<bool>>);232					num = (_003C_003E1__state = -1);233					goto IL_00ee;234				}235				string value = entity.Columns["ObjectKeyDelegated"].GetValue<string>();236				if (!string.IsNullOrEmpty(value))237				{238					ISqlFormatter formatter = session.SqlFormatter();239					Query query = Query.From("Delegation").Where(string.Format("UID_PersonWantsOrg in ( select UID_PersonWantsOrg from PersonWantsOrg where OrderState in ( select OrderState from QER_VPWOOrderState where IsClosed = 0 )  and {0} ) ", (object)formatter.UidComparison("ObjectKeyAssignment", value))).Select("KeepMeInformed");240					val = session.Source().TryGetSingleValueAsync<bool>(query, ct).ConfigureAwait(false)241						.GetAwaiter();242					if (!val.IsCompleted)243					{244						num = (_003C_003E1__state = 0);245						_003C_003Eu__1 = val;246						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<bool>>, _003CGetParentInformed_003Ed__2>(ref val, ref this);247						return;248					}249					goto IL_00ee;250				}251				result = false;252				goto end_IL_0007;253				IL_00ee:254				TryResult<bool> result2 = val.GetResult();255				result = result2.Success && result2.Result;256				end_IL_0007:;257			}258			catch (System.Exception exception)259			{260				_003C_003E1__state = -2;261				_003C_003Et__builder.SetException(exception);262				return;263			}264			_003C_003E1__state = -2;265			_003C_003Et__builder.SetResult(result);266		}267268		[DebuggerHidden]269		private void SetStateMachine(IAsyncStateMachine stateMachine)270		{271			_003C_003Et__builder.SetStateMachine(stateMachine);272		}273	}274275	[StructLayout((LayoutKind)3)]276	[CompilerGenerated]277	private struct _003COnSavingAsync_003Ed__1 : IAsyncStateMachine278	{279		public int _003C_003E1__state;280281		public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;282283		public IEntity entity;284285		public LogicReadWriteParameters parameters;286287		public CancellationToken cancellationToken;288289		public Delegation _003C_003E4__this;290291		private LogicParameter _003Clp_003E5__2;292293		private ConfiguredTaskAwaiter _003C_003Eu__1;294295		private ConfiguredTaskAwaiter<Diff> _003C_003Eu__2;296297		private void MoveNext()298		{299			//IL_0092: Unknown result type (might be due to invalid IL or missing references)300			//IL_0097: Unknown result type (might be due to invalid IL or missing references)301			//IL_009e: Unknown result type (might be due to invalid IL or missing references)302			//IL_010a: Unknown result type (might be due to invalid IL or missing references)303			//IL_010f: Unknown result type (might be due to invalid IL or missing references)304			//IL_0116: Unknown result type (might be due to invalid IL or missing references)305			//IL_0180: Unknown result type (might be due to invalid IL or missing references)306			//IL_0185: Unknown result type (might be due to invalid IL or missing references)307			//IL_018d: Unknown result type (might be due to invalid IL or missing references)308			//IL_002e: Unknown result type (might be due to invalid IL or missing references)309			//IL_0056: Unknown result type (might be due to invalid IL or missing references)310			//IL_005b: Unknown result type (might be due to invalid IL or missing references)311			//IL_005f: Unknown result type (might be due to invalid IL or missing references)312			//IL_0064: Unknown result type (might be due to invalid IL or missing references)313			//IL_013a: Unknown result type (might be due to invalid IL or missing references)314			//IL_0145: Unknown result type (might be due to invalid IL or missing references)315			//IL_014a: Unknown result type (might be due to invalid IL or missing references)316			//IL_014e: Unknown result type (might be due to invalid IL or missing references)317			//IL_0153: Unknown result type (might be due to invalid IL or missing references)318			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)319			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)320			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)321			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)322			//IL_0078: Unknown result type (might be due to invalid IL or missing references)323			//IL_0079: Unknown result type (might be due to invalid IL or missing references)324			//IL_0168: Unknown result type (might be due to invalid IL or missing references)325			//IL_016a: Unknown result type (might be due to invalid IL or missing references)326			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)327			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)328			int num = _003C_003E1__state;329			Delegation delegation = _003C_003E4__this;330			Diff result;331			try332			{333				ConfiguredTaskAwaitable val3;334				ConfiguredTaskAwaiter val2;335				ConfiguredTaskAwaiter<Diff> val;336				switch (num)337				{338				default:339					_003Clp_003E5__2 = new LogicParameter(entity, parameters, cancellationToken);340					if (!entity.IsLoaded)341					{342						val3 = _CheckDelegation(_003Clp_003E5__2).ConfigureAwait(false);343						val2 = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();344						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)345						{346							num = (_003C_003E1__state = 0);347							_003C_003Eu__1 = val2;348							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__1>(ref val2, ref this);349							return;350						}351						goto IL_00ad;352					}353					goto IL_00b4;354				case 0:355					val2 = _003C_003Eu__1;356					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);357					num = (_003C_003E1__state = -1);358					goto IL_00ad;359				case 1:360					val2 = _003C_003Eu__1;361					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);362					num = (_003C_003E1__state = -1);363					goto IL_0125;364				case 2:365					{366						val = _003C_003Eu__2;367						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<Diff>);368						num = (_003C_003E1__state = -1);369						break;370					}371					IL_0125:372					((ConfiguredTaskAwaiter)(ref val2)).GetResult();373					goto IL_012c;374					IL_012c:375					val = ((StateBasedEntityLogic)delegation).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();376					if (!val.IsCompleted)377					{378						num = (_003C_003E1__state = 2);379						_003C_003Eu__2 = val;380						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__1>(ref val, ref this);381						return;382					}383					break;384					IL_00ad:385					((ConfiguredTaskAwaiter)(ref val2)).GetResult();386					goto IL_00b4;387					IL_00b4:388					if (entity.IsDeleted())389					{390						val3 = delegation._CheckPwO(_003Clp_003E5__2).ConfigureAwait(false);391						val2 = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();392						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)393						{394							num = (_003C_003E1__state = 1);395							_003C_003Eu__1 = val2;396							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__1>(ref val2, ref this);397							return;398						}399						goto IL_0125;400					}401					goto IL_012c;402				}403				result = val.GetResult();404			}405			catch (System.Exception exception)406			{407				_003C_003E1__state = -2;408				_003Clp_003E5__2 = null;409				_003C_003Et__builder.SetException(exception);410				return;411			}412			_003C_003E1__state = -2;413			_003Clp_003E5__2 = null;414			_003C_003Et__builder.SetResult(result);415		}416417		[DebuggerHidden]418		private void SetStateMachine(IAsyncStateMachine stateMachine)419		{420			_003C_003Et__builder.SetStateMachine(stateMachine);421		}422	}423424	[StructLayout((LayoutKind)3)]425	[CompilerGenerated]426	private struct _003C_CheckDelegation_003Ed__3 : IAsyncStateMachine427	{428		public int _003C_003E1__state;429430		public AsyncTaskMethodBuilder _003C_003Et__builder;431432		public LogicParameter lp;433434		private ConfiguredTaskAwaiter<int> _003C_003Eu__1;435436		private void MoveNext()437		{438			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)439			//IL_0104: Unknown result type (might be due to invalid IL or missing references)440			//IL_010c: Unknown result type (might be due to invalid IL or missing references)441			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)442			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)443			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)444			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)445			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)446			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)447			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)448			int num = _003C_003E1__state;449			try450			{451				ConfiguredTaskAwaiter<int> val;452				if (num == 0)453				{454					val = _003C_003Eu__1;455					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<int>);456					num = (_003C_003E1__state = -1);457					goto IL_011b;458				}459				string value = lp.Entity.GetValue<string>("UID_PersonSender");460				if (!string.IsNullOrEmpty(value))461				{462					string value2 = lp.Entity.GetValue<string>("ObjectKeyDelegated");463					if (!string.IsNullOrEmpty(value2))464					{465						ISqlFormatter sqlFormatter = lp.SqlFormatter;466						Query query = Query.From("DelegableItem").Where(sqlFormatter.AndRelation(sqlFormatter.Comparison("ObjectKeyToDelegate", value2, ValType.String), sqlFormatter.UidComparison("UID_Person", value))).SelectNone();467						val = lp.Session.Source().GetCountAsync(query, lp.CancellationToken).ConfigureAwait(false)468							.GetAwaiter();469						if (!val.IsCompleted)470						{471							num = (_003C_003E1__state = 0);472							_003C_003Eu__1 = val;473							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<int>, _003C_CheckDelegation_003Ed__3>(ref val, ref this);474							return;475						}476						goto IL_011b;477					}478				}479				goto end_IL_0007;480				IL_011b:481				if (val.GetResult() == 0)482				{483					throw new ViException(2133322, ExceptionRelevance.EndUser);484				}485				end_IL_0007:;486			}487			catch (System.Exception exception)488			{489				_003C_003E1__state = -2;490				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);491				return;492			}493			_003C_003E1__state = -2;494			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();495		}496497		[DebuggerHidden]498		private void SetStateMachine(IAsyncStateMachine stateMachine)499		{500			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);501		}502	}503504	[StructLayout((LayoutKind)3)]505	[CompilerGenerated]506	private struct _003C_CheckPwO_003Ed__4 : IAsyncStateMachine507	{508		public int _003C_003E1__state;509510		public AsyncTaskMethodBuilder _003C_003Et__builder;511512		public LogicParameter lp;513514		public Delegation _003C_003E4__this;515516		private IEntity _003CePwO_003E5__2;517518		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__1;519520		private ConfiguredValueTaskAwaiter<object> _003C_003Eu__2;521522		private System.IDisposable _003C_003E7__wrap2;523524		private ConfiguredValueTaskAwaiter _003C_003Eu__3;525526		private ConfiguredTaskAwaiter _003C_003Eu__4;527528		private void MoveNext()529		{530			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)531			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)532			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)533			//IL_013f: Unknown result type (might be due to invalid IL or missing references)534			//IL_0144: Unknown result type (might be due to invalid IL or missing references)535			//IL_014c: Unknown result type (might be due to invalid IL or missing references)536			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)537			//IL_0101: Unknown result type (might be due to invalid IL or missing references)538			//IL_0106: Unknown result type (might be due to invalid IL or missing references)539			//IL_010a: Unknown result type (might be due to invalid IL or missing references)540			//IL_010f: Unknown result type (might be due to invalid IL or missing references)541			//IL_006b: Unknown result type (might be due to invalid IL or missing references)542			//IL_0076: Unknown result type (might be due to invalid IL or missing references)543			//IL_007b: Unknown result type (might be due to invalid IL or missing references)544			//IL_007f: Unknown result type (might be due to invalid IL or missing references)545			//IL_0084: Unknown result type (might be due to invalid IL or missing references)546			//IL_0124: Unknown result type (might be due to invalid IL or missing references)547			//IL_0126: Unknown result type (might be due to invalid IL or missing references)548			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)549			//IL_0200: Unknown result type (might be due to invalid IL or missing references)550			//IL_0208: Unknown result type (might be due to invalid IL or missing references)551			//IL_0099: Unknown result type (might be due to invalid IL or missing references)552			//IL_009b: Unknown result type (might be due to invalid IL or missing references)553			//IL_0232: Unknown result type (might be due to invalid IL or missing references)554			//IL_0238: Unknown result type (might be due to invalid IL or missing references)555			//IL_0240: Unknown result type (might be due to invalid IL or missing references)556			//IL_0245: Unknown result type (might be due to invalid IL or missing references)557			//IL_0249: Unknown result type (might be due to invalid IL or missing references)558			//IL_024e: Unknown result type (might be due to invalid IL or missing references)559			//IL_027e: Unknown result type (might be due to invalid IL or missing references)560			//IL_0283: Unknown result type (might be due to invalid IL or missing references)561			//IL_028b: Unknown result type (might be due to invalid IL or missing references)562			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)563			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)564			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)565			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)566			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)567			//IL_0263: Unknown result type (might be due to invalid IL or missing references)568			//IL_0265: Unknown result type (might be due to invalid IL or missing references)569			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)570			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)571			int num = _003C_003E1__state;572			Delegation delegation = _003C_003E4__this;573			try574			{575				ConfiguredTaskAwaiter<IEntity> val2;576				ConfiguredValueTaskAwaiter<object> val;577				IEntity result;578				switch (num)579				{580				default:581				{582					string value = lp.Entity.GetValue<string>("UID_PersonWantsOrg");583					if (!string.IsNullOrEmpty(value))584					{585						DbObjectKey objectKey = DbObjectKey.GetObjectKey("PersonWantsOrg", value);586						val2 = lp.Session.Source().GetAsync(objectKey, EntityLoadType.Interactive, lp.CancellationToken).ConfigureAwait(false)587							.GetAwaiter();588						if (!val2.IsCompleted)589						{590							num = (_003C_003E1__state = 0);591							_003C_003Eu__1 = val2;592							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_CheckPwO_003Ed__4>(ref val2, ref this);593							return;594						}595						goto IL_00d0;596					}597					goto end_IL_000e;598				}599				case 0:600					val2 = _003C_003Eu__1;601					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntity>);602					num = (_003C_003E1__state = -1);603					goto IL_00d0;604				case 1:605					val = _003C_003Eu__2;606					_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<object>);607					num = (_003C_003E1__state = -1);608					goto IL_015b;609				case 2:610				case 3:611					break;612					IL_00d0:613					result = val2.GetResult();614					_003CePwO_003E5__2 = result;615					val = _003CePwO_003E5__2.CallFunctionAsync("GetPwOState", lp.CancellationToken).ConfigureAwait(false).GetAwaiter();616					if (!val.IsCompleted)617					{618						num = (_003C_003E1__state = 1);619						_003C_003Eu__2 = val;620						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<object>, _003C_CheckPwO_003Ed__4>(ref val, ref this);621						return;622					}623					goto IL_015b;624					IL_015b:625					if ((string)val.GetResult() != "IsClosed")626					{627						_003C_003E7__wrap2 = delegation.StartInternalProcess();628						break;629					}630					goto end_IL_000e;631				}632				try633				{634					ConfiguredTaskAwaiter val3;635					ConfiguredValueTaskAwaiter val5;636					if (num != 2)637					{638						if (num == 3)639						{640							val3 = _003C_003Eu__4;641							_003C_003Eu__4 = default(ConfiguredTaskAwaiter);642							num = (_003C_003E1__state = -1);643							goto IL_029a;644						}645						ConfiguredValueTaskAwaitable val4 = _003CePwO_003E5__2.CallMethodAsync("Abort", "", "", "QER-DELEGATION-CLOSED", lp.CancellationToken).ConfigureAwait(false);646						val5 = ((ConfiguredValueTaskAwaitable)(ref val4)).GetAwaiter();647						if (!((ConfiguredValueTaskAwaiter)(ref val5)).IsCompleted)648						{649							num = (_003C_003E1__state = 2);650							_003C_003Eu__3 = val5;651							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter, _003C_CheckPwO_003Ed__4>(ref val5, ref this);652							return;653						}654					}655					else656					{657						val5 = _003C_003Eu__3;658						_003C_003Eu__3 = default(ConfiguredValueTaskAwaiter);659						num = (_003C_003E1__state = -1);660					}661					((ConfiguredValueTaskAwaiter)(ref val5)).GetResult();662					ConfiguredTaskAwaitable val6 = lp.UnitOfWork.PutAsync(_003CePwO_003E5__2).ConfigureAwait(false);663					val3 = ((ConfiguredTaskAwaitable)(ref val6)).GetAwaiter();664					if (!((ConfiguredTaskAwaiter)(ref val3)).IsCompleted)665					{666						num = (_003C_003E1__state = 3);667						_003C_003Eu__4 = val3;668						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_CheckPwO_003Ed__4>(ref val3, ref this);669						return;670					}671					goto IL_029a;672					IL_029a:673					((ConfiguredTaskAwaiter)(ref val3)).GetResult();674				}675				finally676				{677					if (num < 0 && _003C_003E7__wrap2 != null)678					{679						_003C_003E7__wrap2.Dispose();680					}681				}682				_003C_003E7__wrap2 = null;683				end_IL_000e:;684			}685			catch (System.Exception exception)686			{687				_003C_003E1__state = -2;688				_003CePwO_003E5__2 = null;689				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);690				return;691			}692			_003C_003E1__state = -2;693			_003CePwO_003E5__2 = null;694			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();695		}696697		[DebuggerHidden]698		private void SetStateMachine(IAsyncStateMachine stateMachine)699		{700			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);701		}702	}703704	public Delegation(EntityLogicConstructionParameters cParams)705	{706		RegisterExpensive("_KeepMeInformedParent").DependsOn("ObjectKeyDelegated").As<bool>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<bool>>)GetParentInformed);707		CanEdit("KeepMeInformed").From("ObjectKeyDelegated", "_KeepMeInformedParent", "[IsLoaded]").As<string, bool, bool>((Func<string, bool, bool, bool>)((string obKey, bool bParent, bool bLoaded) => !bLoaded && (string.IsNullOrEmpty(obKey) || !bParent)));708		Value("KeepMeInformed").From("_KeepMeInformedParent").As<bool, TryResult<bool>>((bool bParent) => TryResult.FromResult(bParent, value: true));709		System.Collections.Generic.IEnumerator<IMetaColumn> enumerator = ((System.Collections.Generic.IEnumerable<IMetaColumn>)cParams.Table.Columns).GetEnumerator();710		try711		{712			while (((System.Collections.IEnumerator)enumerator).MoveNext())713			{714				IMetaColumn current = enumerator.Current;715				if (!(current.Columnname == "KeepMeInformed") && !current.Uid.StartsWith("CCC") && !current.IsSpecial)716				{717					CanEdit(current.Columnname).From("[IsLoaded]").As<bool>((Func<bool, bool>)((bool bLoaded) => !bLoaded));718				}719			}720		}721		finally722		{723			((System.IDisposable)enumerator)?.Dispose();724		}725		RegisterExtendedMethod("Abort").As<string, string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<string>>)Abort).OnSaving(Abort_OnSaving).Description("Method_Delegation_Abort");726	}727728	[AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__1))]729	public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)730	{731		//IL_0002: Unknown result type (might be due to invalid IL or missing references)732		//IL_0007: Unknown result type (might be due to invalid IL or missing references)733		//IL_0026: Unknown result type (might be due to invalid IL or missing references)734		//IL_0027: Unknown result type (might be due to invalid IL or missing references)735		LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);736		if (!entity.IsLoaded)737		{738			await _CheckDelegation(lp).ConfigureAwait(false);739		}740		if (entity.IsDeleted())741		{742			await _CheckPwO(lp).ConfigureAwait(false);743		}744		return await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);745	}746747	[AsyncStateMachine(typeof(_003CGetParentInformed_003Ed__2))]748	private async System.Threading.Tasks.Task<bool> GetParentInformed(ISession session, IEntity entity, CancellationToken ct)749	{750		//IL_0002: Unknown result type (might be due to invalid IL or missing references)751		//IL_0007: Unknown result type (might be due to invalid IL or missing references)752		//IL_001e: Unknown result type (might be due to invalid IL or missing references)753		//IL_001f: Unknown result type (might be due to invalid IL or missing references)754		string value = entity.Columns["ObjectKeyDelegated"].GetValue<string>();755		if (string.IsNullOrEmpty(value))756		{757			return false;758		}759		ISqlFormatter formatter = session.SqlFormatter();760		Query query = Query.From("Delegation").Where(string.Format("UID_PersonWantsOrg in ( select UID_PersonWantsOrg from PersonWantsOrg where OrderState in ( select OrderState from QER_VPWOOrderState where IsClosed = 0 )  and {0} ) ", (object)formatter.UidComparison("ObjectKeyAssignment", value))).Select("KeepMeInformed");761		TryResult<bool> tryResult = await session.Source().TryGetSingleValueAsync<bool>(query, ct).ConfigureAwait(false);762		return tryResult.Success && tryResult.Result;763	}764765	[AsyncStateMachine(typeof(_003C_CheckDelegation_003Ed__3))]766	private static System.Threading.Tasks.Task _CheckDelegation(LogicParameter lp)767	{768		//IL_0002: Unknown result type (might be due to invalid IL or missing references)769		//IL_0007: Unknown result type (might be due to invalid IL or missing references)770		_003C_CheckDelegation_003Ed__3 _003C_CheckDelegation_003Ed__ = default(_003C_CheckDelegation_003Ed__3);771		_003C_CheckDelegation_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();772		_003C_CheckDelegation_003Ed__.lp = lp;773		_003C_CheckDelegation_003Ed__._003C_003E1__state = -1;774		((AsyncTaskMethodBuilder)(ref _003C_CheckDelegation_003Ed__._003C_003Et__builder)).Start<_003C_CheckDelegation_003Ed__3>(ref _003C_CheckDelegation_003Ed__);775		return ((AsyncTaskMethodBuilder)(ref _003C_CheckDelegation_003Ed__._003C_003Et__builder)).Task;776	}777778	[AsyncStateMachine(typeof(_003C_CheckPwO_003Ed__4))]779	private System.Threading.Tasks.Task _CheckPwO(LogicParameter lp)780	{781		//IL_0002: Unknown result type (might be due to invalid IL or missing references)782		//IL_0007: Unknown result type (might be due to invalid IL or missing references)783		_003C_CheckPwO_003Ed__4 _003C_CheckPwO_003Ed__ = default(_003C_CheckPwO_003Ed__4);784		_003C_CheckPwO_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();785		_003C_CheckPwO_003Ed__._003C_003E4__this = this;786		_003C_CheckPwO_003Ed__.lp = lp;787		_003C_CheckPwO_003Ed__._003C_003E1__state = -1;788		((AsyncTaskMethodBuilder)(ref _003C_CheckPwO_003Ed__._003C_003Et__builder)).Start<_003C_CheckPwO_003Ed__4>(ref _003C_CheckPwO_003Ed__);789		return ((AsyncTaskMethodBuilder)(ref _003C_CheckPwO_003Ed__._003C_003Et__builder)).Task;790	}791792	private System.Threading.Tasks.Task<string> Abort(ISession session, IEntity entity, string strReason, CancellationToken ct)793	{794		return System.Threading.Tasks.Task.FromResult<string>(strReason);795	}796797	[AsyncStateMachine(typeof(_003CAbort_OnSaving_003Ed__6))]798	private System.Threading.Tasks.Task Abort_OnSaving(IEntity entity, LogicReadWriteParameters parameter, string strReasonText, CancellationToken ct)799	{800		//IL_0002: Unknown result type (might be due to invalid IL or missing references)801		//IL_0007: Unknown result type (might be due to invalid IL or missing references)802		//IL_002e: Unknown result type (might be due to invalid IL or missing references)803		//IL_0030: Unknown result type (might be due to invalid IL or missing references)804		_003CAbort_OnSaving_003Ed__6 _003CAbort_OnSaving_003Ed__ = default(_003CAbort_OnSaving_003Ed__6);805		_003CAbort_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();806		_003CAbort_OnSaving_003Ed__._003C_003E4__this = this;807		_003CAbort_OnSaving_003Ed__.entity = entity;808		_003CAbort_OnSaving_003Ed__.parameter = parameter;809		_003CAbort_OnSaving_003Ed__.strReasonText = strReasonText;810		_003CAbort_OnSaving_003Ed__.ct = ct;811		_003CAbort_OnSaving_003Ed__._003C_003E1__state = -1;812		((AsyncTaskMethodBuilder)(ref _003CAbort_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CAbort_OnSaving_003Ed__6>(ref _003CAbort_OnSaving_003Ed__);813		return ((AsyncTaskMethodBuilder)(ref _003CAbort_OnSaving_003Ed__._003C_003Et__builder)).Task;814	}815}816