Back to OIM Explorer

POL.Forms/POL.Forms/FormQERPolicyMasterData.cs

Decompiler Source FilePOL.Forms.FormQERPolicyMasterDataDecompiled Source

3 extracted method/event/call references in FormQERPolicyMasterData.

Source: F:\Claude\.tmp\oim-decompiled-full\0954_One_Identity_Manager_POL.Forms.dll\POL.Forms\FormQERPolicyMasterData.cs

Source size: 29.861 characters

Interpretation

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

Relations

  • CallMethod: RecalculatePolicy at line 387
  • CallMethod: RecalculateAll at line 397
  • CallMethod: Copy at line 564

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 FormQERPolicyMasterData; methods OnInit, InitializeComponent, OnFormSizeChanged, OnFormLoad, OnFormUnload, _DisconnectUIEngineUserSettings; references AERole, DialogDashboardDef, DialogReport, DialogRichMail, DialogSchedule, DialogTable; markers reads entity values, references DB/Dialog objects

Classes

FormQERPolicyMasterData

OIM key/entity markers

UID_ParentAERole UID_OrgRoot UID_DialogTable UID_QERPolicyWork UID_QERPolicy UID_DialogTableBelongsTo UID_DialogTableBaseObject

API/entity calls

GetValue CreateSingle Source From MetaData UidComparison AndRelation IsSystemPart IsModuleOwner NotInClause Comparison

Registrations / handlers

None extracted.

Complete Source

