QER.Customizer/QER.Customizer/PWODecisionMethod.cs
Decompiler Source FileQER.Customizer.PWODecisionMethodDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- Function registration: GetValidityMessages at line 603
- Method registration: ValidityCheck at line 604
- Function registration: CreateWorkingMethod at line 610
- CallFunctionAsync: GetValidityMessages at line 134
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 PWODecisionMethod, _003C_003Ec__DisplayClass3_0; methods _003C_Check_PWODecisionSubMethod_003Eb__0, MoveNext, SetStateMachine, GetValidityMessages, GetMessages, _Check_PWODecisionSubMethod; references DialogRichMail, OrgType, PWODecisionMethod, PWODecisionSubMethod; markers reads entity values, references DB/Dialog objects
Classes
PWODecisionMethod _003C_003Ec__DisplayClass3_0Methods
DB/Dialog object references
OIM key/entity markers
UID_PWODecisionSubMethod UID_SubMethodOrderProduct UID_SubMethodOrderUnsubscribe UID_SubMethodOrderProlongate UID_PWODecisionMethod UID_OrgType UID_DialogRichMailExpirationAPI/entity calls
TryResult GetValue GetValueAsync GetObjectKey Source GetValue From SqlFormatter DatabaseRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections.Generic;3using System.ComponentModel;4using System.Diagnostics;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Text;8using System.Threading;9using System.Threading.Tasks;10using VI.Base;11using VI.DB;12using VI.DB.DataAccess;13using VI.DB.Entities;1415namespace QER.Customizer;1617public class PWODecisionMethod : StateBasedEntityLogic18{19 [CompilerGenerated]20 private sealed class _003C_003Ec__DisplayClass3_021 {22 public string uidDecisionSubMethod;2324 internal ExpressionClause _003C_Check_PWODecisionSubMethod_003Eb__0(IExpressionContext c)25 {26 return c.Column("UID_PWODecisionSubMethod") == uidDecisionSubMethod;27 }28 }2930 [StructLayout((LayoutKind)3)]31 [CompilerGenerated]32 private struct _003CGetMessages_003Ed__2 : IAsyncStateMachine33 {34 public int _003C_003E1__state;3536 public AsyncTaskMethodBuilder _003C_003Et__builder;3738 public IEntity entity;3940 public string column;4142 public ISession session;4344 public CancellationToken ct;4546 public List<MessageEventArgs> lMessages;4748 private TryResult<IEntity> _003CtrSubmethod_003E5__2;4950 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__1;5152 private ConfiguredValueTaskAwaiter<object> _003C_003Eu__2;5354 private void MoveNext()55 {56 //IL_0099: Unknown result type (might be due to invalid IL or missing references)57 //IL_009e: Unknown result type (might be due to invalid IL or missing references)58 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)59 //IL_0134: Unknown result type (might be due to invalid IL or missing references)60 //IL_0139: Unknown result type (might be due to invalid IL or missing references)61 //IL_0141: Unknown result type (might be due to invalid IL or missing references)62 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)63 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)64 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)65 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)66 //IL_0104: Unknown result type (might be due to invalid IL or missing references)67 //IL_0050: Unknown result type (might be due to invalid IL or missing references)68 //IL_005b: Unknown result type (might be due to invalid IL or missing references)69 //IL_0060: Unknown result type (might be due to invalid IL or missing references)70 //IL_0064: Unknown result type (might be due to invalid IL or missing references)71 //IL_0069: Unknown result type (might be due to invalid IL or missing references)72 //IL_0119: Unknown result type (might be due to invalid IL or missing references)73 //IL_011b: Unknown result type (might be due to invalid IL or missing references)74 //IL_007e: Unknown result type (might be due to invalid IL or missing references)75 //IL_0080: Unknown result type (might be due to invalid IL or missing references)76 int num = _003C_003E1__state;77 try78 {79 ConfiguredTaskAwaiter<TryResult<IEntity>> val;80 if (num == 0)81 {82 val = _003C_003Eu__1;83 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);84 num = (_003C_003E1__state = -1);85 goto IL_00b5;86 }87 ConfiguredValueTaskAwaiter<object> val2;88 if (num == 1)89 {90 val2 = _003C_003Eu__2;91 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<object>);92 num = (_003C_003E1__state = -1);93 goto IL_0150;94 }95 string value = entity.GetValue<string>(column);96 if (!string.IsNullOrEmpty(value))97 {98 DbObjectKey objectKey = DbObjectKey.GetObjectKey("PWODecisionSubMethod", "UID_PWODecisionSubMethod", value);99 val = session.Source().TryGetAsync(objectKey, EntityLoadType.Interactive, ct).ConfigureAwait(false)100 .GetAwaiter();101 if (!val.IsCompleted)102 {103 num = (_003C_003E1__state = 0);104 _003C_003Eu__1 = val;105 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CGetMessages_003Ed__2>(ref val, ref this);106 return;107 }108 goto IL_00b5;109 }110 goto end_IL_0007;111 IL_0150:112 MessageEventArgs[] array = (MessageEventArgs[])val2.GetResult();113 if (array != null)114 {115 lMessages.AddRange((System.Collections.Generic.IEnumerable<MessageEventArgs>)array);116 }117 string value2 = entity.GetValue<string>("UsageArea");118 string value3 = _003CtrSubmethod_003E5__2.Result.GetValue<string>("UsageArea");119 if (!string.Equals(value2, value3, (StringComparison)5))120 {121 List<MessageEventArgs> obj = lMessages;122 LanguageManager instance = LanguageManager.Instance;123 global::_003C_003Ey__InlineArray2<object> buffer = default(global::_003C_003Ey__InlineArray2<object>);124 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 0) = entity.Display;125 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 1) = _003CtrSubmethod_003E5__2.Result.Display;126 obj.Add(new MessageEventArgs(MsgSeverity.Serious, instance.FormatString("DecisionMethodValidity_UsageArea", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray2<object>, object>(in buffer, 2))));127 }128 goto IL_01fd;129 IL_00b5:130 TryResult<IEntity> result = val.GetResult();131 _003CtrSubmethod_003E5__2 = result;132 if (_003CtrSubmethod_003E5__2.Success)133 {134 val2 = _003CtrSubmethod_003E5__2.Result.CallFunctionAsync("GetValidityMessages", ct).ConfigureAwait(false).GetAwaiter();135 if (!val2.IsCompleted)136 {137 num = (_003C_003E1__state = 1);138 _003C_003Eu__2 = val2;139 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<object>, _003CGetMessages_003Ed__2>(ref val2, ref this);140 return;141 }142 goto IL_0150;143 }144 goto IL_01fd;145 IL_01fd:146 _003CtrSubmethod_003E5__2 = null;147 end_IL_0007:;148 }149 catch (System.Exception exception)150 {151 _003C_003E1__state = -2;152 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);153 return;154 }155 _003C_003E1__state = -2;156 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();157 }158159 [DebuggerHidden]160 private void SetStateMachine(IAsyncStateMachine stateMachine)161 {162 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);163 }164 }165166 [StructLayout((LayoutKind)3)]167 [CompilerGenerated]168 private struct _003CGetValidityMessages_003Ed__1 : IAsyncStateMachine169 {170 public int _003C_003E1__state;171172 public AsyncTaskMethodBuilder<MessageEventArgs[]> _003C_003Et__builder;173174 public ISession session;175176 public IEntity entity;177178 public CancellationToken ct;179180 private List<MessageEventArgs> _003ClMessages_003E5__2;181182 private ConfiguredTaskAwaiter _003C_003Eu__1;183184 private void MoveNext()185 {186 //IL_0082: Unknown result type (might be due to invalid IL or missing references)187 //IL_0087: Unknown result type (might be due to invalid IL or missing references)188 //IL_008e: Unknown result type (might be due to invalid IL or missing references)189 //IL_0102: Unknown result type (might be due to invalid IL or missing references)190 //IL_0107: Unknown result type (might be due to invalid IL or missing references)191 //IL_010e: Unknown result type (might be due to invalid IL or missing references)192 //IL_017f: Unknown result type (might be due to invalid IL or missing references)193 //IL_0184: Unknown result type (might be due to invalid IL or missing references)194 //IL_018b: Unknown result type (might be due to invalid IL or missing references)195 //IL_003c: Unknown result type (might be due to invalid IL or missing references)196 //IL_0047: Unknown result type (might be due to invalid IL or missing references)197 //IL_004c: Unknown result type (might be due to invalid IL or missing references)198 //IL_004f: Unknown result type (might be due to invalid IL or missing references)199 //IL_0054: Unknown result type (might be due to invalid IL or missing references)200 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)201 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)202 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)203 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)204 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)205 //IL_013c: Unknown result type (might be due to invalid IL or missing references)206 //IL_0147: Unknown result type (might be due to invalid IL or missing references)207 //IL_014c: Unknown result type (might be due to invalid IL or missing references)208 //IL_014f: Unknown result type (might be due to invalid IL or missing references)209 //IL_0154: Unknown result type (might be due to invalid IL or missing references)210 //IL_0068: Unknown result type (might be due to invalid IL or missing references)211 //IL_0069: Unknown result type (might be due to invalid IL or missing references)212 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)213 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)214 //IL_0168: Unknown result type (might be due to invalid IL or missing references)215 //IL_0169: Unknown result type (might be due to invalid IL or missing references)216 int num = _003C_003E1__state;217 MessageEventArgs[] result;218 try219 {220 ConfiguredTaskAwaitable val2;221 ConfiguredTaskAwaiter val;222 switch (num)223 {224 default:225 _003ClMessages_003E5__2 = new List<MessageEventArgs>();226 val2 = GetMessages(session, entity, "UID_SubMethodOrderProduct", _003ClMessages_003E5__2, ct).ConfigureAwait(false);227 val = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();228 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)229 {230 num = (_003C_003E1__state = 0);231 _003C_003Eu__1 = val;232 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGetValidityMessages_003Ed__1>(ref val, ref this);233 return;234 }235 goto IL_009d;236 case 0:237 val = _003C_003Eu__1;238 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);239 num = (_003C_003E1__state = -1);240 goto IL_009d;241 case 1:242 val = _003C_003Eu__1;243 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);244 num = (_003C_003E1__state = -1);245 goto IL_011d;246 case 2:247 {248 val = _003C_003Eu__1;249 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);250 num = (_003C_003E1__state = -1);251 break;252 }253 IL_011d:254 ((ConfiguredTaskAwaiter)(ref val)).GetResult();255 val2 = GetMessages(session, entity, "UID_SubMethodOrderUnsubscribe", _003ClMessages_003E5__2, ct).ConfigureAwait(false);256 val = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();257 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)258 {259 num = (_003C_003E1__state = 2);260 _003C_003Eu__1 = val;261 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGetValidityMessages_003Ed__1>(ref val, ref this);262 return;263 }264 break;265 IL_009d:266 ((ConfiguredTaskAwaiter)(ref val)).GetResult();267 val2 = GetMessages(session, entity, "UID_SubMethodOrderProlongate", _003ClMessages_003E5__2, ct).ConfigureAwait(false);268 val = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();269 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)270 {271 num = (_003C_003E1__state = 1);272 _003C_003Eu__1 = val;273 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGetValidityMessages_003Ed__1>(ref val, ref this);274 return;275 }276 goto IL_011d;277 }278 ((ConfiguredTaskAwaiter)(ref val)).GetResult();279 result = ((_003ClMessages_003E5__2.Count > 0) ? _003ClMessages_003E5__2.ToArray() : null);280 }281 catch (System.Exception exception)282 {283 _003C_003E1__state = -2;284 _003ClMessages_003E5__2 = null;285 _003C_003Et__builder.SetException(exception);286 return;287 }288 _003C_003E1__state = -2;289 _003ClMessages_003E5__2 = null;290 _003C_003Et__builder.SetResult(result);291 }292293 [DebuggerHidden]294 private void SetStateMachine(IAsyncStateMachine stateMachine)295 {296 _003C_003Et__builder.SetStateMachine(stateMachine);297 }298 }299300 [StructLayout((LayoutKind)3)]301 [CompilerGenerated]302 private struct _003CValidityCheck_003Ed__4 : IAsyncStateMachine303 {304 public int _003C_003E1__state;305306 public AsyncTaskMethodBuilder _003C_003Et__builder;307308 public ISession session;309310 public IEntity entity;311312 public CancellationToken ct;313314 private ConfiguredTaskAwaiter<MessageEventArgs[]?> _003C_003Eu__1;315316 private void MoveNext()317 {318 //IL_005e: Unknown result type (might be due to invalid IL or missing references)319 //IL_0063: Unknown result type (might be due to invalid IL or missing references)320 //IL_006a: Unknown result type (might be due to invalid IL or missing references)321 //IL_0017: Unknown result type (might be due to invalid IL or missing references)322 //IL_0022: Unknown result type (might be due to invalid IL or missing references)323 //IL_0027: Unknown result type (might be due to invalid IL or missing references)324 //IL_002b: Unknown result type (might be due to invalid IL or missing references)325 //IL_0030: Unknown result type (might be due to invalid IL or missing references)326 //IL_0081: Unknown result type (might be due to invalid IL or missing references)327 //IL_0087: Expected O, but got Unknown328 //IL_0044: Unknown result type (might be due to invalid IL or missing references)329 //IL_0045: Unknown result type (might be due to invalid IL or missing references)330 int num = _003C_003E1__state;331 try332 {333 ConfiguredTaskAwaiter<MessageEventArgs[]> val;334 if (num != 0)335 {336 val = GetValidityMessages(session, entity, ct).ConfigureAwait(false).GetAwaiter();337 if (!val.IsCompleted)338 {339 num = (_003C_003E1__state = 0);340 _003C_003Eu__1 = val;341 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<MessageEventArgs[]>, _003CValidityCheck_003Ed__4>(ref val, ref this);342 return;343 }344 }345 else346 {347 val = _003C_003Eu__1;348 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<MessageEventArgs[]>);349 num = (_003C_003E1__state = -1);350 }351 MessageEventArgs[] result = val.GetResult();352 StringBuilder val2 = new StringBuilder();353 if (result != null)354 {355 MessageEventArgs[] array = result;356 foreach (MessageEventArgs e in array)357 {358 switch (e.Severity)359 {360 case MsgSeverity.Info:361 val2.Append("Info - ").Append(e.Text);362 break;363 case MsgSeverity.Warning:364 val2.Append("Warning - ").Append(e.Text);365 break;366 case MsgSeverity.Serious:367 val2.Append("Error - ").Append(e.Text);368 break;369 }370 val2.AppendLine();371 }372 throw new ViException(2133229, ExceptionRelevance.EndUser, ((object)val2).ToString());373 }374 }375 catch (System.Exception exception)376 {377 _003C_003E1__state = -2;378 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);379 return;380 }381 _003C_003E1__state = -2;382 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();383 }384385 [DebuggerHidden]386 private void SetStateMachine(IAsyncStateMachine stateMachine)387 {388 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);389 }390 }391392 [StructLayout((LayoutKind)3)]393 [CompilerGenerated]394 private struct _003C_Check_PWODecisionSubMethod_003Ed__3 : IAsyncStateMachine395 {396 public int _003C_003E1__state;397398 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;399400 public string uidDecisionSubMethod;401402 public IEntity entity;403404 public ISession session;405406 public CancellationToken ct;407408 private string _003CusageArea_003E5__2;409410 private ConfiguredTaskAwaiter<TryResult<string>> _003C_003Eu__1;411412 private void MoveNext()413 {414 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)415 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)416 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)417 //IL_0097: Unknown result type (might be due to invalid IL or missing references)418 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)419 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)420 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)421 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)422 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)423 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)424 int num = _003C_003E1__state;425 bool result;426 try427 {428 ConfiguredTaskAwaiter<TryResult<string>> val;429 if (num == 0)430 {431 val = _003C_003Eu__1;432 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<string>>);433 num = (_003C_003E1__state = -1);434 goto IL_00fc;435 }436 _003C_003Ec__DisplayClass3_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass3_0437 {438 uidDecisionSubMethod = uidDecisionSubMethod439 };440 _003CusageArea_003E5__2 = entity.GetValue("UsageArea");441 if (!string.IsNullOrEmpty(_003CusageArea_003E5__2) && !string.IsNullOrEmpty(CS_0024_003C_003E8__locals2.uidDecisionSubMethod))442 {443 Query query = (from c in Query.From("PWODecisionSubMethod")444 where c.Column("UID_PWODecisionSubMethod") == CS_0024_003C_003E8__locals2.uidDecisionSubMethod445 select c).Select("UsageArea");446 val = session.Source().TryGetSingleValueAsync<string>(query, ct).ConfigureAwait(false)447 .GetAwaiter();448 if (!val.IsCompleted)449 {450 num = (_003C_003E1__state = 0);451 _003C_003Eu__1 = val;452 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<string>>, _003C_Check_PWODecisionSubMethod_003Ed__3>(ref val, ref this);453 return;454 }455 goto IL_00fc;456 }457 result = true;458 goto end_IL_0007;459 IL_00fc:460 TryResult<string> result2 = val.GetResult();461 if (result2.Success && !string.Equals(_003CusageArea_003E5__2, result2.Result))462 {463 throw new ViException(2133414, ExceptionRelevance.EndUser);464 }465 result = true;466 end_IL_0007:;467 }468 catch (System.Exception exception)469 {470 _003C_003E1__state = -2;471 _003CusageArea_003E5__2 = null;472 _003C_003Et__builder.SetException(exception);473 return;474 }475 _003C_003E1__state = -2;476 _003CusageArea_003E5__2 = null;477 _003C_003Et__builder.SetResult(result);478 }479480 [DebuggerHidden]481 private void SetStateMachine(IAsyncStateMachine stateMachine)482 {483 _003C_003Et__builder.SetStateMachine(stateMachine);484 }485 }486487 [StructLayout((LayoutKind)3)]488 [CompilerGenerated]489 private struct _003C_CreateWorkingMethod_003Ed__5 : IAsyncStateMachine490 {491 public int _003C_003E1__state;492493 public AsyncTaskMethodBuilder<string> _003C_003Et__builder;494495 public IEntity entity;496497 public CancellationToken ct;498499 public ISession session;500501 public string orderState;502503 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;504505 private ConfiguredTaskAwaiter<object> _003C_003Eu__2;506507 private void MoveNext()508 {509 //IL_0074: Unknown result type (might be due to invalid IL or missing references)510 //IL_0079: Unknown result type (might be due to invalid IL or missing references)511 //IL_0081: Unknown result type (might be due to invalid IL or missing references)512 //IL_0104: Unknown result type (might be due to invalid IL or missing references)513 //IL_010f: Unknown result type (might be due to invalid IL or missing references)514 //IL_0114: Unknown result type (might be due to invalid IL or missing references)515 //IL_0118: Unknown result type (might be due to invalid IL or missing references)516 //IL_011d: Unknown result type (might be due to invalid IL or missing references)517 //IL_014a: Unknown result type (might be due to invalid IL or missing references)518 //IL_014f: Unknown result type (might be due to invalid IL or missing references)519 //IL_0157: Unknown result type (might be due to invalid IL or missing references)520 //IL_0027: Unknown result type (might be due to invalid IL or missing references)521 //IL_0036: Unknown result type (might be due to invalid IL or missing references)522 //IL_003b: Unknown result type (might be due to invalid IL or missing references)523 //IL_003f: Unknown result type (might be due to invalid IL or missing references)524 //IL_0044: Unknown result type (might be due to invalid IL or missing references)525 //IL_0132: Unknown result type (might be due to invalid IL or missing references)526 //IL_0134: Unknown result type (might be due to invalid IL or missing references)527 //IL_0059: Unknown result type (might be due to invalid IL or missing references)528 //IL_005b: Unknown result type (might be due to invalid IL or missing references)529 int num = _003C_003E1__state;530 string result2;531 try532 {533 ConfiguredTaskAwaiter<object> val;534 ConfiguredValueTaskAwaiter<string> val2;535 if (num != 0)536 {537 if (num == 1)538 {539 val = _003C_003Eu__2;540 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<object>);541 num = (_003C_003E1__state = -1);542 goto IL_0166;543 }544 val2 = entity.Columns["UID_PWODecisionMethod"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();545 if (!val2.IsCompleted)546 {547 num = (_003C_003E1__state = 0);548 _003C_003Eu__1 = val2;549 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CreateWorkingMethod_003Ed__5>(ref val2, ref this);550 return;551 }552 }553 else554 {555 val2 = _003C_003Eu__1;556 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);557 num = (_003C_003E1__state = -1);558 }559 string result = val2.GetResult();560 ISqlFormatter sqlFormatter = session.SqlFormatter();561 string systemIdentifier = session.Database().SystemIdentifier;562 global::_003C_003Ey__InlineArray2<object> buffer = default(global::_003C_003Ey__InlineArray2<object>);563 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 0) = sqlFormatter.FormatUidValue(result);564 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 1) = sqlFormatter.FormatValue(orderState, ValType.String);565 string sqlStatement = SqlStrings.Format(systemIdentifier, "PWODecisionMethod_GetUidWorkingMethod", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray2<object>, object>(in buffer, 2));566 val = session.Resolve<IDbSession>().SqlExecuteScalarAsync(sqlStatement, ct).ConfigureAwait(false)567 .GetAwaiter();568 if (!val.IsCompleted)569 {570 num = (_003C_003E1__state = 1);571 _003C_003Eu__2 = val;572 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<object>, _003C_CreateWorkingMethod_003Ed__5>(ref val, ref this);573 return;574 }575 goto IL_0166;576 IL_0166:577 string text = DbVal.ConvertTo<string>(val.GetResult());578 if (string.IsNullOrEmpty(text))579 {580 throw new ViException(2133443, ExceptionRelevance.EndUser);581 }582 result2 = text;583 }584 catch (System.Exception exception)585 {586 _003C_003E1__state = -2;587 _003C_003Et__builder.SetException(exception);588 return;589 }590 _003C_003E1__state = -2;591 _003C_003Et__builder.SetResult(result2);592 }593594 [DebuggerHidden]595 private void SetStateMachine(IAsyncStateMachine stateMachine)596 {597 _003C_003Et__builder.SetStateMachine(stateMachine);598 }599 }600601 public PWODecisionMethod()602 {603 RegisterFunction("GetValidityMessages").As<MessageEventArgs[]>(GetValidityMessages).Description("Method_PWODecisionMethod_GetValidityMessages").Behavior(MethodBehavior.ValidForReadOnlyUser);604 RegisterMethod("ValidityCheck").As(ValidityCheck).Description("Method_PWODecisionMethod_ValidityCheck").Behavior(MethodBehavior.ValidForReadOnlyUser);605 CanEdit("UID_SubMethodOrderProlongate", "UID_SubMethodOrderUnsubscribe", "UID_OrgType", "Priority", "UID_DialogRichMailExpiration").From("UsageArea").As<string>((Func<string, bool>)((string usageArea) => !usageArea.StartsWith("a", (StringComparison)5))).ClearValueOnFalse()606 .HiddenWhenDisabled();607 Check("UID_SubMethodOrderProduct").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_Check_PWODecisionSubMethod).DependsOn("UsageArea");608 Check("UID_SubMethodOrderProlongate").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_Check_PWODecisionSubMethod).DependsOn("UsageArea");609 Check("UID_SubMethodOrderUnsubscribe").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_Check_PWODecisionSubMethod).DependsOn("UsageArea");610 RegisterFunction("CreateWorkingMethod").As<string, string>(_CreateWorkingMethod).Behavior(MethodBehavior.ChangesExternalState);611 }612613 [AsyncStateMachine(typeof(_003CGetValidityMessages_003Ed__1))]614 [Description("Method_PWODecisionMethod_GetValidityMessages")]615 public static async System.Threading.Tasks.Task<MessageEventArgs[]?> GetValidityMessages(ISession session, IEntity entity, CancellationToken ct)616 {617 //IL_0002: Unknown result type (might be due to invalid IL or missing references)618 //IL_0007: Unknown result type (might be due to invalid IL or missing references)619 //IL_001e: Unknown result type (might be due to invalid IL or missing references)620 //IL_001f: Unknown result type (might be due to invalid IL or missing references)621 List<MessageEventArgs> lMessages = new List<MessageEventArgs>();622 await GetMessages(session, entity, "UID_SubMethodOrderProduct", lMessages, ct).ConfigureAwait(false);623 await GetMessages(session, entity, "UID_SubMethodOrderProlongate", lMessages, ct).ConfigureAwait(false);624 await GetMessages(session, entity, "UID_SubMethodOrderUnsubscribe", lMessages, ct).ConfigureAwait(false);625 return (lMessages.Count > 0) ? lMessages.ToArray() : null;626 }627628 [AsyncStateMachine(typeof(_003CGetMessages_003Ed__2))]629 private static System.Threading.Tasks.Task GetMessages(ISession session, IEntity entity, string column, List<MessageEventArgs> lMessages, CancellationToken ct)630 {631 //IL_0002: Unknown result type (might be due to invalid IL or missing references)632 //IL_0007: Unknown result type (might be due to invalid IL or missing references)633 //IL_002e: Unknown result type (might be due to invalid IL or missing references)634 //IL_0030: Unknown result type (might be due to invalid IL or missing references)635 _003CGetMessages_003Ed__2 _003CGetMessages_003Ed__ = default(_003CGetMessages_003Ed__2);636 _003CGetMessages_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();637 _003CGetMessages_003Ed__.session = session;638 _003CGetMessages_003Ed__.entity = entity;639 _003CGetMessages_003Ed__.column = column;640 _003CGetMessages_003Ed__.lMessages = lMessages;641 _003CGetMessages_003Ed__.ct = ct;642 _003CGetMessages_003Ed__._003C_003E1__state = -1;643 ((AsyncTaskMethodBuilder)(ref _003CGetMessages_003Ed__._003C_003Et__builder)).Start<_003CGetMessages_003Ed__2>(ref _003CGetMessages_003Ed__);644 return ((AsyncTaskMethodBuilder)(ref _003CGetMessages_003Ed__._003C_003Et__builder)).Task;645 }646647 [AsyncStateMachine(typeof(_003C_Check_PWODecisionSubMethod_003Ed__3))]648 private static async System.Threading.Tasks.Task<bool> _Check_PWODecisionSubMethod(ISession session, IEntity entity, string uidDecisionSubMethod, CancellationToken ct)649 {650 //IL_0002: Unknown result type (might be due to invalid IL or missing references)651 //IL_0007: Unknown result type (might be due to invalid IL or missing references)652 //IL_0026: Unknown result type (might be due to invalid IL or missing references)653 //IL_0027: Unknown result type (might be due to invalid IL or missing references)654 string usageArea = entity.GetValue("UsageArea");655 if (string.IsNullOrEmpty(usageArea) || string.IsNullOrEmpty(uidDecisionSubMethod))656 {657 return true;658 }659 Query query = (from c in Query.From("PWODecisionSubMethod")660 where c.Column("UID_PWODecisionSubMethod") == uidDecisionSubMethod661 select c).Select("UsageArea");662 TryResult<string> tryResult = await session.Source().TryGetSingleValueAsync<string>(query, ct).ConfigureAwait(false);663 if (tryResult.Success && !string.Equals(usageArea, tryResult.Result))664 {665 throw new ViException(2133414, ExceptionRelevance.EndUser);666 }667 return true;668 }669670 [AsyncStateMachine(typeof(_003CValidityCheck_003Ed__4))]671 private System.Threading.Tasks.Task ValidityCheck(ISession session, IEntity entity, CancellationToken ct)672 {673 //IL_0002: Unknown result type (might be due to invalid IL or missing references)674 //IL_0007: Unknown result type (might be due to invalid IL or missing references)675 //IL_001e: Unknown result type (might be due to invalid IL or missing references)676 //IL_001f: Unknown result type (might be due to invalid IL or missing references)677 _003CValidityCheck_003Ed__4 _003CValidityCheck_003Ed__ = default(_003CValidityCheck_003Ed__4);678 _003CValidityCheck_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();679 _003CValidityCheck_003Ed__.session = session;680 _003CValidityCheck_003Ed__.entity = entity;681 _003CValidityCheck_003Ed__.ct = ct;682 _003CValidityCheck_003Ed__._003C_003E1__state = -1;683 ((AsyncTaskMethodBuilder)(ref _003CValidityCheck_003Ed__._003C_003Et__builder)).Start<_003CValidityCheck_003Ed__4>(ref _003CValidityCheck_003Ed__);684 return ((AsyncTaskMethodBuilder)(ref _003CValidityCheck_003Ed__._003C_003Et__builder)).Task;685 }686687 [AsyncStateMachine(typeof(_003C_CreateWorkingMethod_003Ed__5))]688 private static async System.Threading.Tasks.Task<string> _CreateWorkingMethod(ISession session, IEntity entity, string orderState, CancellationToken ct)689 {690 //IL_0002: Unknown result type (might be due to invalid IL or missing references)691 //IL_0007: Unknown result type (might be due to invalid IL or missing references)692 //IL_0026: Unknown result type (might be due to invalid IL or missing references)693 //IL_0027: Unknown result type (might be due to invalid IL or missing references)694 string value = await entity.Columns["UID_PWODecisionMethod"].GetValueAsync<string>(ct).ConfigureAwait(false);695 ISqlFormatter sqlFormatter = session.SqlFormatter();696 string systemIdentifier = session.Database().SystemIdentifier;697 global::_003C_003Ey__InlineArray2<object> buffer = default(global::_003C_003Ey__InlineArray2<object>);698 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 0) = sqlFormatter.FormatUidValue(value);699 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 1) = sqlFormatter.FormatValue(orderState, ValType.String);700 string sqlStatement = SqlStrings.Format(systemIdentifier, "PWODecisionMethod_GetUidWorkingMethod", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray2<object>, object>(in buffer, 2));701 string text = DbVal.ConvertTo<string>(await session.Resolve<IDbSession>().SqlExecuteScalarAsync(sqlStatement, ct).ConfigureAwait(false));702 if (string.IsNullOrEmpty(text))703 {704 throw new ViException(2133443, ExceptionRelevance.EndUser);705 }706 return text;707 }708}709