ATT.Forms/ATT.Forms/FormAttestationPolicyMasterData.cs
Decompiler Source FileATT.Forms.FormAttestationPolicyMasterDataDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- CallMethod: Delete at line 261
- CallMethod: GetWhereClause at line 300
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.
references DB/Dialog objects
Summary: classes FormAttestationPolicyMasterData; methods OnInit, OnDesignChanged, InitializeComponent, OnFormLoad, OnFormUnload, Task_DeletePolicy; references AERole, AttestationObject, AttestationObjectHasPWODM, AttestationPolicy, AttestationPolicyGroup, DialogSchedule; markers references DB/Dialog objects
Classes
FormAttestationPolicyMasterDataMethods
- OnInit
- OnDesignChanged
- InitializeComponent
- OnFormLoad
- OnFormUnload
- Task_DeletePolicy
- Task_AdHocAttestation
- Task_ShowResult
- GetTableName
- OnFormSizeChanged
- MainActivator_OnActivating
- ButtonSQLWizard_Click
- ObjectChangeComponent_ColumnValueChanged
- _HandleSqlWizardButton
- TaskShowCondition
- TaskHideCondition
- _AdaptTasks
- ObjectChangeComponent_ObjectEventOccurred
DB/Dialog object references
OIM key/entity markers
UID_DialogTableBelongsTo UID_ParentAERole UID_AttestationObject UID_DialogTable ObjectKeyReport UID_PWODecisionMethodAPI/entity calls
MetaData User From Source Config Comparison UidComparisonRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Drawing;5using System.Runtime.CompilerServices;6using System.Text;7using System.Windows.Forms;8using VI.AE.Forms.Base;9using VI.Base;10using VI.Controls;11using VI.Controls.Design;12using VI.Controls.Interfaces;13using VI.DB;14using VI.DB.Entities;15using VI.DB.MetaData;16using VI.DB.Sync;17using VI.FormBase;18using VI.FormBase.Tasks;19using VI.FormCustomizers;20using VI.FormTools;21using VI.ImageLibrary;22using VI.SqlWizard;23using VI.UI.Base;24using VI.UI.Base.SnapIns;25using VI.UI.Controls.Common;2627namespace ATT.Forms;2829public class FormAttestationPolicyMasterData : BaseCustomizer30{31 private bool _objectCreation;3233 private IActivatorComponent m_MainActivator;3435 private VI.Controls.Interfaces.IButton m_ButtonSQLWizard;3637 private ICheckBox m_CheckBoxIsApproveRequiresMfa;3839 private ICheckBox m_CheckBoxIsAutoCloseOldCases;4041 private ICheckBox m_CheckBoxIsInActive;4243 private ICheckBox m_CheckBoxIsNoRunOnEmptyResult;4445 private ICheckBox m_CheckBoxIsSetApprovalStateOnApproved;4647 private ICheckBox m_CheckBoxIsSetApprovalStateOnDenied;4849 private ICheckBox m_CheckBoxIsShowElementsInvolved;5051 private ICheckBox m_CheckBoxIsSingleCaseNotification;5253 private IDBSyntaxEdit m_SyntaxEditWhereClause;5455 private IDBSyntaxEdit m_SyntaxEditWhereClauseOra;5657 private IEdit m_EditDefaultReasonAutomation;5859 private IEdit m_EditDescription;6061 private IEdit m_EditIdentAttestationPolicy;6263 private IEdit m_EditLimitOfOldCases;6465 private IEdit m_EditResult;6667 private IEdit m_EditSolutionDays;6869 private IFormDialogComponent m_FormDialogComponent;7071 private IMultiValueEdit m_MultiValueEditReportParameter;7273 private INetLabel m_LabelWhereClauseMetaHint;7475 private INewObjectButton m_NewObjectButtonAERoleOwner;7677 private INewObjectButton m_NewObjectButtonPayLoadSchedule;7879 private INewObjectButton m_NewObjectButtonPickCategory;8081 private INewObjectButton m_NewObjectButtonQERTermsOfUse;8283 private VI.Controls.Interfaces.ITabControl m_CustomTab1;8485 private VI.Controls.Interfaces.ITabPage m_TabPage_00;8687 private VI.Controls.Interfaces.ITabPage m_TabPageResultList;8889 private ITextComboBox m_TextComboBoxApproveReasonType;9091 private ITextComboBox m_TextComboBoxDenyReasonType;9293 private ITextComboBox m_TextComboBoxReportType;9495 private ITrackBar m_TrackBarRiskIndex;9697 private ITrackBar m_TrackBarRiskIndexReduced;9899 private ITreeComboBox m_TreeComboBoxUIDDialogSchedule;100101 private ITreeComboBox m_TreeComboBoxUIDQERTermsOfUse;102103 private ITreeComboBox m_TreeComboUIDAERoleOwner;104105 private ITreeComboBox m_TreeComboUIDAttestationObject;106107 private ITreeComboBox m_TreeComboUIDAttestationPolicyGroup;108109 private ITreeComboBox m_TreeComboUIDDialogCulture;110111 private ITreeComboBox m_TreeComboUIDPersonOwner;112113 private ITreeComboBox m_TreeComboUIDPWODecisionMethod;114115 private ITreeComboBox m_TreeComboUIDQERPickCategory;116117 private IVIPanel m_MainPanel;118119 private IObjectChangeComponent m_ObjectChangeComponent;120121 private StockImageComponent m_StockImageComponent;122123 protected override void OnInit()124 {125 //IL_048c: Unknown result type (might be due to invalid IL or missing references)126 base.OnInit();127 try128 {129 m_ButtonSQLWizard = base.Form.GetControl<VI.Controls.Interfaces.IButton>("ButtonSQLWizard");130 m_CheckBoxIsApproveRequiresMfa = base.Form.GetControl<ICheckBox>("CheckBoxIsApproveRequiresMfa");131 m_CheckBoxIsAutoCloseOldCases = base.Form.GetControl<ICheckBox>("CheckBoxIsAutoCloseOldCases");132 m_CheckBoxIsInActive = base.Form.GetControl<ICheckBox>("CheckBoxIsInActive");133 m_CheckBoxIsNoRunOnEmptyResult = base.Form.GetControl<ICheckBox>("CheckBoxIsNoRunOnEmptyResult");134 m_CheckBoxIsSetApprovalStateOnApproved = base.Form.GetControl<ICheckBox>("CheckBoxIsSetApprovalStateOnApproved");135 m_CheckBoxIsSetApprovalStateOnDenied = base.Form.GetControl<ICheckBox>("CheckBoxIsSetApprovalStateOnDenied");136 m_CheckBoxIsShowElementsInvolved = base.Form.GetControl<ICheckBox>("CheckBoxIsShowElementsInvolved");137 m_CheckBoxIsSingleCaseNotification = base.Form.GetControl<ICheckBox>("CheckBoxIsSingleCaseNotification");138 m_CustomTab1 = base.Form.GetControl<VI.Controls.Interfaces.ITabControl>("CustomTab1");139 m_EditDefaultReasonAutomation = base.Form.GetControl<IEdit>("EditDefaultReasonAutomation");140 m_EditDescription = base.Form.GetControl<IEdit>("EditDescription");141 m_EditIdentAttestationPolicy = base.Form.GetControl<IEdit>("EditIdentAttestationPolicy");142 m_EditLimitOfOldCases = base.Form.GetControl<IEdit>("EditLimitOfOldCases");143 m_EditResult = base.Form.GetControl<IEdit>("EditResult");144 m_EditSolutionDays = base.Form.GetControl<IEdit>("EditSolutionDays");145 m_FormDialogComponent = base.Form.GetComponent<IFormDialogComponent>("FormDialogComponent");146 m_LabelWhereClauseMetaHint = base.Form.GetControl<INetLabel>("LabelWhereClauseMetaHint");147 m_MainActivator = base.Form.GetComponent<IActivatorComponent>("MainActivator");148 m_MainPanel = base.Form.GetControl<IVIPanel>("MainPanel");149 m_MultiValueEditReportParameter = base.Form.GetControl<IMultiValueEdit>("MultiValueEditReportParameter");150 m_NewObjectButtonAERoleOwner = base.Form.GetControl<INewObjectButton>("NewObjectButtonAERoleOwner");151 m_NewObjectButtonPayLoadSchedule = base.Form.GetControl<INewObjectButton>("NewObjectButtonPayLoadSchedule");152 m_NewObjectButtonPickCategory = base.Form.GetControl<INewObjectButton>("NewObjectButtonPickCategory");153 m_NewObjectButtonQERTermsOfUse = base.Form.GetControl<INewObjectButton>("NewObjectButtonQERTermsOfUse");154 m_ObjectChangeComponent = base.Form.GetComponent<IObjectChangeComponent>("ObjectChangeComponent");155 m_StockImageComponent = base.Form.GetComponent<StockImageComponent>("StockImageComponent");156 m_SyntaxEditWhereClause = base.Form.GetControl<IDBSyntaxEdit>("SyntaxEditWhereClause");157 m_SyntaxEditWhereClauseOra = base.Form.GetControl<IDBSyntaxEdit>("SyntaxEditWhereClauseOra");158 m_TabPage_00 = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPage_00");159 m_TabPageResultList = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageResultList");160 m_TextComboBoxApproveReasonType = base.Form.GetControl<ITextComboBox>("TextComboBoxApproveReasonType");161 m_TextComboBoxDenyReasonType = base.Form.GetControl<ITextComboBox>("TextComboBoxDenyReasonType");162 m_TextComboBoxReportType = base.Form.GetControl<ITextComboBox>("TextComboBoxReportType");163 m_TrackBarRiskIndex = base.Form.GetControl<ITrackBar>("TrackBarRiskIndex");164 m_TrackBarRiskIndexReduced = base.Form.GetControl<ITrackBar>("TrackBarRiskIndexReduced");165 m_TreeComboBoxUIDDialogSchedule = base.Form.GetControl<ITreeComboBox>("TreeComboBoxUIDDialogSchedule");166 m_TreeComboBoxUIDQERTermsOfUse = base.Form.GetControl<ITreeComboBox>("TreeComboBoxUIDQERTermsOfUse");167 m_TreeComboUIDAERoleOwner = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAERoleOwner");168 m_TreeComboUIDAttestationObject = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAttestationObject");169 m_TreeComboUIDAttestationPolicyGroup = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAttestationPolicyGroup");170 m_TreeComboUIDDialogCulture = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogCulture");171 m_TreeComboUIDPersonOwner = base.Form.GetControl<ITreeComboBox>("TreeComboUIDPersonOwner");172 m_TreeComboUIDPWODecisionMethod = base.Form.GetControl<ITreeComboBox>("TreeComboUIDPWODecisionMethod");173 m_TreeComboUIDQERPickCategory = base.Form.GetControl<ITreeComboBox>("TreeComboUIDQERPickCategory");174 m_NewObjectButtonPayLoadSchedule.Variables["HideMinuteAndHour"] = true;175 m_NewObjectButtonPayLoadSchedule.SetUpNewObjectAction = [CompilerGenerated] (ISingleDbObject newObject) =>176 {177 newObject.SetValueSafe("UID_DialogTableBelongsTo", base.Session.MetaData().GetTable("AttestationPolicy").Uid);178 newObject["UID_DialogTableBelongsTo"].CanSee = false;179 };180 m_NewObjectButtonAERoleOwner.SetUpNewObjectAction = delegate(ISingleDbObject newObject)181 {182 newObject.SetValueSafe("UID_ParentAERole", "ATT-AEROLE-ATTESTATION-OWNER-ROLE");183 };184 IDBSyntaxEdit syntaxEditWhereClause = m_SyntaxEditWhereClause;185 int height = (m_SyntaxEditWhereClauseOra.Height = 500);186 syntaxEditWhereClause.Height = height;187 IDBSyntaxEdit syntaxEditWhereClause2 = m_SyntaxEditWhereClause;188 height = (m_SyntaxEditWhereClauseOra.Width = 800);189 syntaxEditWhereClause2.Width = height;190 m_EditResult.Size = new Size(800, 500);191 }192 catch (System.Exception innerException)193 {194 throw new FormCustomizerException(874825, innerException, ((object)this).ToString());195 }196 }197198 protected override void OnDesignChanged()199 {200 //IL_0008: Unknown result type (might be due to invalid IL or missing references)201 m_LabelWhereClauseMetaHint.BackColor = DesignColors.GetColor(DesignColor.White);202 }203204 private void InitializeComponent()205 {206 }207208 protected override void OnFormLoad()209 {210 m_TabPage_00.Caption = "ATT_FormCommon_General";211 m_TabPageResultList.Caption = "ATT_FormAttestationPolicyMasterData_TabPage_ResultList";212 m_TabPageResultList.VisibleByUser = false;213 m_EditResult.Caption = "ATT_FormAttestationPolicyMasterData_TabPage_ResultList";214 m_ButtonSQLWizard.Caption = "ATT_FormAttestationPolicyMasterData_SQLWizard";215 m_LabelWhereClauseMetaHint.Text = BaseCustomizer.GetString("ATT_FormAttestationPolicyMasterData_MetaHint");216 using (new UpdateHelper(base.Tasks))217 {218 Task task = base.Tasks["AdHocAttestation"];219 task.TaskMethod = Task_AdHocAttestation;220 task.Caption = "ATT_FormAttestationPolicyMasterData_Task_AdHocAttestation";221 task.StockImage = StockImage.BlueCheckmark;222 task.Enabled = true;223 task.Visible = false;224 Task task2 = base.Tasks["ShowCondition"];225 task2.TaskMethod = TaskShowCondition;226 task2.Caption = "ATT_FormAttestationPolicyMasterData_Task_ShowCondition";227 task2.Enabled = true;228 task2.Visible = true;229 Task task3 = base.Tasks["HideCondition"];230 task3.TaskMethod = TaskHideCondition;231 task3.Caption = "ATT_FormAttestationPolicyMasterData_Task_HideCondition";232 task3.Enabled = true;233 task3.Visible = true;234 Task task4 = base.Tasks["ShowResult"];235 task4.TaskMethod = Task_ShowResult;236 task4.Caption = "ATT_FormAttestationPolicyMasterData_Task_ShowResult";237 task4.Enabled = true;238 task4.Visible = true;239 Task task5 = base.Tasks["DeletePolicy"];240 task5.TaskMethod = Task_DeletePolicy;241 task5.Caption = "ATT_FormAttestationPolicyMasterData_Task_DeletePolicy";242 task5.Enabled = true;243 task5.StockImage = StockImage.DeleteDocument;244 task5.Visible = false;245 }246 m_MultiValueEditReportParameter.VisibleByUser = false;247 }248249 protected override void OnFormUnload()250 {251 m_EditResult.Text = "";252 }253254 public void Task_DeletePolicy()255 {256 //IL_0046: Unknown result type (might be due to invalid IL or missing references)257 //IL_004c: Invalid comparison between Unknown and I4258 ISingleDbObject dbObject = m_MainActivator.DbObject;259 if (dbObject != null && dbObject.GetValueSafe("IsInActive", defaultValue: false) && string.Equals(base.Session.User().Identifier, "viAdmin", (StringComparison)5) && (int)FormTool.ShowQuestion("ATT_FormAttestationPolicyMasterData_Question_DeletePolicy", (MessageBoxButtons)4) == 6)260 {261 dbObject.Custom.CallMethod("Delete");262 CloseForm();263 }264 }265266 public void Task_AdHocAttestation()267 {268 //IL_003b: Unknown result type (might be due to invalid IL or missing references)269 try270 {271 ISingleDbObject dbObject = m_MainActivator.DbObject;272 if (dbObject != null)273 {274 FormTool.ShowForm(base.ComponentContainer, m_FormDialogComponent, m_MainPanel, "FormAttestationAdhoc", "ATT_AttestationAdhoc", dbObject, BaseCustomizer.GetString("ATT_FormAttestationPolicyMasterData_Task_AdHocAttestation"), UISnapInDialogButtons.Close);275 }276 }277 catch (System.Exception innerException)278 {279 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("ATT_FormAttestationPolicyMasterData_Task_AdHocAttestation").Replace("&", "")), this);280 }281 }282283 public void Task_ShowResult()284 {285 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)286 //IL_00b9: Expected O, but got Unknown287 m_EditResult.Text = "";288 ISingleDbObject dbObject = m_MainActivator.DbObject;289 string text = dbObject?.ObjectWalker["FK(UID_AttestationObject).UID_DialogTable"].String;290 if (string.IsNullOrEmpty(text))291 {292 return;293 }294 string tableName = GetTableName(text);295 if (string.IsNullOrWhiteSpace(tableName))296 {297 return;298 }299 IMetaTable table = base.Session.MetaData().GetTable(tableName);300 Query query = Query.From(tableName).Where((dbObject.Custom.CallMethod("GetWhereClause") as string) ?? "").SelectDisplays();301 IEntityCollection collection = base.Session.Source().GetCollection(query, EntityCollectionLoadType.ForeignDisplays);302 StringBuilder val = new StringBuilder();303 System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)collection).GetEnumerator();304 try305 {306 while (((System.Collections.IEnumerator)enumerator).MoveNext())307 {308 IEntity current = enumerator.Current;309 val.AppendLine(current.Display);310 }311 }312 finally313 {314 ((System.IDisposable)enumerator)?.Dispose();315 }316 val.AppendLine();317 val.AppendLine("----------------------------");318 val.AppendFormat(" {0} {1}", (object)((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count, (object)table.Display);319 m_EditResult.Text = ((object)val).ToString();320 m_TabPageResultList.VisibleByUser = true;321 FormTool.StretchControl(m_EditResult, ExtOrientation.Both, keepSpaceForScrollBars: true);322 m_CustomTab1.SelectedTab = m_TabPageResultList;323 }324325 private string GetTableName(string uidtable)326 {327 if (!base.Session.MetaData().TryGetTable(uidtable, out var table))328 {329 return "";330 }331 return table.Tablename;332 }333334 protected override void OnFormSizeChanged()335 {336 FormTool.StretchControl(m_EditResult, ExtOrientation.Both, keepSpaceForScrollBars: true);337 FormTool.StretchControl(m_SyntaxEditWhereClause, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);338 FormTool.StretchControl(m_SyntaxEditWhereClauseOra, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);339 IDBSyntaxEdit syntaxEditWhereClause = m_SyntaxEditWhereClause;340 int height = (m_SyntaxEditWhereClauseOra.Height = 240);341 syntaxEditWhereClause.Height = height;342 }343344 private void MainActivator_OnActivating(object sender, EventArgs e)345 {346 ISingleDbObject dbObject = m_MainActivator.DbObject;347 if (dbObject == null)348 {349 return;350 }351 _objectCreation = !dbObject.IsLoaded;352 try353 {354 m_TextComboBoxReportType.VisibleByUser = base.Session.Config().GetConfigParm("QER\\Attestation\\AllowAllReportTypes") == "1";355 m_TreeComboUIDPWODecisionMethod.WhereClause = base.SqlFormatter.Comparison("UsageArea", "A", ValType.String);356 m_TreeComboBoxUIDDialogSchedule.WhereClause = base.SqlFormatter.UidComparison("UID_DialogTableBelongsTo", base.Session.MetaData().GetTable("AttestationPolicy").Uid);357 m_TreeComboUIDAttestationObject.WhereClause = base.SqlFormatter.Comparison("IsDeactivatedByPreProcessor", false, ValType.Bool);358 IVarContext variables = m_NewObjectButtonAERoleOwner.Variables;359 string value = (m_TreeComboUIDAERoleOwner.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "ATT-AEROLE-ATTESTATION-OWNER-ROLE" }));360 variables["ParentAERoleWhereClause"] = value;361 m_TabPageResultList.VisibleByUser = false;362 m_EditResult.Text = string.Empty;363 }364 finally365 {366 IDBSyntaxEdit syntaxEditWhereClause = m_SyntaxEditWhereClause;367 bool visibleByUser = (m_SyntaxEditWhereClauseOra.VisibleByUser = _objectCreation);368 syntaxEditWhereClause.VisibleByUser = visibleByUser;369 _AdaptTasks();370 }371 }372373 private void ButtonSQLWizard_Click(object sender, EventArgs e)374 {375 try376 {377 ISingleDbObject dbObject = m_MainActivator.DbObject;378 if (dbObject == null)379 {380 return;381 }382 using UsiWhereClauseWizard usiWhereClauseWizard = new UsiWhereClauseWizard(base.ComponentContainer);383 usiWhereClauseWizard.Session = base.Session;384 usiWhereClauseWizard.WhereClause = m_SyntaxEditWhereClause.Text;385 usiWhereClauseWizard.TableName = GetTableName(dbObject.ObjectWalker["FK(UID_AttestationObject).UID_DialogTable"].String);386 usiWhereClauseWizard.ShowGeneratedSql = false;387 usiWhereClauseWizard.ExpertMode = true;388 if (usiWhereClauseWizard.ShowModal() != UISnapInDialogResult.Cancel)389 {390 dbObject["WhereClause"].NewValue = usiWhereClauseWizard.WhereClause;391 }392 }393 catch (System.Exception exception)394 {395 ExceptionMgr.Instance.HandleException(exception, this);396 }397 }398399 private void ObjectChangeComponent_ColumnValueChanged(object sender, ColumnEventArgs e)400 {401 try402 {403 ISingleDbObject dbObject = m_MainActivator.DbObject;404 if (dbObject == null)405 {406 return;407 }408 string text = e.Column.Columnname.ToLowerInvariant();409 if (!(text == "uid_attestationobject"))410 {411 if (!(text == "whereclausemeta"))412 {413 if (text == "isinactive")414 {415 _AdaptTasks();416 }417 }418 else419 {420 IDBSyntaxEdit syntaxEditWhereClauseOra = m_SyntaxEditWhereClauseOra;421 bool enabledByUser = (m_SyntaxEditWhereClause.EnabledByUser = e.New.String.Length == 0);422 syntaxEditWhereClauseOra.EnabledByUser = enabledByUser;423 m_LabelWhereClauseMetaHint.Visible = e.New.String.Length > 0;424 _HandleSqlWizardButton();425 }426 }427 else428 {429 _HandleSqlWizardButton();430 m_TextComboBoxReportType.VisibleByUser = base.Session.Config().GetConfigParm("QER\\Attestation\\AllowAllReportTypes") == "1" && dbObject.ObjectWalker["FK(UID_AttestationObject).ObjectKeyReport"].String.Length > 0;431 m_TreeComboUIDPWODecisionMethod.WhereClause = string.Format("\r\n UID_PWODecisionMethod in \r\n (\r\n select UID_PWODecisionMethod \r\n from AttestationObjectHasPWODM\r\n where {0}\r\n )", (object)base.SqlFormatter.UidComparison("uid_attestationobject", e.New.String));432 }433 }434 catch (System.Exception exception)435 {436 ExceptionMgr.Instance.HandleException(exception, this);437 }438 }439440 private void _HandleSqlWizardButton()441 {442 ISingleDbObject dbObject = m_MainActivator.DbObject;443 IDBSyntaxEdit syntaxEditWhereClauseOra = m_SyntaxEditWhereClauseOra;444 IDBSyntaxEdit syntaxEditWhereClause = m_SyntaxEditWhereClause;445 bool flag = (m_ButtonSQLWizard.Enabled = dbObject != null && dbObject.ObjectWalker["FK(UID_AttestationObject).UID_DialogTable"].String.Length > 0 && dbObject.GetEntity().CanSee("whereclausemeta") && dbObject["whereclausemeta"].New.String.Length == 0);446 bool enabledByUser = (syntaxEditWhereClause.EnabledByUser = flag);447 syntaxEditWhereClauseOra.EnabledByUser = enabledByUser;448 }449450 private void TaskShowCondition()451 {452 IDBSyntaxEdit syntaxEditWhereClauseOra = m_SyntaxEditWhereClauseOra;453 bool visibleByUser = (m_SyntaxEditWhereClause.VisibleByUser = true);454 syntaxEditWhereClauseOra.VisibleByUser = visibleByUser;455 _AdaptTasks();456 }457458 private void TaskHideCondition()459 {460 IDBSyntaxEdit syntaxEditWhereClauseOra = m_SyntaxEditWhereClauseOra;461 bool visibleByUser = (m_SyntaxEditWhereClause.VisibleByUser = false);462 syntaxEditWhereClauseOra.VisibleByUser = visibleByUser;463 _AdaptTasks();464 }465466 private void _AdaptTasks(bool checkLoaded = true)467 {468 try469 {470 ISingleDbObject dbObject = m_MainActivator.DbObject;471 using (new UpdateHelper(base.Tasks))472 {473 base.Tasks["ShowCondition"].Visible = !m_SyntaxEditWhereClause.VisibleByUser;474 base.Tasks["HideCondition"].Visible = m_SyntaxEditWhereClause.VisibleByUser;475 base.Tasks["ShowResult"].Visible = dbObject != null && dbObject.GetValueSafe("UID_AttestationObject", "").Length > 0;476 base.Tasks["DeletePolicy"].Visible = dbObject != null && dbObject.GetValueSafe("IsInActive", defaultValue: false) && string.Equals(base.Session.User().Identifier, "viAdmin", (StringComparison)5);477 base.Tasks["AdHocAttestation"].Visible = dbObject != null && (dbObject.IsLoaded || !checkLoaded) && !dbObject.GetValueSafe("IsInactive", defaultValue: true);478 }479 }480 catch (System.Exception exception)481 {482 ExceptionMgr.Instance.HandleException(exception, this);483 }484 }485486 private void ObjectChangeComponent_ObjectEventOccurred(object sender, ObjectChangeComponentEventArgs e)487 {488 if (e.Event == ObjectChangeEvent.Saved)489 {490 if (_objectCreation)491 {492 IDBSyntaxEdit syntaxEditWhereClauseOra = m_SyntaxEditWhereClauseOra;493 bool flag = (m_SyntaxEditWhereClause.VisibleByUser = false);494 bool objectCreation = (syntaxEditWhereClauseOra.VisibleByUser = flag);495 _objectCreation = objectCreation;496 }497 _AdaptTasks(checkLoaded: false);498 }499 }500}501