C#734 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Drawing;5using System.Text;6using System.Windows.Forms;7using VI.AE.Forms.Base;8using VI.Base;9using VI.Common.Forms.Base;10using VI.Controls;11using VI.Controls.Interfaces;12using VI.DB;13using VI.DB.Entities;14using VI.DB.Sync;15using VI.FormBase;16using VI.FormBase.Tasks;17using VI.FormCustomizers;18using VI.FormTools;19using VI.ImageLibrary;20using VI.SqlWizard;21using VI.UI.Base;22using VI.UI.Base.SnapIns;23using VI.UI.Controls.Common;2425namespace POL.Forms;2627public class FormQERPolicyMasterData : BaseCustomizer28{29	private UIEngineUserSettings m_UIEngineUserSettings;3031	private IActivatorComponent m_MainActivator;3233	private VI.Controls.Interfaces.IButton m_ButtonEditWhereClause;3435	private ICheckBox m_CheckBoxIsExceptionAllowed;3637	private ICheckBox m_CheckBoxIsInactive;3839	private ICheckBox m_CheckBoxIsNoWhereClause;4041	private ICheckBox m_CheckBoxIsToAttestImmediately;4243	private ICheckBox m_CheckBoxIsWorkingCopy;4445	private IDynamicKeyButton m_DynamicKeyObjectKeyAttPolicy;4647	private IEdit m_EditDescription;4849	private IEdit m_EditDiffEqual;5051	private IEdit m_EditDiffNew;5253	private IEdit m_EditDiffRemoved;5455	private IEdit m_EditExceptionNotes;5657	private IEdit m_EditIdentQERPolicy;5859	private IEdit m_EditImplementationNotes;6061	private IEdit m_EditPolicyNumber;6263	private IEdit m_EditResult;6465	private IEdit m_EditRuleViolationThreshold;6667	private IEdit m_EditStateInfo;6869	private IEdit m_EditVersionMajor;7071	private IEdit m_EditVersionMinor;7273	private IEdit m_EditVersionPatch;7475	private IEdit m_EditWhereClause;7677	private IFormDialogComponent m_FormDialogComponent;7879	private INewObjectButton m_NewObjectButtonAERoleAttestator;8081	private INewObjectButton m_NewObjectButtonAERoleResponsible;8283	private INewObjectButton m_NewObjectButtonAERoleRuler;8485	private INewObjectButton m_NewObjectButtonQERPolicyGroup;8687	private VI.Controls.Interfaces.ITabControl m_TabControl;8889	private VI.Controls.Interfaces.ITabPage m_TabPageAssessmentCriteria;9091	private VI.Controls.Interfaces.ITabPage m_TabPageCommon;9293	private VI.Controls.Interfaces.ITabPage m_TabPageExtended;9495	private VI.Controls.Interfaces.ITabPage m_TabPageResultList;9697	private VI.Controls.Interfaces.ITabPage m_TabPageRuleDiff;9899	private ITextComboBox m_TextComboBoxSignificancyClass;100101	private ITrackBar m_TrackBarRiskIndex;102103	private ITrackBar m_TrackBarRiskIndexReduced;104105	private ITrackBar m_TrackBarRuleSeverity;106107	private ITrackBar m_TrackBarTransparencyIndex;108109	private ITreeComboBox m_DynTreeComboBoxObjectKeyAttPolicy;110111	private ITreeComboBox m_TreeComboBoxUIDDialogScheduleFill;112113	private ITreeComboBox m_TreeComboBoxUIDDialogTable;114115	private ITreeComboBox m_TreeComboUIDAERoleAttestator;116117	private ITreeComboBox m_TreeComboUIDAERoleResponsible;118119	private ITreeComboBox m_TreeComboUIDAERoleRuler;120121	private ITreeComboBox m_TreeComboUIDDialogDashboardDef;122123	private ITreeComboBox m_TreeComboUIDDialogReport;124125	private ITreeComboBox m_TreeComboUIDDialogRichMailNewViolation;126127	private ITreeComboBox m_TreeComboUIDQERPolicyGroup;128129	private IVIPanel m_MainPanel;130131	private IObjectChangeComponent m_ObjectChangeComponent;132133	private StockImageComponent m_StockImageComponent;134135	protected override void OnInit()136	{137		//IL_04e4: Unknown result type (might be due to invalid IL or missing references)138		base.OnInit();139		try140		{141			m_ButtonEditWhereClause = base.Form.GetControl<VI.Controls.Interfaces.IButton>("ButtonEditWhereClause");142			m_CheckBoxIsExceptionAllowed = base.Form.GetControl<ICheckBox>("CheckBoxIsExceptionAllowed");143			m_CheckBoxIsInactive = base.Form.GetControl<ICheckBox>("CheckBoxIsInactive");144			m_CheckBoxIsNoWhereClause = base.Form.GetControl<ICheckBox>("CheckBoxIsNoWhereClause");145			m_CheckBoxIsToAttestImmediately = base.Form.GetControl<ICheckBox>("CheckBoxIsToAttestImmediately");146			m_CheckBoxIsWorkingCopy = base.Form.GetControl<ICheckBox>("CheckBoxIsWorkingCopy");147			m_DynamicKeyObjectKeyAttPolicy = base.Form.GetControl<IDynamicKeyButton>("DynamicKeyObjectKeyAttPolicy");148			m_DynTreeComboBoxObjectKeyAttPolicy = base.Form.GetControl<ITreeComboBox>("DynTreeComboBoxObjectKeyAttPolicy");149			m_EditDescription = base.Form.GetControl<IEdit>("EditDescription");150			m_EditDiffEqual = base.Form.GetControl<IEdit>("EditDiffEqual");151			m_EditDiffNew = base.Form.GetControl<IEdit>("EditDiffNew");152			m_EditDiffRemoved = base.Form.GetControl<IEdit>("EditDiffRemoved");153			m_EditExceptionNotes = base.Form.GetControl<IEdit>("EditExceptionNotes");154			m_EditIdentQERPolicy = base.Form.GetControl<IEdit>("EditIdentQERPolicy");155			m_EditImplementationNotes = base.Form.GetControl<IEdit>("EditImplementationNotes");156			m_EditPolicyNumber = base.Form.GetControl<IEdit>("EditPolicyNumber");157			m_EditResult = base.Form.GetControl<IEdit>("EditResult");158			m_EditRuleViolationThreshold = base.Form.GetControl<IEdit>("EditRuleViolationThreshold");159			m_EditStateInfo = base.Form.GetControl<IEdit>("EditStateInfo");160			m_EditVersionMajor = base.Form.GetControl<IEdit>("EditVersionMajor");161			m_EditVersionMinor = base.Form.GetControl<IEdit>("EditVersionMinor");162			m_EditVersionPatch = base.Form.GetControl<IEdit>("EditVersionPatch");163			m_EditWhereClause = base.Form.GetControl<IEdit>("EditWhereClause");164			m_FormDialogComponent = base.Form.GetComponent<IFormDialogComponent>("FormDialogComponent");165			m_MainActivator = base.Form.GetComponent<IActivatorComponent>("MainActivator");166			m_MainPanel = base.Form.GetControl<IVIPanel>("MainPanel");167			m_NewObjectButtonAERoleAttestator = base.Form.GetControl<INewObjectButton>("NewObjectButtonAERoleAttestator");168			m_NewObjectButtonAERoleResponsible = base.Form.GetControl<INewObjectButton>("NewObjectButtonAERoleResponsible");169			m_NewObjectButtonAERoleRuler = base.Form.GetControl<INewObjectButton>("NewObjectButtonAERoleRuler");170			m_NewObjectButtonQERPolicyGroup = base.Form.GetControl<INewObjectButton>("NewObjectButtonQERPolicyGroup");171			m_ObjectChangeComponent = base.Form.GetComponent<IObjectChangeComponent>("ObjectChangeComponent");172			m_StockImageComponent = base.Form.GetComponent<StockImageComponent>("StockImageComponent");173			m_TabControl = base.Form.GetControl<VI.Controls.Interfaces.ITabControl>("TabControl");174			m_TabPageAssessmentCriteria = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageAssessmentCriteria");175			m_TabPageCommon = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageCommon");176			m_TabPageExtended = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageExtended");177			m_TabPageResultList = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageResultList");178			m_TabPageRuleDiff = base.Form.GetControl<VI.Controls.Interfaces.ITabPage>("TabPageRuleDiff");179			m_TextComboBoxSignificancyClass = base.Form.GetControl<ITextComboBox>("TextComboBoxSignificancyClass");180			m_TrackBarRiskIndex = base.Form.GetControl<ITrackBar>("TrackBarRiskIndex");181			m_TrackBarRiskIndexReduced = base.Form.GetControl<ITrackBar>("TrackBarRiskIndexReduced");182			m_TrackBarRuleSeverity = base.Form.GetControl<ITrackBar>("TrackBarRuleSeverity");183			m_TrackBarTransparencyIndex = base.Form.GetControl<ITrackBar>("TrackBarTransparencyIndex");184			m_TreeComboBoxUIDDialogScheduleFill = base.Form.GetControl<ITreeComboBox>("TreeComboBoxUIDDialogScheduleFill");185			m_TreeComboBoxUIDDialogTable = base.Form.GetControl<ITreeComboBox>("TreeComboBoxUIDDialogTable");186			m_TreeComboUIDAERoleAttestator = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAERoleAttestator");187			m_TreeComboUIDAERoleResponsible = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAERoleResponsible");188			m_TreeComboUIDAERoleRuler = base.Form.GetControl<ITreeComboBox>("TreeComboUIDAERoleRuler");189			m_TreeComboUIDDialogDashboardDef = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogDashboardDef");190			m_TreeComboUIDDialogReport = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogReport");191			m_TreeComboUIDDialogRichMailNewViolation = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogRichMailNewViolation");192			m_TreeComboUIDQERPolicyGroup = base.Form.GetControl<ITreeComboBox>("TreeComboUIDQERPolicyGroup");193			m_EditVersionMajor.Width = 240;194			m_EditVersionMinor.Width = 60;195			m_EditVersionPatch.Width = 60;196			m_EditWhereClause.Height = 500;197			m_EditWhereClause.Width = 800;198			m_EditWhereClause.VisibleByUser = false;199			m_EditResult.Size = new Size(800, 500);200			m_NewObjectButtonAERoleResponsible.SetUpNewObjectAction = delegate(ISingleDbObject newrole)201			{202				newrole.SetValueSafe("UID_ParentAERole", "POL-AEROLE-QERPOLICY-RESPONSIBLE");203				newrole.SetValueSafe("UID_OrgRoot", "QER-V-AERole");204			};205		}206		catch (System.Exception innerException)207		{208			throw new FormCustomizerException(874825, innerException, ((object)this).ToString());209		}210	}211212	private void InitializeComponent()213	{214	}215216	protected override void OnFormSizeChanged()217	{218		FormTool.StretchControl(m_EditResult, ExtOrientation.Both, keepSpaceForScrollBars: true);219		using (new UpdateHelper(m_EditDiffNew.ParentControl, ChangeType.Layout))220		{221			FormTool.StretchControl(m_EditDiffNew, ExtOrientation.Both, keepSpaceForScrollBars: true);222			FormTool.StretchControl(m_EditDiffRemoved, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);223			FormTool.StretchControl(m_EditDiffEqual, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);224			IEdit editDiffNew = m_EditDiffNew;225			IEdit editDiffRemoved = m_EditDiffRemoved;226			int num = (m_EditDiffEqual.Height = m_EditDiffNew.Height / 3 - 5);227			int height = (editDiffRemoved.Height = num);228			editDiffNew.Height = height;229		}230		using (new UpdateHelper(m_EditWhereClause.ParentControl, ChangeType.Layout))231		{232			FormTool.StretchControl(m_EditWhereClause, ExtOrientation.Both, keepSpaceForScrollBars: true);233		}234	}235236	protected override void OnFormLoad()237	{238		m_TabPageCommon.Caption = "POL_FormCommon_General";239		m_TabPageExtended.Caption = "POL_FormQERPolicyMasterData_TabPage_Extended";240		m_TabPageRuleDiff.Caption = "POL_FormQERPolicyMasterData_TabPage_RuleDiff";241		m_TabPageAssessmentCriteria.Caption = "POL_FormQERPolicyMasterData_TabPage_AssessmentCriteria";242		m_TabPageResultList.Caption = "POL_FormQERPolicyMasterData_TabPage_ResultList";243		m_EditResult.Caption = "POL_FormQERPolicyMasterData_TabPage_ResultList";244		m_EditDiffNew.Caption = "POL_FormQERPolicyMasterData_DiffNew";245		m_EditDiffRemoved.Caption = "POL_FormQERPolicyMasterData_DiffRemoved";246		m_EditDiffEqual.Caption = "POL_FormQERPolicyMasterData_DiffEqual";247		m_ButtonEditWhereClause.Caption = "POL_FormQERPolicyMasterData_EditWhereClause";248		m_EditWhereClause.EnabledByUser = true;249		m_EditWhereClause.VisibleByUser = false;250		m_TabPageResultList.VisibleByUser = false;251		m_TabPageRuleDiff.VisibleByUser = false;252		using (new UpdateHelper(base.Tasks))253		{254			Task task = base.Tasks["RecalculatePolicy"];255			task.TaskMethod = Task_RecalculatePolicy;256			task.Caption = "POL_FormQERPolicyMasterData_Task_RecalculatePolicy";257			task.StockImage = StockImage.Refresh;258			task.Enabled = true;259			task.Visible = false;260			Task task2 = base.Tasks["RecalculateAll"];261			task2.TaskMethod = Task_RecalculateAll;262			task2.Caption = "POL_FormQERPolicyMasterData_Task_RecalculateAll";263			task2.StockImage = StockImage.Refresh;264			task2.Enabled = true;265			task2.Visible = false;266			Task task3 = base.Tasks["RuleDiff"];267			task3.TaskMethod = Task_PolicyDiff;268			task3.Caption = "POL_FormQERPolicyMasterData_Task_DiffPolicy";269			task3.StockImage = StockImage.RemoveRow;270			task3.Enabled = true;271			task3.Visible = false;272			Task task4 = base.Tasks["Copy"];273			task4.TaskMethod = TaskCopy;274			task4.Caption = "POL_FormQERPolicyCopyDialog_FormTitle";275			task4.StockImage = StockImage.Copy;276			task4.Enabled = true;277			task4.Visible = true;278			Task task5 = base.Tasks["ShowCondition"];279			task5.TaskMethod = TaskShowCondition;280			task5.Caption = "POL_FormQERPolicyMasterData_Task_ShowCondition";281			task5.Enabled = true;282			task5.Visible = true;283			task5.HasHistorySupport = true;284			Task task6 = base.Tasks["HideCondition"];285			task6.TaskMethod = TaskHideCondition;286			task6.Caption = "POL_FormQERPolicyMasterData_Task_HideCondition";287			task6.Enabled = true;288			task6.Visible = true;289			Task task7 = base.Tasks["ShowResult"];290			task7.TaskMethod = Task_ShowResult;291			task7.Caption = "POL_FormQERPolicyMasterData_Task_ShowResult";292			task7.Enabled = true;293			task7.Visible = true;294		}295	}296297	protected override void OnFormUnload()298	{299		_DisconnectUIEngineUserSettings();300		m_EditResult.Text = "";301	}302303	private void _DisconnectUIEngineUserSettings()304	{305		//IL_0016: Unknown result type (might be due to invalid IL or missing references)306		//IL_0020: Expected O, but got Unknown307		if (m_UIEngineUserSettings != null)308		{309			m_UIEngineUserSettings.Changed -= new EventHandler(_UIEngineUserSettingsChangedHandler);310			m_UIEngineUserSettings.Dispose();311			m_UIEngineUserSettings = null;312		}313	}314315	private UIEngineUserSettings _GetUIEngineUserSettings()316	{317		//IL_0030: Unknown result type (might be due to invalid IL or missing references)318		//IL_003a: Expected O, but got Unknown319		if (base.Session == null)320		{321			return null;322		}323		if (m_UIEngineUserSettings == null)324		{325			m_UIEngineUserSettings = new UIEngineUserSettings(base.Session);326			m_UIEngineUserSettings.Changed += new EventHandler(_UIEngineUserSettingsChangedHandler);327		}328		return m_UIEngineUserSettings;329	}330331	private void _UIEngineUserSettingsChangedHandler(object sender, EventArgs e)332	{333		try334		{335			_AdaptBaseTableCombo();336		}337		catch (System.Exception ex)338		{339			HandleException(ex);340		}341	}342343	public void Task_ShowResult()344	{345		//IL_007a: Unknown result type (might be due to invalid IL or missing references)346		//IL_0080: Expected O, but got Unknown347		m_EditResult.Text = "";348		ISingleDbObject dbObject = m_MainActivator.DbObject;349		if (dbObject == null)350		{351			return;352		}353		string text = dbObject.ObjectWalker["FK(UID_DialogTable).TableName"].String;354		if (string.IsNullOrEmpty(text))355		{356			return;357		}358		IEntityCollection collection = base.Session.Source().GetCollection(Query.From(text).Where(dbObject["WhereClause"].New.String).SelectDisplays(), EntityCollectionLoadType.LoadForeignDisplaysEvenWhenExpensive);359		StringBuilder val = new StringBuilder();360		System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)collection).GetEnumerator();361		try362		{363			while (((System.Collections.IEnumerator)enumerator).MoveNext())364			{365				IEntity current = enumerator.Current;366				val.AppendLine(current.LongDisplay);367			}368		}369		finally370		{371			((System.IDisposable)enumerator)?.Dispose();372		}373		val.AppendLine();374		val.AppendLine("----------------------------");375		val.AppendFormat("  {0} {1}", (object)((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count, (object)base.Session.MetaData().GetTable(text).Display.Translated);376		m_EditResult.Text = ((object)val).ToString();377		m_TabPageResultList.VisibleByUser = true;378		FormTool.StretchControl(m_EditResult, ExtOrientation.Both, keepSpaceForScrollBars: true);379		m_TabControl.SelectedTab = m_TabPageResultList;380	}381382	public void Task_RecalculatePolicy()383	{384		ISingleDbObject dbObject = m_MainActivator.DbObject;385		if (dbObject != null)386		{387			dbObject.Custom.CallMethod("RecalculatePolicy");388			FormTool.ShowMessage("POL_FormQERPolicyMasterData_Message_RecalculateSuccessfullySaved");389		}390	}391392	public void Task_RecalculateAll()393	{394		ISingleDbObject dbObject = m_MainActivator.DbObject;395		if (dbObject != null)396		{397			dbObject.Custom.CallMethod("RecalculateAll");398			FormTool.ShowMessage("POL_FormQERPolicyMasterData_Message_RecalculateSuccessfullySaved");399		}400	}401402	public void Task_PolicyDiff()403	{404		//IL_0160: Unknown result type (might be due to invalid IL or missing references)405		//IL_0167: Expected O, but got Unknown406		//IL_0167: Unknown result type (might be due to invalid IL or missing references)407		//IL_016e: Expected O, but got Unknown408		//IL_016e: Unknown result type (might be due to invalid IL or missing references)409		//IL_0175: Expected O, but got Unknown410		//IL_029a: Unknown result type (might be due to invalid IL or missing references)411		//IL_029f: Unknown result type (might be due to invalid IL or missing references)412		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)413		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)414		//IL_0324: Unknown result type (might be due to invalid IL or missing references)415		//IL_0329: Unknown result type (might be due to invalid IL or missing references)416		//IL_032f: Unknown result type (might be due to invalid IL or missing references)417		//IL_0334: Unknown result type (might be due to invalid IL or missing references)418		m_EditDiffEqual.Text = "";419		m_EditDiffNew.Text = "";420		m_EditDiffRemoved.Text = "";421		ISingleDbObject dbObject = m_MainActivator.DbObject;422		if (dbObject == null)423		{424			return;425		}426		string text = base.Session.Source().GetSingleValue<string>("QERPolicy", "WhereClause", dbObject.PKWhereClause);427		if (text.Length == 0)428		{429			text = "1=1";430		}431		IEntityCollection collection = base.Session.Source().GetCollection(Query.From("QERPolicy").Where(base.SqlFormatter.UidComparison("UID_QERPolicyWork", dbObject["UID_QERPolicy"].New.String)).Select("WhereClause", "UID_DialogTable"));432		if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count != 1)433		{434			FormTool.ShowMessage("POL_FormQERPolicyMasterData_Message_DiffImposibleBecauseOriginalNotFound");435		}436		else437		{438			if (!base.Session.MetaData().TryGetTable(dbObject.ObjectWalker["FK(UID_DialogTable).TableName"].String, out var table))439			{440				return;441			}442			if (string.Compare(((System.Collections.Generic.IReadOnlyList<IEntity>)collection)[0].GetValue<string>("UID_DialogTable"), dbObject.GetValueSafe("UID_DialogTable", ""), (StringComparison)5) != 0)443			{444				FormTool.ShowMessage("POL_FormQERPolicyMasterData_Message_DiffImposibleBecauseTableHasChanged");445				return;446			}447			string value = ((System.Collections.Generic.IReadOnlyList<IEntity>)collection)[0].GetValue<string>("WhereClause");448			StringBuilder val = new StringBuilder();449			StringBuilder val2 = new StringBuilder();450			StringBuilder val3 = new StringBuilder();451			int num = 0;452			int num2 = 0;453			int num3 = 0;454			using (Transaction transaction = new Transaction(base.Session))455			{456				using (new BusyIndicator(base.Session, BusyTime.Short))457				{458					Dictionary<string, IEntity> val4 = base.Session.Source().GetCollection(Query.From(table.Tablename).Where(text).Select("xobjectkey"), EntityCollectionLoadType.ForeignDisplays).ToDictionarySafe<IEntity, string, IEntity>((IEntity e) => e.GetValue<string>("xobjectkey"), (IEntity e) => e);459					Dictionary<string, IEntity> val5 = base.Session.Source().GetCollection(Query.From(table.Tablename).Where(value).Select("xobjectkey"), EntityCollectionLoadType.ForeignDisplays).ToDictionarySafe<IEntity, string, IEntity>((IEntity e) => e.GetValue<string>("xobjectkey"), (IEntity e) => e);460					Enumerator<string, IEntity> enumerator = val4.GetEnumerator();461					try462					{463						while (enumerator.MoveNext())464						{465							KeyValuePair<string, IEntity> current = enumerator.Current;466							IEntity value2 = current.Value;467							string key = current.Key;468							if (!val5.ContainsKey(key))469							{470								val.AppendFormat("{0} {1}", (object)value2.Display, (object)Environment.NewLine);471								num++;472							}473							else474							{475								val2.AppendFormat("{0} {1}", (object)value2.Display, (object)Environment.NewLine);476								num2++;477							}478						}479					}480					finally481					{482						((System.IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();483					}484					enumerator = val5.GetEnumerator();485					try486					{487						while (enumerator.MoveNext())488						{489							KeyValuePair<string, IEntity> current2 = enumerator.Current;490							IEntity value3 = current2.Value;491							string key2 = current2.Key;492							if (!val4.ContainsKey(key2))493							{494								val3.AppendFormat("{0} {1}", (object)value3.Display, (object)Environment.NewLine);495								num3++;496							}497						}498					}499					finally500					{501						((System.IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();502					}503					if (base.Session.Variables["SimulationMode"] != null)504					{505						transaction.Commit();506					}507				}508			}509			val.Append(Environment.NewLine);510			val.Append(Environment.NewLine);511			val3.Append(Environment.NewLine);512			val3.Append(Environment.NewLine);513			val2.Append(Environment.NewLine);514			val2.Append(Environment.NewLine);515			LanguageManager instance = LanguageManager.Instance;516			object obj = num;517			val.Append(instance.FormatString("POL_FormQERPolicyMasterData_RecordsEffected", new System.ReadOnlySpan<object>(ref obj)));518			LanguageManager instance2 = LanguageManager.Instance;519			object obj2 = num3;520			val3.Append(instance2.FormatString("POL_FormQERPolicyMasterData_RecordsEffected", new System.ReadOnlySpan<object>(ref obj2)));521			LanguageManager instance3 = LanguageManager.Instance;522			object obj3 = num2;523			val2.Append(instance3.FormatString("POL_FormQERPolicyMasterData_RecordsEffected", new System.ReadOnlySpan<object>(ref obj3)));524			if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count != 1)525			{526				val2.Length = 0;527				val3.Length = 0;528				val2.Append(BaseCustomizer.GetString("POL_FormQERPolicyMasterData_Message_DiffImposibleBecauseOriginalNotFound"));529				val3.Append(BaseCustomizer.GetString("POL_FormQERPolicyMasterData_Message_DiffImposibleBecauseOriginalNotFound"));530			}531			m_EditDiffEqual.Text = ((object)val2).ToString();532			m_EditDiffNew.Text = ((object)val).ToString();533			m_EditDiffRemoved.Text = ((object)val3).ToString();534			m_TabPageRuleDiff.VisibleByUser = true;535			m_TabControl.SelectedTab = m_TabPageRuleDiff;536		}537	}538539	public void TaskCopy()540	{541		//IL_0069: Unknown result type (might be due to invalid IL or missing references)542		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)543		//IL_00ef: Invalid comparison between Unknown and I4544		ISingleDbObject dbObject = m_MainActivator.DbObject;545		if (dbObject == null)546		{547			return;548		}549		if (dbObject.IsChanged || !dbObject.IsLoaded || m_MainActivator.IsChanged)550		{551			FormTool.ShowMessage("POL_FormQERPolicyMasterData_Message_PleaseSaveFirst");552			return;553		}554		ISingleDbObject singleDbObject = SingleObject.Copy(dbObject);555		if (FormTool.ShowForm(base.ComponentContainer, m_FormDialogComponent, m_MainPanel, "FormQERPolicyCopyDialog", "QER_QERPolicyCopy_Dialog", singleDbObject).Item1 != UISnapInResultOption.Ok)556		{557			return;558		}559		using (new BusyIndicator(base.Session, BusyTime.Short))560		{561			Dictionary<string, object> obj = new Dictionary<string, object>();562			obj.Add("Ident_QERPolicy", (object)singleDbObject["Ident_QERPolicy"].New.String);563			Dictionary<string, object> val = obj;564			DbObjectKey key = (DbObjectKey)dbObject.Custom.CallMethod("Copy", val);565			ISingleDbObject dbObject2 = base.Session.Resolve<IConnection>().CreateSingle(key);566			if ((int)FormTool.ShowQuestion("POL_FormQERPolicyMasterData_Question_CopySuccessEdit", (MessageBoxButtons)4) == 6)567			{568				NavigateTo(dbObject2, "VI_QER_QERPolicy_MasterData");569			}570		}571	}572573	private void TaskShowCondition()574	{575		m_EditWhereClause.VisibleByUser = true;576		if (m_EditWhereClause.Height < 50)577		{578			m_EditWhereClause.Height = 50;579		}580		_AdaptTasks();581	}582583	private void TaskHideCondition()584	{585		m_EditWhereClause.VisibleByUser = false;586		_AdaptTasks();587	}588589	private void _AdaptTasks()590	{591		try592		{593			ISingleDbObject dbObject = m_MainActivator.DbObject;594			using (new UpdateHelper(base.Tasks))595			{596				if (dbObject == null)597				{598					base.Tasks["RecalculatePolicy"].Visible = false;599					base.Tasks["RecalculateAll"].Visible = false;600					base.Tasks["ShowResult"].Visible = false;601				}602				else603				{604					bool valueSafe = dbObject.GetValueSafe("IsWorkingCopy", defaultValue: true);605					bool flag = !dbObject.GetValueSafe("IsInActive", defaultValue: true);606					base.Tasks["RecalculatePolicy"].Visible = dbObject.IsLoaded && !valueSafe && flag;607					base.Tasks["RecalculateAll"].Visible = !valueSafe;608					base.Tasks["ShowResult"].Visible = !dbObject.GetValueSafe("IsNoWhereClause", defaultValue: true);609				}610				base.Tasks["ShowCondition"].Visible = !m_EditWhereClause.VisibleByUser;611				base.Tasks["HideCondition"].Visible = m_EditWhereClause.VisibleByUser;612			}613		}614		catch (System.Exception exception)615		{616			ExceptionMgr.Instance.HandleException(exception, this);617		}618	}619620	private void MainActivator_OnActivating(object sender, EventArgs e)621	{622		bool flag = false;623		try624		{625			_DisconnectUIEngineUserSettings();626			_AdaptBaseTableCombo();627			m_EditDiffEqual.Text = "";628			m_EditDiffNew.Text = "";629			m_EditDiffRemoved.Text = "";630			ISingleDbObject dbObject = m_MainActivator.DbObject;631			if (dbObject != null)632			{633				IVarContext variables = m_NewObjectButtonAERoleAttestator.Variables;634				string value = (m_TreeComboUIDAERoleAttestator.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "POL-AEROLE-QERPOLICY-ATTESTATOR" }));635				variables["ParentAERoleWhereClause"] = value;636				IVarContext variables2 = m_NewObjectButtonAERoleRuler.Variables;637				value = (m_TreeComboUIDAERoleRuler.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "POL-AEROLE-QERPOLICY-EXCEPTION" }));638				variables2["ParentAERoleWhereClause"] = value;639				IVarContext variables3 = m_NewObjectButtonAERoleResponsible.Variables;640				value = (m_TreeComboUIDAERoleResponsible.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "POL-AEROLE-QERPOLICY-RESPONSIBLE" }));641				variables3["ParentAERoleWhereClause"] = value;642				m_TreeComboBoxUIDDialogTable.WhereClause = base.SqlFormatter.AndRelation("NOT " + base.SqlFormatter.IsSystemPart("UID_DialogTable"), "NOT " + base.SqlFormatter.IsModuleOwner("UID_DialogTable", "UCI"), base.SqlFormatter.NotInClause("TableType", ValType.String, (System.Collections.IEnumerable)"B"), base.SqlFormatter.Comparison("IsDeactivatedByPreprocessor", false, ValType.Bool));643				m_TreeComboBoxUIDDialogScheduleFill.WhereClause = base.SqlFormatter.UidComparison("UID_DialogTableBelongsTo", dbObject.TableDef.Uid);644				m_TreeComboUIDDialogRichMailNewViolation.WhereClause = base.SqlFormatter.UidComparison("UID_DialogTableBaseObject", dbObject.TableDef.Uid);645				IEntity entity = dbObject.GetEntity();646				flag = dbObject.GetValueSafe("IsWorkingCopy", defaultValue: false) && entity.Columns["WhereClause"].CanSee;647			}648		}649		finally650		{651			m_TabControl.SelectedTab = m_TabPageCommon;652			base.Tasks["RuleDiff"].Visible = flag;653			if (!flag)654			{655				m_TabPageRuleDiff.VisibleByUser = false;656			}657			m_EditWhereClause.VisibleByUser = false;658			_AdaptTasks();659		}660	}661662	private void _AdaptBaseTableCombo()663	{664		UIEngineUserSettings uIEngineUserSettings = _GetUIEngineUserSettings();665		if (uIEngineUserSettings != null)666		{667			string text = (uIEngineUserSettings.UseTechnicalDisplays ? "%TableName%" : "%DisplayName% (%TableName%)");668			m_TreeComboBoxUIDDialogTable.DisplayPattern = text;669			m_TreeComboBoxUIDDialogTable.TreeDisplayFlatPattern = text;670			m_TreeComboBoxUIDDialogTable.TreeDisplayPattern = text;671		}672	}673674	private void ObjectChangeComponent_ColumnValueChanged(object sender, ColumnEventArgs e)675	{676		try677		{678			string text = e.Column.Columnname.ToLowerInvariant();679			if (!(text == "isnowhereclause"))680			{681				if (text == "uid_dialogtable")682				{683					_HandleWhereClauseEdit();684					base.Tasks["RuleDiff"].Enabled = e.New.String.Length > 0;685				}686			}687			else688			{689				m_TreeComboBoxUIDDialogTable.VisibleByUser = !e.New.Bool;690				_HandleWhereClauseEdit();691				_AdaptTasks();692			}693		}694		catch (System.Exception exception)695		{696			ExceptionMgr.Instance.HandleException(exception, this);697		}698	}699700	private void _HandleWhereClauseEdit()701	{702		ISingleDbObject dbObject = m_MainActivator.DbObject;703		bool flag = dbObject != null && dbObject["WhereClause"].CanEdit && !dbObject.GetValueSafe("IsNoWhereClause", defaultValue: true) && dbObject.GetValueSafe("UID_DialogTable", "").Length > 0;704		m_ButtonEditWhereClause.Enabled = flag;705		m_EditWhereClause.EnabledByUser = flag;706	}707708	private void ButtonEditWhereClause_Click(object sender, EventArgs e)709	{710		try711		{712			ISingleDbObject dbObject = m_MainActivator.DbObject;713			if (dbObject == null)714			{715				return;716			}717			using UsiWhereClauseWizard usiWhereClauseWizard = new UsiWhereClauseWizard(base.ComponentContainer);718			usiWhereClauseWizard.Session = base.Session;719			usiWhereClauseWizard.WhereClause = dbObject["WhereClause"].New.String;720			usiWhereClauseWizard.TableName = dbObject.ObjectWalker["FK(UID_DialogTable).TableName"].String;721			usiWhereClauseWizard.ShowGeneratedSql = false;722			usiWhereClauseWizard.ExpertMode = true;723			if (usiWhereClauseWizard.ShowModal() != UISnapInDialogResult.Cancel)724			{725				dbObject["WhereClause"].NewValue = usiWhereClauseWizard.WhereClause;726			}727		}728		catch (System.Exception exception)729		{730			ExceptionMgr.Instance.HandleException(exception, this);731		}732	}733}734