Common.Customizer/VI.Common.Customizer/DialogTable.cs
Decompiler Source FileCommon.Customizer.DialogTableDecompiled 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: ExecuteTemplates at line 1084
- CustomGenerated event: ExecuteTemplates at line 1083
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 Job/process related markers
Summary: classes DialogTable, _003C_003Ec__DisplayClass4_0; methods _003C_ConfigureColumns_003Eb__0, MoveNext, SetStateMachine, OnSavingAsync, _ConfigureColumns, OnSavedAsync; references DialogCalendar, DialogColumn, DialogDBQueue, DialogMultiLanguage, DialogNotification, DialogProcess; markers reads entity values, references DB/Dialog objects, Job/process related markers
Classes
DialogTable _003C_003Ec__DisplayClass4_0Methods
DB/Dialog object references
OIM key/entity markers
UID_DialogTable UID_DialogTableBase UID_DialogUser UID_DialogTableUnionAPI/entity calls
GetValue GetValueAsync TryResult Source SqlFormatter IsTransport MetaData FromRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Linq;6using System.Runtime.CompilerServices;7using System.Runtime.InteropServices;8using System.Text.RegularExpressions;9using System.Threading;10using System.Threading.Tasks;11using VI.Base;12using VI.DB;13using VI.DB.Entities;14using VI.DB.MetaData;15using VI.DB.SqlParsing;16using VI.DB.Sync;1718namespace VI.Common.Customizer;1920public class DialogTable : CommonLogicBase21{22 [CompilerGenerated]23 private sealed class _003C_003Ec__DisplayClass4_024 {25 public IEntity entity;2627 internal ExpressionClause _003C_ConfigureColumns_003Eb__0(IExpressionContext c)28 {29 return c.Column("UID_DialogTable") == entity.Columns["UID_DialogTable"].GetValue<string>() && c.Column("IndexWeight") > 0;30 }31 }3233 [StructLayout((LayoutKind)3)]34 [CompilerGenerated]35 private struct _003COnSavedAsync_003Ed__5 : IAsyncStateMachine36 {37 public int _003C_003E1__state;3839 public AsyncTaskMethodBuilder _003C_003Et__builder;4041 public IEntity entity;4243 public CancellationToken ct;4445 public LogicReadWriteParameters parameters;4647 public DialogTable _003C_003E4__this;4849 private string _003CtableType_003E5__2;5051 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;5253 private IEntity _003CbaseTable_003E5__3;5455 private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;5657 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__3;5859 private ConfiguredTaskAwaiter _003C_003Eu__4;6061 private void MoveNext()62 {63 //IL_0085: Unknown result type (might be due to invalid IL or missing references)64 //IL_008a: Unknown result type (might be due to invalid IL or missing references)65 //IL_0092: Unknown result type (might be due to invalid IL or missing references)66 //IL_0109: Unknown result type (might be due to invalid IL or missing references)67 //IL_010e: Unknown result type (might be due to invalid IL or missing references)68 //IL_0116: Unknown result type (might be due to invalid IL or missing references)69 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)70 //IL_01da: Unknown result type (might be due to invalid IL or missing references)71 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)72 //IL_0261: Unknown result type (might be due to invalid IL or missing references)73 //IL_0266: Unknown result type (might be due to invalid IL or missing references)74 //IL_026e: Unknown result type (might be due to invalid IL or missing references)75 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)76 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)77 //IL_02fa: Unknown result type (might be due to invalid IL or missing references)78 //IL_036b: Unknown result type (might be due to invalid IL or missing references)79 //IL_0370: Unknown result type (might be due to invalid IL or missing references)80 //IL_0378: Unknown result type (might be due to invalid IL or missing references)81 //IL_0038: Unknown result type (might be due to invalid IL or missing references)82 //IL_0047: Unknown result type (might be due to invalid IL or missing references)83 //IL_004c: Unknown result type (might be due to invalid IL or missing references)84 //IL_0050: Unknown result type (might be due to invalid IL or missing references)85 //IL_0055: Unknown result type (might be due to invalid IL or missing references)86 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)87 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)88 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)89 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)90 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)91 //IL_0214: Unknown result type (might be due to invalid IL or missing references)92 //IL_0223: Unknown result type (might be due to invalid IL or missing references)93 //IL_0228: Unknown result type (might be due to invalid IL or missing references)94 //IL_022c: Unknown result type (might be due to invalid IL or missing references)95 //IL_0231: Unknown result type (might be due to invalid IL or missing references)96 //IL_006a: Unknown result type (might be due to invalid IL or missing references)97 //IL_006c: Unknown result type (might be due to invalid IL or missing references)98 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)99 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)100 //IL_0325: Unknown result type (might be due to invalid IL or missing references)101 //IL_0330: Unknown result type (might be due to invalid IL or missing references)102 //IL_0335: Unknown result type (might be due to invalid IL or missing references)103 //IL_0339: Unknown result type (might be due to invalid IL or missing references)104 //IL_033e: Unknown result type (might be due to invalid IL or missing references)105 //IL_0246: Unknown result type (might be due to invalid IL or missing references)106 //IL_0248: Unknown result type (might be due to invalid IL or missing references)107 //IL_02a4: Unknown result type (might be due to invalid IL or missing references)108 //IL_02af: Unknown result type (might be due to invalid IL or missing references)109 //IL_02b4: Unknown result type (might be due to invalid IL or missing references)110 //IL_02b8: Unknown result type (might be due to invalid IL or missing references)111 //IL_02bd: Unknown result type (might be due to invalid IL or missing references)112 //IL_0353: Unknown result type (might be due to invalid IL or missing references)113 //IL_0355: Unknown result type (might be due to invalid IL or missing references)114 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)115 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)116 //IL_018c: Unknown result type (might be due to invalid IL or missing references)117 //IL_0197: Unknown result type (might be due to invalid IL or missing references)118 //IL_019c: Unknown result type (might be due to invalid IL or missing references)119 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)120 //IL_01a5: Unknown result type (might be due to invalid IL or missing references)121 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)122 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)123 int num = _003C_003E1__state;124 DialogTable dialogTable = _003C_003E4__this;125 try126 {127 ConfiguredValueTaskAwaiter<string> val4;128 ConfiguredTaskAwaiter<IEntity> val3;129 ConfiguredValueTaskAwaiter<ApplyResult> val2;130 ConfiguredTaskAwaiter val;131 ConfiguredTaskAwaitable val5;132 string result;133 IEntity result2;134 string result3;135 switch (num)136 {137 default:138 val4 = entity.GetValueAsync<string>("TableType", ct).ConfigureAwait(false).GetAwaiter();139 if (!val4.IsCompleted)140 {141 num = (_003C_003E1__state = 0);142 _003C_003Eu__1 = val4;143 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavedAsync_003Ed__5>(ref val4, ref this);144 return;145 }146 goto IL_00a1;147 case 0:148 val4 = _003C_003Eu__1;149 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);150 num = (_003C_003E1__state = -1);151 goto IL_00a1;152 case 1:153 val4 = _003C_003Eu__1;154 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);155 num = (_003C_003E1__state = -1);156 goto IL_0125;157 case 2:158 val3 = _003C_003Eu__2;159 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);160 num = (_003C_003E1__state = -1);161 goto IL_01f1;162 case 3:163 val2 = _003C_003Eu__3;164 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);165 num = (_003C_003E1__state = -1);166 goto IL_027d;167 case 4:168 val = _003C_003Eu__4;169 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);170 num = (_003C_003E1__state = -1);171 goto IL_0309;172 case 5:173 {174 val = _003C_003Eu__4;175 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);176 num = (_003C_003E1__state = -1);177 break;178 }179 IL_0317:180 val5 = ((StateLessEntityLogic)dialogTable).OnSavedAsync(entity, parameters, ct).ConfigureAwait(false);181 val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();182 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)183 {184 num = (_003C_003E1__state = 5);185 _003C_003Eu__4 = val;186 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__5>(ref val, ref this);187 return;188 }189 break;190 IL_00a1:191 result = val4.GetResult();192 _003CtableType_003E5__2 = result;193 val4 = entity.GetValueAsync<string>("UID_DialogTableBase", ct).ConfigureAwait(false).GetAwaiter();194 if (!val4.IsCompleted)195 {196 num = (_003C_003E1__state = 1);197 _003C_003Eu__1 = val4;198 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavedAsync_003Ed__5>(ref val4, ref this);199 return;200 }201 goto IL_0125;202 IL_01f1:203 result2 = val3.GetResult();204 _003CbaseTable_003E5__3 = result2;205 val2 = _003CbaseTable_003E5__3.PutValueAsync("IsTransportDisabled", true, ct).ConfigureAwait(false).GetAwaiter();206 if (!val2.IsCompleted)207 {208 num = (_003C_003E1__state = 3);209 _003C_003Eu__3 = val2;210 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003COnSavedAsync_003Ed__5>(ref val2, ref this);211 return;212 }213 goto IL_027d;214 IL_0125:215 result3 = val4.GetResult();216 if (entity.Columns["TableType"].IsDifferent && _Eq(_003CtableType_003E5__2, "V") && !string.IsNullOrEmpty(result3))217 {218 DbObjectKey key = new DbObjectKey("DialogTable", result3);219 val3 = parameters.Session.Source().GetAsync(key, ct).ConfigureAwait(false)220 .GetAwaiter();221 if (!val3.IsCompleted)222 {223 num = (_003C_003E1__state = 2);224 _003C_003Eu__2 = val3;225 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003COnSavedAsync_003Ed__5>(ref val3, ref this);226 return;227 }228 goto IL_01f1;229 }230 goto IL_0317;231 IL_0309:232 ((ConfiguredTaskAwaiter)(ref val)).GetResult();233 goto IL_0310;234 IL_027d:235 val2.GetResult();236 if (_003CbaseTable_003E5__3.IsDifferent)237 {238 val5 = parameters.UnitOfWork.PutAsync(_003CbaseTable_003E5__3, ct).ConfigureAwait(false);239 val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();240 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)241 {242 num = (_003C_003E1__state = 4);243 _003C_003Eu__4 = val;244 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__5>(ref val, ref this);245 return;246 }247 goto IL_0309;248 }249 goto IL_0310;250 IL_0310:251 _003CbaseTable_003E5__3 = null;252 goto IL_0317;253 }254 ((ConfiguredTaskAwaiter)(ref val)).GetResult();255 }256 catch (System.Exception exception)257 {258 _003C_003E1__state = -2;259 _003CtableType_003E5__2 = null;260 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);261 return;262 }263 _003C_003E1__state = -2;264 _003CtableType_003E5__2 = null;265 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();266 }267268 [DebuggerHidden]269 private void SetStateMachine(IAsyncStateMachine stateMachine)270 {271 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);272 }273 }274275 [StructLayout((LayoutKind)3)]276 [CompilerGenerated]277 private struct _003COnSavingAsync_003Ed__3 : 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 ct;288289 public DialogTable _003C_003E4__this;290291 private DiffBuilder _003Cdiff_003E5__2;292293 private string _003CtableType_003E5__3;294295 private ISqlFormatter _003Cf_003E5__4;296297 private ConfiguredTaskAwaiter _003C_003Eu__1;298299 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__2;300301 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__3;302303 private void MoveNext()304 {305 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)306 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)307 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)308 //IL_0127: Unknown result type (might be due to invalid IL or missing references)309 //IL_012c: Unknown result type (might be due to invalid IL or missing references)310 //IL_0134: Unknown result type (might be due to invalid IL or missing references)311 //IL_01d8: Unknown result type (might be due to invalid IL or missing references)312 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)313 //IL_01e5: Unknown result type (might be due to invalid IL or missing references)314 //IL_0284: Unknown result type (might be due to invalid IL or missing references)315 //IL_0289: Unknown result type (might be due to invalid IL or missing references)316 //IL_0291: Unknown result type (might be due to invalid IL or missing references)317 //IL_03b1: Unknown result type (might be due to invalid IL or missing references)318 //IL_03b6: Unknown result type (might be due to invalid IL or missing references)319 //IL_03bd: Unknown result type (might be due to invalid IL or missing references)320 //IL_042a: Unknown result type (might be due to invalid IL or missing references)321 //IL_042f: Unknown result type (might be due to invalid IL or missing references)322 //IL_0437: Unknown result type (might be due to invalid IL or missing references)323 //IL_00da: Unknown result type (might be due to invalid IL or missing references)324 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)325 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)326 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)327 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)328 //IL_005a: Unknown result type (might be due to invalid IL or missing references)329 //IL_0065: Unknown result type (might be due to invalid IL or missing references)330 //IL_006a: Unknown result type (might be due to invalid IL or missing references)331 //IL_006e: Unknown result type (might be due to invalid IL or missing references)332 //IL_0073: Unknown result type (might be due to invalid IL or missing references)333 //IL_0237: Unknown result type (might be due to invalid IL or missing references)334 //IL_0246: Unknown result type (might be due to invalid IL or missing references)335 //IL_024b: Unknown result type (might be due to invalid IL or missing references)336 //IL_024f: Unknown result type (might be due to invalid IL or missing references)337 //IL_0254: Unknown result type (might be due to invalid IL or missing references)338 //IL_018b: Unknown result type (might be due to invalid IL or missing references)339 //IL_019a: Unknown result type (might be due to invalid IL or missing references)340 //IL_019f: Unknown result type (might be due to invalid IL or missing references)341 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)342 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)343 //IL_03e1: Unknown result type (might be due to invalid IL or missing references)344 //IL_03ec: Unknown result type (might be due to invalid IL or missing references)345 //IL_03f1: Unknown result type (might be due to invalid IL or missing references)346 //IL_03f5: Unknown result type (might be due to invalid IL or missing references)347 //IL_03fa: Unknown result type (might be due to invalid IL or missing references)348 //IL_010c: Unknown result type (might be due to invalid IL or missing references)349 //IL_010e: Unknown result type (might be due to invalid IL or missing references)350 //IL_0087: Unknown result type (might be due to invalid IL or missing references)351 //IL_0088: Unknown result type (might be due to invalid IL or missing references)352 //IL_0269: Unknown result type (might be due to invalid IL or missing references)353 //IL_026b: Unknown result type (might be due to invalid IL or missing references)354 //IL_01bd: Unknown result type (might be due to invalid IL or missing references)355 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)356 //IL_040f: Unknown result type (might be due to invalid IL or missing references)357 //IL_0411: Unknown result type (might be due to invalid IL or missing references)358 //IL_036a: Unknown result type (might be due to invalid IL or missing references)359 //IL_0375: Unknown result type (might be due to invalid IL or missing references)360 //IL_037a: Unknown result type (might be due to invalid IL or missing references)361 //IL_037e: Unknown result type (might be due to invalid IL or missing references)362 //IL_0383: Unknown result type (might be due to invalid IL or missing references)363 //IL_0397: Unknown result type (might be due to invalid IL or missing references)364 //IL_0398: Unknown result type (might be due to invalid IL or missing references)365 int num = _003C_003E1__state;366 DialogTable dialogTable = _003C_003E4__this;367 Diff result3;368 try369 {370 ConfiguredTaskAwaitable val4;371 ConfiguredTaskAwaiter val2;372 ConfiguredValueTaskAwaiter<string> val3;373 ConfiguredTaskAwaiter<Diff> val;374 string result;375 string text;376 string result2;377 switch (num)378 {379 default:380 if (entity.Columns["DefaultDisplayFKList"].IsDifferent)381 {382 val4 = _CheckDefaultDisplayFKListAsync(parameters.Session, entity, ct).ConfigureAwait(false);383 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();384 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)385 {386 num = (_003C_003E1__state = 0);387 _003C_003Eu__1 = val2;388 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val2, ref this);389 return;390 }391 goto IL_00bc;392 }393 goto IL_00c3;394 case 0:395 val2 = _003C_003Eu__1;396 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);397 num = (_003C_003E1__state = -1);398 goto IL_00bc;399 case 1:400 val3 = _003C_003Eu__2;401 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<string>);402 num = (_003C_003E1__state = -1);403 goto IL_0143;404 case 2:405 val3 = _003C_003Eu__2;406 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<string>);407 num = (_003C_003E1__state = -1);408 goto IL_01f4;409 case 3:410 val3 = _003C_003Eu__2;411 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<string>);412 num = (_003C_003E1__state = -1);413 goto IL_02a0;414 case 4:415 val2 = _003C_003Eu__1;416 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);417 num = (_003C_003E1__state = -1);418 goto IL_03cc;419 case 5:420 {421 val = _003C_003Eu__3;422 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<Diff>);423 num = (_003C_003E1__state = -1);424 break;425 }426 IL_01f4:427 result = val3.GetResult();428 text = _003Cf_003E5__4.CleanWhereClause(result);429 if (!string.Equals(result, text, (StringComparison)4))430 {431 _003Cdiff_003E5__2.AppendValue("ViewWhereClause", text);432 }433 goto IL_022b;434 IL_03d3:435 val = ((EntityLogicBase)dialogTable).OnSavingAsync(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();436 if (!val.IsCompleted)437 {438 num = (_003C_003E1__state = 5);439 _003C_003Eu__3 = val;440 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__3>(ref val, ref this);441 return;442 }443 break;444 IL_00bc:445 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();446 goto IL_00c3;447 IL_00c3:448 _003Cdiff_003E5__2 = new DiffBuilder();449 val3 = entity.GetValueAsync<string>("TableType", ct).ConfigureAwait(false).GetAwaiter();450 if (!val3.IsCompleted)451 {452 num = (_003C_003E1__state = 1);453 _003C_003Eu__2 = val3;454 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavingAsync_003Ed__3>(ref val3, ref this);455 return;456 }457 goto IL_0143;458 IL_022b:459 val3 = entity.GetValueAsync<string>("UsageType", ct).ConfigureAwait(false).GetAwaiter();460 if (!val3.IsCompleted)461 {462 num = (_003C_003E1__state = 3);463 _003C_003Eu__2 = val3;464 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavingAsync_003Ed__3>(ref val3, ref this);465 return;466 }467 goto IL_02a0;468 IL_0143:469 result2 = val3.GetResult();470 _003CtableType_003E5__3 = result2;471 _003Cf_003E5__4 = parameters.Session.SqlFormatter();472 if (_Eq(_003CtableType_003E5__3, "V"))473 {474 val3 = entity.GetValueAsync<string>("ViewWhereClause", ct).ConfigureAwait(false).GetAwaiter();475 if (!val3.IsCompleted)476 {477 num = (_003C_003E1__state = 2);478 _003C_003Eu__2 = val3;479 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavingAsync_003Ed__3>(ref val3, ref this);480 return;481 }482 goto IL_01f4;483 }484 goto IL_022b;485 IL_03cc:486 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();487 goto IL_03d3;488 IL_02a0:489 result2 = val3.GetResult().ToUpperInvariant();490 if (result2 == "MATERIAL" || result2 == "WORK" || result2 == "HISTORY")491 {492 _003Cdiff_003E5__2.AppendValue("IsTransportDisabled", true);493 }494 result2 = _003CtableType_003E5__3.ToUpperInvariant();495 if (result2 == "R" || result2 == "P" || result2 == "U" || result2 == "B")496 {497 _003Cdiff_003E5__2.AppendValue("IsTransportDisabled", true);498 }499 if (!parameters.Session.IsTransport())500 {501 val4 = _ConfigureColumns(entity, parameters, ct).ConfigureAwait(false);502 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();503 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)504 {505 num = (_003C_003E1__state = 4);506 _003C_003Eu__1 = val2;507 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val2, ref this);508 return;509 }510 goto IL_03cc;511 }512 goto IL_03d3;513 }514 result3 = val.GetResult().Concat(_003Cdiff_003E5__2.ToDiff());515 }516 catch (System.Exception exception)517 {518 _003C_003E1__state = -2;519 _003Cdiff_003E5__2 = null;520 _003CtableType_003E5__3 = null;521 _003Cf_003E5__4 = null;522 _003C_003Et__builder.SetException(exception);523 return;524 }525 _003C_003E1__state = -2;526 _003Cdiff_003E5__2 = null;527 _003CtableType_003E5__3 = null;528 _003Cf_003E5__4 = null;529 _003C_003Et__builder.SetResult(result3);530 }531532 [DebuggerHidden]533 private void SetStateMachine(IAsyncStateMachine stateMachine)534 {535 _003C_003Et__builder.SetStateMachine(stateMachine);536 }537 }538539 [StructLayout((LayoutKind)3)]540 [CompilerGenerated]541 private struct _003C_CheckDefaultDisplayFKListAsync_003Ed__6 : IAsyncStateMachine542 {543 public int _003C_003E1__state;544545 public AsyncTaskMethodBuilder _003C_003Et__builder;546547 public ISession session;548549 public IEntity entity;550551 public CancellationToken ct;552553 private string _003CfkList_003E5__2;554555 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;556557 private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__2;558559 private void MoveNext()560 {561 //IL_0082: Unknown result type (might be due to invalid IL or missing references)562 //IL_0087: Unknown result type (might be due to invalid IL or missing references)563 //IL_008e: Unknown result type (might be due to invalid IL or missing references)564 //IL_0103: Unknown result type (might be due to invalid IL or missing references)565 //IL_0108: Unknown result type (might be due to invalid IL or missing references)566 //IL_010f: Unknown result type (might be due to invalid IL or missing references)567 //IL_0179: Unknown result type (might be due to invalid IL or missing references)568 //IL_017e: Unknown result type (might be due to invalid IL or missing references)569 //IL_0186: Unknown result type (might be due to invalid IL or missing references)570 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)571 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)572 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)573 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)574 //IL_00d5: Unknown result type (might be due to invalid IL or missing references)575 //IL_0133: Unknown result type (might be due to invalid IL or missing references)576 //IL_013e: Unknown result type (might be due to invalid IL or missing references)577 //IL_0143: Unknown result type (might be due to invalid IL or missing references)578 //IL_0147: Unknown result type (might be due to invalid IL or missing references)579 //IL_014c: Unknown result type (might be due to invalid IL or missing references)580 //IL_0037: Unknown result type (might be due to invalid IL or missing references)581 //IL_0046: Unknown result type (might be due to invalid IL or missing references)582 //IL_004b: Unknown result type (might be due to invalid IL or missing references)583 //IL_004f: Unknown result type (might be due to invalid IL or missing references)584 //IL_0054: Unknown result type (might be due to invalid IL or missing references)585 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)586 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)587 //IL_0161: Unknown result type (might be due to invalid IL or missing references)588 //IL_0163: Unknown result type (might be due to invalid IL or missing references)589 //IL_0068: Unknown result type (might be due to invalid IL or missing references)590 //IL_0069: Unknown result type (might be due to invalid IL or missing references)591 int num = _003C_003E1__state;592 try593 {594 ConfiguredValueTaskAwaiter<string> val2;595 ConfiguredTaskAwaiter<IMetaTable> val;596 string result;597 string result2;598 switch (num)599 {600 default:601 if (!session.IsTransport())602 {603 val2 = entity.GetValueAsync<string>("DefaultDisplayFKList", ct).ConfigureAwait(false).GetAwaiter();604 if (!val2.IsCompleted)605 {606 num = (_003C_003E1__state = 0);607 _003C_003Eu__1 = val2;608 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckDefaultDisplayFKListAsync_003Ed__6>(ref val2, ref this);609 return;610 }611 goto IL_009d;612 }613 goto end_IL_0007;614 case 0:615 val2 = _003C_003Eu__1;616 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);617 num = (_003C_003E1__state = -1);618 goto IL_009d;619 case 1:620 val2 = _003C_003Eu__1;621 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);622 num = (_003C_003E1__state = -1);623 goto IL_011e;624 case 2:625 {626 val = _003C_003Eu__2;627 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTable>);628 num = (_003C_003E1__state = -1);629 break;630 }631 IL_009d:632 result = val2.GetResult();633 _003CfkList_003E5__2 = result;634 val2 = entity.GetValueAsync<string>("Tablename", ct).ConfigureAwait(false).GetAwaiter();635 if (!val2.IsCompleted)636 {637 num = (_003C_003E1__state = 1);638 _003C_003Eu__1 = val2;639 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckDefaultDisplayFKListAsync_003Ed__6>(ref val2, ref this);640 return;641 }642 goto IL_011e;643 IL_011e:644 result2 = val2.GetResult();645 val = session.MetaData().GetTableAsync(result2, ct).ConfigureAwait(false)646 .GetAwaiter();647 if (!val.IsCompleted)648 {649 num = (_003C_003E1__state = 2);650 _003C_003Eu__2 = val;651 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_CheckDefaultDisplayFKListAsync_003Ed__6>(ref val, ref this);652 return;653 }654 break;655 }656 _CheckMatch(val.GetResult(), _003CfkList_003E5__2);657 end_IL_0007:;658 }659 catch (System.Exception exception)660 {661 _003C_003E1__state = -2;662 _003CfkList_003E5__2 = null;663 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);664 return;665 }666 _003C_003E1__state = -2;667 _003CfkList_003E5__2 = null;668 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();669 }670671 [DebuggerHidden]672 private void SetStateMachine(IAsyncStateMachine stateMachine)673 {674 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);675 }676 }677678 [StructLayout((LayoutKind)3)]679 [CompilerGenerated]680 private struct _003C_Check_CacheInfo_003Ed__11 : IAsyncStateMachine681 {682 public int _003C_003E1__state;683684 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;685686 public int cacheInfo;687688 public IEntity entity;689690 public CancellationToken ct;691692 public ISession session;693694 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;695696 private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__2;697698 private void MoveNext()699 {700 //IL_007e: Unknown result type (might be due to invalid IL or missing references)701 //IL_0083: Unknown result type (might be due to invalid IL or missing references)702 //IL_008b: Unknown result type (might be due to invalid IL or missing references)703 //IL_00af: Unknown result type (might be due to invalid IL or missing references)704 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)705 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)706 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)707 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)708 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)709 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)710 //IL_0102: Unknown result type (might be due to invalid IL or missing references)711 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)712 //IL_00df: Unknown result type (might be due to invalid IL or missing references)713 //IL_0031: Unknown result type (might be due to invalid IL or missing references)714 //IL_0040: Unknown result type (might be due to invalid IL or missing references)715 //IL_0045: Unknown result type (might be due to invalid IL or missing references)716 //IL_0049: Unknown result type (might be due to invalid IL or missing references)717 //IL_004e: Unknown result type (might be due to invalid IL or missing references)718 //IL_0063: Unknown result type (might be due to invalid IL or missing references)719 //IL_0065: Unknown result type (might be due to invalid IL or missing references)720 int num = _003C_003E1__state;721 bool result;722 try723 {724 ConfiguredValueTaskAwaiter<string> val;725 if (num == 0)726 {727 val = _003C_003Eu__1;728 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);729 num = (_003C_003E1__state = -1);730 goto IL_009a;731 }732 ConfiguredTaskAwaiter<IMetaTable> val2;733 if (num == 1)734 {735 val2 = _003C_003Eu__2;736 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTable>);737 num = (_003C_003E1__state = -1);738 goto IL_0111;739 }740 int num2 = 32;741 if ((cacheInfo & num2) != 0)742 {743 val = entity.GetValueAsync<string>("Tablename", ct).ConfigureAwait(false).GetAwaiter();744 if (!val.IsCompleted)745 {746 num = (_003C_003E1__state = 0);747 _003C_003Eu__1 = val;748 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_Check_CacheInfo_003Ed__11>(ref val, ref this);749 return;750 }751 goto IL_009a;752 }753 result = true;754 goto end_IL_0007;755 IL_0111:756 if (!val2.GetResult().Columns.Contains("UID_DialogUser"))757 {758 throw new ViException(882549, ExceptionRelevance.EndUser);759 }760 result = true;761 goto end_IL_0007;762 IL_009a:763 string result2 = val.GetResult();764 val2 = session.MetaData().GetTableAsync(result2, ct).ConfigureAwait(false)765 .GetAwaiter();766 if (!val2.IsCompleted)767 {768 num = (_003C_003E1__state = 1);769 _003C_003Eu__2 = val2;770 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_Check_CacheInfo_003Ed__11>(ref val2, ref this);771 return;772 }773 goto IL_0111;774 end_IL_0007:;775 }776 catch (System.Exception exception)777 {778 _003C_003E1__state = -2;779 _003C_003Et__builder.SetException(exception);780 return;781 }782 _003C_003E1__state = -2;783 _003C_003Et__builder.SetResult(result);784 }785786 [DebuggerHidden]787 private void SetStateMachine(IAsyncStateMachine stateMachine)788 {789 _003C_003Et__builder.SetStateMachine(stateMachine);790 }791 }792793 [StructLayout((LayoutKind)3)]794 [CompilerGenerated]795 private struct _003C_ConfigureColumns_003Ed__4 : IAsyncStateMachine796 {797 public int _003C_003E1__state;798799 public AsyncTaskMethodBuilder _003C_003Et__builder;800801 public IEntity entity;802803 public LogicReadWriteParameters parameters;804805 public CancellationToken ct;806807 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;808809 private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap1;810811 private IEntity _003CeColumn_003E5__3;812813 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__2;814815 private ConfiguredTaskAwaiter _003C_003Eu__3;816817 private void MoveNext()818 {819 //IL_010b: Unknown result type (might be due to invalid IL or missing references)820 //IL_0110: Unknown result type (might be due to invalid IL or missing references)821 //IL_0118: Unknown result type (might be due to invalid IL or missing references)822 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)823 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)824 //IL_01d7: Unknown result type (might be due to invalid IL or missing references)825 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)826 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)827 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)828 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)829 //IL_00db: Unknown result type (might be due to invalid IL or missing references)830 //IL_0201: Unknown result type (might be due to invalid IL or missing references)831 //IL_020c: Unknown result type (might be due to invalid IL or missing references)832 //IL_0211: Unknown result type (might be due to invalid IL or missing references)833 //IL_0215: Unknown result type (might be due to invalid IL or missing references)834 //IL_021a: Unknown result type (might be due to invalid IL or missing references)835 //IL_024a: Unknown result type (might be due to invalid IL or missing references)836 //IL_024f: Unknown result type (might be due to invalid IL or missing references)837 //IL_0257: Unknown result type (might be due to invalid IL or missing references)838 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)839 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)840 //IL_022f: Unknown result type (might be due to invalid IL or missing references)841 //IL_0231: Unknown result type (might be due to invalid IL or missing references)842 //IL_017d: Unknown result type (might be due to invalid IL or missing references)843 //IL_018c: Unknown result type (might be due to invalid IL or missing references)844 //IL_0191: Unknown result type (might be due to invalid IL or missing references)845 //IL_0195: Unknown result type (might be due to invalid IL or missing references)846 //IL_019a: Unknown result type (might be due to invalid IL or missing references)847 //IL_01af: Unknown result type (might be due to invalid IL or missing references)848 //IL_01b1: Unknown result type (might be due to invalid IL or missing references)849 int num = _003C_003E1__state;850 try851 {852 ConfiguredTaskAwaiter<IEntityCollection> val;853 if (num == 0)854 {855 val = _003C_003Eu__1;856 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);857 num = (_003C_003E1__state = -1);858 goto IL_0127;859 }860 if ((uint)(num - 1) <= 1u)861 {862 goto IL_013c;863 }864 _003C_003Ec__DisplayClass4_0 CS_0024_003C_003E8__locals4 = new _003C_003Ec__DisplayClass4_0865 {866 entity = entity867 };868 if (CS_0024_003C_003E8__locals4.entity.Columns.ChangedAny("IsMNTable", "IsMAllTable") && (CS_0024_003C_003E8__locals4.entity.Columns["IsMNTable"].GetValue<bool>() || CS_0024_003C_003E8__locals4.entity.Columns["IsMAllTable"].GetValue<bool>()))869 {870 Query query = (from c in Query.From("DialogColumn")871 where c.Column("UID_DialogTable") == CS_0024_003C_003E8__locals4.entity.Columns["UID_DialogTable"].GetValue<string>() && c.Column("IndexWeight") > 0872 select c).SelectAll();873 val = parameters.Session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Bulk, ct).ConfigureAwait(false)874 .GetAwaiter();875 if (!val.IsCompleted)876 {877 num = (_003C_003E1__state = 0);878 _003C_003Eu__1 = val;879 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_ConfigureColumns_003Ed__4>(ref val, ref this);880 return;881 }882 goto IL_0127;883 }884 goto end_IL_0007;885 IL_0127:886 IEntityCollection result = val.GetResult();887 _003C_003E7__wrap1 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();888 goto IL_013c;889 IL_013c:890 try891 {892 ConfiguredTaskAwaiter val2;893 if (num != 1)894 {895 if (num != 2)896 {897 goto IL_0274;898 }899 val2 = _003C_003Eu__3;900 _003C_003Eu__3 = default(ConfiguredTaskAwaiter);901 num = (_003C_003E1__state = -1);902 goto IL_0266;903 }904 ConfiguredValueTaskAwaiter<ApplyResult> val3 = _003C_003Eu__2;905 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<ApplyResult>);906 num = (_003C_003E1__state = -1);907 goto IL_01e6;908 IL_0266:909 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();910 _003CeColumn_003E5__3 = null;911 goto IL_0274;912 IL_0274:913 if (((System.Collections.IEnumerator)_003C_003E7__wrap1).MoveNext())914 {915 _003CeColumn_003E5__3 = _003C_003E7__wrap1.Current;916 val3 = _003CeColumn_003E5__3.Columns["IndexWeight"].SetValueAsync(0, SetValueBehavior.Default, ct).ConfigureAwait(false).GetAwaiter();917 if (!val3.IsCompleted)918 {919 num = (_003C_003E1__state = 1);920 _003C_003Eu__2 = val3;921 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_ConfigureColumns_003Ed__4>(ref val3, ref this);922 return;923 }924 goto IL_01e6;925 }926 goto end_IL_013c;927 IL_01e6:928 val3.GetResult();929 ConfiguredTaskAwaitable val4 = parameters.UnitOfWork.PutAsync(_003CeColumn_003E5__3, null, ct).ConfigureAwait(false);930 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();931 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)932 {933 num = (_003C_003E1__state = 2);934 _003C_003Eu__3 = val2;935 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_ConfigureColumns_003Ed__4>(ref val2, ref this);936 return;937 }938 goto IL_0266;939 end_IL_013c:;940 }941 finally942 {943 if (num < 0 && _003C_003E7__wrap1 != null)944 {945 ((System.IDisposable)_003C_003E7__wrap1).Dispose();946 }947 }948 _003C_003E7__wrap1 = null;949 end_IL_0007:;950 }951 catch (System.Exception exception)952 {953 _003C_003E1__state = -2;954 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);955 return;956 }957 _003C_003E1__state = -2;958 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();959 }960961 [DebuggerHidden]962 private void SetStateMachine(IAsyncStateMachine stateMachine)963 {964 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);965 }966 }967968 private static readonly Regex _regFk = new Regex("^\\s*(\\((?<Alternate>[^)]+)\\)|(?<FK>\\w+)\\s*(\\[\\s*(?<Parent>\\w+)\\s*\\])?\\s*,?)", (RegexOptions)521);969970 private static readonly Regex _regInvalidUidChars = new Regex("[^0-9a-zA-Z-]", (RegexOptions)520);971972 public DialogTable()973 {974 RegisterExpensive("_OriginalValues").As<OriginalValues>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<OriginalValues>>)OriginalValues.GetAsync);975 RegisterExpensive("_HasXOrigin").As<bool>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<bool>>)([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_0_003Ed))] async (ISession session, IEntity entity, CancellationToken ct) =>976 {977 //IL_0002: Unknown result type (might be due to invalid IL or missing references)978 //IL_0007: Unknown result type (might be due to invalid IL or missing references)979 //IL_001e: Unknown result type (might be due to invalid IL or missing references)980 //IL_001f: Unknown result type (might be due to invalid IL or missing references)981 TryResult<IMetaTable> tryResult = await session.MetaData().TryGetTableAsync(entity.GetValue<string>("Tablename"), ct).ConfigureAwait(false);982 return tryResult.Success && tryResult.Result.Columns.IsAvailable("xorigin");983 }));984 CanEdit("CountRows").Default(value: false);985 CanEdit("SizeMB").Default(value: false);986 CanEdit("BaseRecordLen").Default(value: false);987 CanEdit("IsDeactivatedByPreProcessor").Default(value: false);988 CanEdit("Tablename", "TableType").From("[IsLoaded]").As<bool>((Func<bool, bool>)((bool l) => !l));989 Func<string, bool> isV = (string t) => _Eq(t, "V");990 Func<string, bool> isB = (string t) => _Eq(t, "B");991 CanEdit("InsertValues").From("TableType").As<string>(isV).ClearValueOnFalse();992 MinLen("InsertValues").From("TableType", "FK(UID_DialogTableBase).TableType", "IsMNTable").As<string, string, bool>((Func<string, string, bool, int>)((string tt, string bt, bool mn) => (!mn && isV.Invoke(tt) && isB.Invoke(bt)) ? 1 : 0));993 CanEdit("SelectScript").From("TableType").As<string>(isV).ClearValueOnFalse();994 MinLen("SelectScript").From("TableType", "FK(UID_DialogTableBase).TableType", "IsMNTable").As<string, string, bool>((Func<string, string, bool, int>)((string tt, string bt, bool mn) => (!mn && isV.Invoke(tt) && isB.Invoke(bt)) ? 1 : 0));995 CanEdit("ViewWhereClause").From("TableType").As<string>((Func<string, bool>)((string t) => _Eq(t, "V") || _Eq(t, "P") || _Eq(t, "R"))).ClearValueOnFalse();996 MinLen("ViewWhereClause").From("TableType").As<string>((Func<string, int>)((string t) => _Eq(t, "V") ? 1 : 0));997 CanEdit("UID_DialogTableBase").From("TableType").As<string>(isV).ClearValueOnFalse()998 .MandatoryWhenEnabled();999 CanEdit("IsAssignmentWithEvent").From("IsMNTable", "IsMAllTable", "TableType").As<bool, bool, string>((Func<bool, bool, string, bool>)((bool mn, bool ma, string tt) => (mn || ma) && (_Eq(tt, "T") || _Eq(tt, "V")))).ClearValueOnFalse();1000 CanEdit("IsResident").From("IsResident", "CountRows", "Config(Common\\ResidentTableLimit)").As<bool, int, string>((Func<bool, int, string, bool>)delegate(bool r, int cr, string rtl)1001 {1002 int num = ((!string.IsNullOrEmpty(rtl)) ? DbVal.ConvertTo<int>(rtl) : 2147483647);1003 return r || cr <= num;1004 });1005 CanEdit("IsModuleGUIDAllowed").From("IsModuleGUIDAllowed", "IsModuleGUIDAllowed[O]", "_OriginalValues").As<bool, bool, OriginalValues>((Func<bool, bool, OriginalValues, bool>)((bool value, bool old, OriginalValues originals) => !value || !old || originals.Values.ContainsKey("IsModuleGUIDAllowed")));1006 CanEdit("IsModuleGUIDDefault").From("IsModuleGUIDAllowed", "IsModuleGUIDDefault", "IsModuleGUIDDefault[O]", "_OriginalValues", "SPECIAL(InModuleMaster)").As<bool, bool, bool, OriginalValues, bool>((Func<bool, bool, bool, OriginalValues, bool, bool>)((bool allowed, bool value, bool old, OriginalValues originals, bool master) => allowed && (!value || !old || originals.Values.ContainsKey("IsModuleGUIDDefault") || master))).ClearValueOnFalse();1007 Value("UID_DialogTable").Except("[IsLoaded]", "SPECIAL(IsTransport)").From("Tablename", "UID_DialogTable", "SPECIAL(Module)").As<string, string, string, TryResult<string>>((string tn, string uid, string mn) => string.IsNullOrEmpty(tn) ? TryResult<string>.Failed : TryResult.FromResult(string.Format("{0}-T-{1}", (object)mn, (object)_regInvalidUidChars.Replace(tn, ""))));1008 CanEdit("DeleteDelayDays", "DeleteDelayScript").From("IsMNTable", "IsMAllTable", "_HasXOrigin").As<bool, bool, bool>((Func<bool, bool, bool, bool>)((bool isMn, bool isMall, bool hasXOrigin) => !((isMn || isMall) && hasXOrigin))).ClearValueOnFalse();1009 Check("UID_DialogTableBase").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_14_003Ed))] async (ISession s, IEntity e, string v, CancellationToken ct) =>1010 {1011 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1012 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1013 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1014 //IL_0020: Unknown result type (might be due to invalid IL or missing references)1015 if (string.IsNullOrEmpty(v))1016 {1017 return true;1018 }1019 string whereclause = s.SqlFormatter().UidComparison("UID_DialogTable", v);1020 if (string.Equals(await s.Source().GetSingleValueAsync<string>("DialogTable", "TableType", whereclause, ct).ConfigureAwait(false), "B", (StringComparison)5))1021 {1022 return true;1023 }1024 throw new ViException(882117, ExceptionRelevance.EndUser);1025 }));1026 Check("UID_DialogTableUnion").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_15_003Ed))] async (ISession s, IEntity e, string v, CancellationToken ct) =>1027 {1028 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1029 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1030 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1031 //IL_0020: Unknown result type (might be due to invalid IL or missing references)1032 if (string.IsNullOrEmpty(v))1033 {1034 return true;1035 }1036 IEntitySource src = s.Source();1037 ISqlFormatter formatter = s.SqlFormatter();1038 if (!_Eq(await src.GetSingleValueAsync<string>("DialogTable", "TableType", formatter.UidComparison("UID_DialogTable", v), ct).ConfigureAwait(false), "P"))1039 {1040 IEntity entity = await src.GetAsync(new DbObjectKey("DialogTable", v), EntityLoadType.ReadOnly, ct).ConfigureAwait(false);1041 throw new ViException(882006, ExceptionRelevance.EndUser, entity.Display);1042 }1043 return true;1044 }));1045 Check("ViewWhereClause").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)delegate(ISession s, IEntity e, string v, CancellationToken ct)1046 {1047 s.SqlFormatter().CheckStatement(v, SqlKeyWordFlags.DQL);1048 return System.Threading.Tasks.Task.FromResult<bool>(true);1049 });1050 Check("ScopeReferenceColumns").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_17_003Ed))] async (ISession s, IEntity e, string v, CancellationToken ct) =>1051 {1052 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1053 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1054 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1055 //IL_0028: Unknown result type (might be due to invalid IL or missing references)1056 if (string.IsNullOrEmpty(v))1057 {1058 return true;1059 }1060 global::_003C_003Ey__InlineArray2<char> buffer = default(global::_003C_003Ey__InlineArray2<char>);1061 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<char>, char>(ref buffer, 0) = ',';1062 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<char>, char>(ref buffer, 1) = MultiValueProperty.DefaultSeparator;1063 string[] parts = Enumerable.ToArray<string>((System.Collections.Generic.IEnumerable<string>)v.Split(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray2<char>, char>(in buffer, 2)));1064 Query query = (from t in Query.From("DialogColumn")1065 where t.Column("UID_DialogTable") == e.GetValue<string>("UID_DialogTable") && t.Column("Columnname").In(parts)1066 select t).Select("Columnname", "IsForeignKey", "IsDynamicFK");1067 IEntityCollection entityCollection = await s.Source().GetCollectionAsync(query, ct).ConfigureAwait(false);1068 string[] array = parts;1069 foreach (string part in array)1070 {1071 IEntity entity = Enumerable.FirstOrDefault<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)entityCollection, (Func<IEntity, bool>)((IEntity en) => string.Equals(part, en.GetValue<string>("Columnname"), (StringComparison)5)));1072 if (entity == null)1073 {1074 throw new ViException(882148, ExceptionRelevance.EndUser, e.GetValue<string>("Tablename"), part);1075 }1076 if (!entity.GetValue<bool>("IsForeignKey") && !entity.GetValue<bool>("IsDynamicFK"))1077 {1078 throw new ViException(882167, ExceptionRelevance.EndUser);1079 }1080 }1081 return true;1082 })).DependsOn("UID_DialogTable", "Tablename");1083 Event("ExecuteTemplates").CustomGenerated();1084 RegisterMethod("ExecuteTemplates").As<bool>([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_18_003Ed))] (ISession s, IEntity e, bool updateAll, CancellationToken ct) =>1085 {1086 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1087 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1088 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1089 //IL_0028: Unknown result type (might be due to invalid IL or missing references)1090 _003C_003Ec._003C_003C_002Dctor_003Eb__2_18_003Ed _003C_003C_002Dctor_003Eb__2_18_003Ed = default(_003C_003Ec._003C_003C_002Dctor_003Eb__2_18_003Ed);1091 _003C_003C_002Dctor_003Eb__2_18_003Ed._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1092 _003C_003C_002Dctor_003Eb__2_18_003Ed.s = s;1093 _003C_003C_002Dctor_003Eb__2_18_003Ed.e = e;1094 _003C_003C_002Dctor_003Eb__2_18_003Ed.updateAll = updateAll;1095 _003C_003C_002Dctor_003Eb__2_18_003Ed.ct = ct;1096 _003C_003C_002Dctor_003Eb__2_18_003Ed._003C_003E1__state = -1;1097 ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__2_18_003Ed._003C_003Et__builder)).Start<_003C_003Ec._003C_003C_002Dctor_003Eb__2_18_003Ed>(ref _003C_003C_002Dctor_003Eb__2_18_003Ed);1098 return ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__2_18_003Ed._003C_003Et__builder)).Task;1099 }).Behavior(MethodBehavior.ChangesExternalState).Description("Method_DialogTable_ExecuteTemplates");1100 Check("CacheInfo").AsExpensive<int>((Func<ISession, IEntity, int, CancellationToken, System.Threading.Tasks.Task<bool>>)_Check_CacheInfo);1101 }11021103 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__3))]1104 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1105 {1106 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1107 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1108 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1109 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1110 if (entity.Columns["DefaultDisplayFKList"].IsDifferent)1111 {1112 await _CheckDefaultDisplayFKListAsync(parameters.Session, entity, ct).ConfigureAwait(false);1113 }1114 DiffBuilder diff = new DiffBuilder();1115 string tableType = await entity.GetValueAsync<string>("TableType", ct).ConfigureAwait(false);1116 ISqlFormatter f = parameters.Session.SqlFormatter();1117 if (_Eq(tableType, "V"))1118 {1119 string text = await entity.GetValueAsync<string>("ViewWhereClause", ct).ConfigureAwait(false);1120 string text2 = f.CleanWhereClause(text);1121 if (!string.Equals(text, text2, (StringComparison)4))1122 {1123 diff.AppendValue("ViewWhereClause", text2);1124 }1125 }1126 string text3 = (await entity.GetValueAsync<string>("UsageType", ct).ConfigureAwait(false)).ToUpperInvariant();1127 if (text3 == "MATERIAL" || text3 == "WORK" || text3 == "HISTORY")1128 {1129 diff.AppendValue("IsTransportDisabled", true);1130 }1131 text3 = tableType.ToUpperInvariant();1132 if (text3 == "R" || text3 == "P" || text3 == "U" || text3 == "B")1133 {1134 diff.AppendValue("IsTransportDisabled", true);1135 }1136 if (!parameters.Session.IsTransport())1137 {1138 await _ConfigureColumns(entity, parameters, ct).ConfigureAwait(false);1139 }1140 return (await base.OnSavingAsync(entity, parameters, ct).ConfigureAwait(false)).Concat(diff.ToDiff());1141 }11421143 [AsyncStateMachine(typeof(_003C_ConfigureColumns_003Ed__4))]1144 private static System.Threading.Tasks.Task _ConfigureColumns(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1145 {1146 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1147 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1148 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1149 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1150 _003C_ConfigureColumns_003Ed__4 _003C_ConfigureColumns_003Ed__ = default(_003C_ConfigureColumns_003Ed__4);1151 _003C_ConfigureColumns_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1152 _003C_ConfigureColumns_003Ed__.entity = entity;1153 _003C_ConfigureColumns_003Ed__.parameters = parameters;1154 _003C_ConfigureColumns_003Ed__.ct = ct;1155 _003C_ConfigureColumns_003Ed__._003C_003E1__state = -1;1156 ((AsyncTaskMethodBuilder)(ref _003C_ConfigureColumns_003Ed__._003C_003Et__builder)).Start<_003C_ConfigureColumns_003Ed__4>(ref _003C_ConfigureColumns_003Ed__);1157 return ((AsyncTaskMethodBuilder)(ref _003C_ConfigureColumns_003Ed__._003C_003Et__builder)).Task;1158 }11591160 [AsyncStateMachine(typeof(_003COnSavedAsync_003Ed__5))]1161 public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1162 {1163 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1164 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1165 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1166 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1167 _003COnSavedAsync_003Ed__5 _003COnSavedAsync_003Ed__ = default(_003COnSavedAsync_003Ed__5);1168 _003COnSavedAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1169 _003COnSavedAsync_003Ed__._003C_003E4__this = this;1170 _003COnSavedAsync_003Ed__.entity = entity;1171 _003COnSavedAsync_003Ed__.parameters = parameters;1172 _003COnSavedAsync_003Ed__.ct = ct;1173 _003COnSavedAsync_003Ed__._003C_003E1__state = -1;1174 ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Start<_003COnSavedAsync_003Ed__5>(ref _003COnSavedAsync_003Ed__);1175 return ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Task;1176 }11771178 [AsyncStateMachine(typeof(_003C_CheckDefaultDisplayFKListAsync_003Ed__6))]1179 private static System.Threading.Tasks.Task _CheckDefaultDisplayFKListAsync(ISession session, IEntity entity, CancellationToken ct)1180 {1181 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1182 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1183 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1184 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1185 _003C_CheckDefaultDisplayFKListAsync_003Ed__6 _003C_CheckDefaultDisplayFKListAsync_003Ed__ = default(_003C_CheckDefaultDisplayFKListAsync_003Ed__6);1186 _003C_CheckDefaultDisplayFKListAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1187 _003C_CheckDefaultDisplayFKListAsync_003Ed__.session = session;1188 _003C_CheckDefaultDisplayFKListAsync_003Ed__.entity = entity;1189 _003C_CheckDefaultDisplayFKListAsync_003Ed__.ct = ct;1190 _003C_CheckDefaultDisplayFKListAsync_003Ed__._003C_003E1__state = -1;1191 ((AsyncTaskMethodBuilder)(ref _003C_CheckDefaultDisplayFKListAsync_003Ed__._003C_003Et__builder)).Start<_003C_CheckDefaultDisplayFKListAsync_003Ed__6>(ref _003C_CheckDefaultDisplayFKListAsync_003Ed__);1192 return ((AsyncTaskMethodBuilder)(ref _003C_CheckDefaultDisplayFKListAsync_003Ed__._003C_003Et__builder)).Task;1193 }11941195 private static void _CheckMatch(IMetaTable table, string fkList)1196 {1197 fkList = fkList.Trim();1198 if (string.IsNullOrEmpty(fkList))1199 {1200 return;1201 }1202 Match val = _regFk.Match(fkList);1203 if (!((Group)val).Success)1204 {1205 ViException innerException = new ViException(882149, ExceptionRelevance.EndUser, fkList);1206 throw new ViException(882147, ExceptionRelevance.EndUser, (System.Exception)(object)innerException, "DefaultDisplayFKList");1207 }1208 string value = ((Capture)val.Groups["Alternate"]).Value;1209 if (value.Length > 0)1210 {1211 string[] array = value.Split("|".ToCharArray(), (StringSplitOptions)1);1212 foreach (string fkList2 in array)1213 {1214 _CheckMatch(table, fkList2);1215 }1216 return;1217 }1218 string value2 = ((Capture)val.Groups["FK"]).Value;1219 string value3 = ((Capture)val.Groups["Parent"]).Value;1220 fkList = fkList.Substring(((Capture)val).Value.Length).TrimStart(',');1221 if (!table.Columns.TryGetValue(value2, out var value4))1222 {1223 ViException innerException2 = new ViException(882148, ExceptionRelevance.EndUser, table.Tablename, value2);1224 throw new ViException(882147, ExceptionRelevance.EndUser, (System.Exception)(object)innerException2, "DefaultDisplayFKList");1225 }1226 if (!value4.IsFK)1227 {1228 if (fkList.Length <= 0)1229 {1230 return;1231 }1232 throw new ViException(882147, ExceptionRelevance.EndUser, "DefaultDisplayFKList");1233 }1234 table = value4.GetFKRelation().GetParentTable();1235 if (!string.IsNullOrEmpty(value3) && !table.Columns.Contains(value3))1236 {1237 ViException innerException3 = new ViException(882148, ExceptionRelevance.EndUser, table.Tablename, value3);1238 throw new ViException(882147, ExceptionRelevance.EndUser, (System.Exception)(object)innerException3, "DefaultDisplayFKList");1239 }1240 _CheckMatch(table, fkList);1241 }12421243 public static bool ProcessWatchDenied(string tablename)1244 {1245 return Enumerable.Any<string>((System.Collections.Generic.IEnumerable<string>)new string[19]1246 {1247 "DIALOGDBQUEUE", "DIALOGDBQUEUECURRENT", "DIALOGPROCESS", "DIALOGPROCESSCHAIN", "DIALOGPROCESSSTEP", "DIALOGPROCESSSUBSTITUTE", "JOBQUEUE", "JOBHISTORY", "DIALOGNOTIFICATION", "DIALOGSEMAPHOR",1248 "DIALOGSECURITYHISTORY", "DIALOGWATCH", "DIALOGMULTILANGUAGE", "DIALOGDBSCHEDULERTASK", "QBMCUSTOMSQL", "DIALOGCALENDAR", "JOBQUEUESTATS", "JOBTREEPARAMCOLL", "JOBPERFORMANCE"1249 }, (Func<string, bool>)((string t) => _Eq(t, tablename)));1250 }12511252 public static bool IsReadOnlyTableType(string tt)1253 {1254 if (!_Eq(tt, "P") && !_Eq(tt, "R"))1255 {1256 return _Eq(tt, "U");1257 }1258 return true;1259 }12601261 public static bool _Eq(string a, string b)1262 {1263 return string.Equals(a, b, (StringComparison)5);1264 }12651266 [AsyncStateMachine(typeof(_003C_Check_CacheInfo_003Ed__11))]1267 private async System.Threading.Tasks.Task<bool> _Check_CacheInfo(ISession session, IEntity entity, int cacheInfo, CancellationToken ct)1268 {1269 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1270 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1271 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1272 //IL_0028: Unknown result type (might be due to invalid IL or missing references)1273 int num = 32;1274 if ((cacheInfo & num) == 0)1275 {1276 return true;1277 }1278 string tablename = await entity.GetValueAsync<string>("Tablename", ct).ConfigureAwait(false);1279 if (!(await session.MetaData().GetTableAsync(tablename, ct).ConfigureAwait(false)).Columns.Contains("UID_DialogUser"))1280 {1281 throw new ViException(882549, ExceptionRelevance.EndUser);1282 }1283 return true;1284 }1285}1286