CPL.Forms/CPL.Forms/FormComplianceRuleMasterData.cs
Decompiler Source FileCPL.Forms.FormComplianceRuleMasterDataDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- CallMethod: RecalculateRule at line 305
- CallMethod: RecalculatePerson at line 322
- CallMethod: RecalculateAll at line 339
- CallMethod: Copy at line 487
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 writes entity values references DB/Dialog objects IT Shop related markers
Summary: classes FormComplianceRuleMasterData; methods OnInit, InitializeComponent, OnFormLoad, Task_RecalculateRule, Task_RecalculatePerson, Task_RecalculateAll; references AERole, ComplianceGroup, ComplianceRule, Department, DialogRichMail, DialogSchedule; markers reads entity values, writes entity values, references DB/Dialog objects, IT Shop related markers
Classes
FormComplianceRuleMasterDataMethods
DB/Dialog object references
OIM key/entity markers
UID_ParentAERole UID_OrgRoot UID_ComplianceRuleWork UID_ComplianceRule UID_Person UID_NonCompliance UID_DialogTableBelongsTo UID_DialogTableBaseObjectAPI/entity calls
GetValue PutValue CreateSingle Source From Comparison Config UidComparison MetaDataRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Linq;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.UI.Base.SnapIns;21using VI.UI.Controls.QER;2223namespace CPL.Forms;2425public class FormComplianceRuleMasterData : BaseCustomizer26{27 private IActivatorComponent m_MainActivator;2829 private ICheckBox m_CheckBoxisCurrentOrderOnly;3031 private ICheckBox m_CheckBoxIsExceptionAllowed;3233 private ICheckBox m_CheckBoxIsInactive;3435 private ICheckBox m_CheckBoxisToGrantEver;3637 private ICheckBox m_CheckBoxIsWorkingCopy;3839 private IDateButton m_ButtonDateLastAudit;4041 private IEdit m_EditDateLastAudit2;4243 private IEdit m_EditDescription;4445 private IEdit m_EditDiffEqual;4647 private IEdit m_EditDiffNew;4849 private IEdit m_EditDiffRemoved;5051 private IEdit m_EditExceptionMaxValidDays;5253 private IEdit m_EditExceptionNotes;5455 private IEdit m_EditIdentComplianceRule2;5657 private IEdit m_EditImplementationNotes;5859 private IEdit m_EditRemarksLastAudit;6061 private IEdit m_EditRiskDescription;6263 private IEdit m_EditRiskObjectives;6465 private IEdit m_EditRiskOrgMitigationCtrl;6667 private IEdit m_EditRiskScope;6869 private IEdit m_EditRuleNumber;7071 private IEdit m_EditRuleViolationThreshold;7273 private IEdit m_EditStateInfo;7475 private IEdit m_EditVersionMajor;7677 private IEdit m_EditVersionMinor;7879 private IEdit m_EditVersionPatch;8081 private IFormDialogComponent m_FormDialogComponent;8283 private INewObjectButton m_NewObjectButtonComplianceGroup;8485 private INewObjectButton m_NewObjectButtonOrgAttestator;8687 private INewObjectButton m_NewObjectButtonOrgResponsible;8889 private INewObjectButton m_NewObjectButtonOrgRuler;9091 private IRadioButton m_RadioButtonIsSimpleMode;9293 private IRadioButton m_RadioButtonIsSimpleModeNegate;9495 private ITabControl m_TabControl;9697 private ITabPage m_TabPageAssessmentCriteria;9899 private ITabPage m_TabPageCommon;100101 private ITabPage m_TabPageConditions;102103 private ITabPage m_TabPageDocumentation;104105 private ITabPage m_TabPageExtended;106107 private ITabPage m_TabPageITShop;108109 private ITabPage m_TabPageRuleDiff;110111 private ITextComboBox m_TextComboBoxDetectRuleTypeForPWO;112113 private ITextComboBox m_TextComboBoxSignificancyClass;114115 private ITrackBar m_TrackBarRiskIndex;116117 private ITrackBar m_TrackBarRiskIndexReduced;118119 private ITrackBar m_TrackBarTransparencyIndex;120121 private ITrackBar m_TrackBartRuleSeverity;122123 private ITreeComboBox m_TreeComboUIDComplianceGroup;124125 private ITreeComboBox m_TreeComboUIDDepartment;126127 private ITreeComboBox m_TreeComboUIDDialogRichMailNewViolation;128129 private ITreeComboBox m_TreeComboUIDDialogScheduleCheck;130131 private ITreeComboBox m_TreeComboUIDDialogScheduleFill;132133 private ITreeComboBox m_TreeComboUIDFunctionalArea;134135 private ITreeComboBox m_TreeComboUIDOrgAttestator;136137 private ITreeComboBox m_TreeComboUIDOrgResponsible;138139 private ITreeComboBox m_TreeComboUIDOrgRuler2;140141 private ITreeComboBox m_TreeComboUIDPersonLastAudit;142143 private IVIPanel m_MainPanel;144145 private IObjectChangeComponent m_ObjectChangeComponent;146147 private IComplianceRuleControl m_FilterDesigner;148149 private ICaptionLabel m_CaptionLabelFilterDesigner;150151 protected override void OnInit()152 {153 base.OnInit();154 try155 {156 m_ButtonDateLastAudit = base.Form.GetControl<IDateButton>("ButtonDateLastAudit");157 m_CheckBoxisCurrentOrderOnly = base.Form.GetControl<ICheckBox>("CheckBoxisCurrentOrderOnly");158 m_CheckBoxIsExceptionAllowed = base.Form.GetControl<ICheckBox>("CheckBoxIsExceptionAllowed");159 m_CheckBoxIsInactive = base.Form.GetControl<ICheckBox>("CheckBoxIsInactive");160 m_CheckBoxisToGrantEver = base.Form.GetControl<ICheckBox>("CheckBoxisToGrantEver");161 m_CheckBoxIsWorkingCopy = base.Form.GetControl<ICheckBox>("CheckBoxIsWorkingCopy");162 m_EditDateLastAudit2 = base.Form.GetControl<IEdit>("EditDateLastAudit2");163 m_EditDescription = base.Form.GetControl<IEdit>("EditDescription");164 m_EditDiffEqual = base.Form.GetControl<IEdit>("EditDiffEqual");165 m_EditDiffNew = base.Form.GetControl<IEdit>("EditDiffNew");166 m_EditDiffRemoved = base.Form.GetControl<IEdit>("EditDiffRemoved");167 m_EditExceptionMaxValidDays = base.Form.GetControl<IEdit>("EditExceptionMaxValidDays");168 m_EditExceptionNotes = base.Form.GetControl<IEdit>("EditExceptionNotes");169 m_EditIdentComplianceRule2 = base.Form.GetControl<IEdit>("EditIdentComplianceRule2");170 m_EditImplementationNotes = base.Form.GetControl<IEdit>("EditImplementationNotes");171 m_EditRemarksLastAudit = base.Form.GetControl<IEdit>("EditRemarksLastAudit");172 m_EditRiskDescription = base.Form.GetControl<IEdit>("EditRiskDescription");173 m_EditRiskObjectives = base.Form.GetControl<IEdit>("EditRiskObjectives");174 m_EditRiskOrgMitigationCtrl = base.Form.GetControl<IEdit>("EditRiskOrgMitigationCtrl");175 m_EditRiskScope = base.Form.GetControl<IEdit>("EditRiskScope");176 m_EditRuleNumber = base.Form.GetControl<IEdit>("EditRuleNumber");177 m_EditRuleViolationThreshold = base.Form.GetControl<IEdit>("EditRuleViolationThreshold");178 m_EditStateInfo = base.Form.GetControl<IEdit>("EditStateInfo");179 m_EditVersionMajor = base.Form.GetControl<IEdit>("EditVersionMajor");180 m_EditVersionMinor = base.Form.GetControl<IEdit>("EditVersionMinor");181 m_EditVersionPatch = base.Form.GetControl<IEdit>("EditVersionPatch");182 m_FormDialogComponent = base.Form.GetComponent<IFormDialogComponent>("FormDialogComponent");183 m_MainActivator = base.Form.GetComponent<IActivatorComponent>("MainActivator");184 m_MainPanel = base.Form.GetControl<IVIPanel>("MainPanel");185 m_NewObjectButtonComplianceGroup = base.Form.GetControl<INewObjectButton>("NewObjectButtonComplianceGroup");186 m_NewObjectButtonOrgAttestator = base.Form.GetControl<INewObjectButton>("NewObjectButtonOrgAttestator");187 m_NewObjectButtonOrgResponsible = base.Form.GetControl<INewObjectButton>("NewObjectButtonOrgResponsible");188 m_NewObjectButtonOrgRuler = base.Form.GetControl<INewObjectButton>("NewObjectButtonOrgRuler");189 m_ObjectChangeComponent = base.Form.GetComponent<IObjectChangeComponent>("ObjectChangeComponent");190 m_RadioButtonIsSimpleMode = base.Form.GetControl<IRadioButton>("RadioButtonIsSimpleMode");191 m_RadioButtonIsSimpleModeNegate = base.Form.GetControl<IRadioButton>("RadioButtonIsSimpleModeNegate");192 m_TabControl = base.Form.GetControl<ITabControl>("TabControl");193 m_TabPageAssessmentCriteria = base.Form.GetControl<ITabPage>("TabPageAssessmentCriteria");194 m_TabPageCommon = base.Form.GetControl<ITabPage>("TabPageCommon");195 m_TabPageConditions = base.Form.GetControl<ITabPage>("TabPageConditions");196 m_TabPageDocumentation = base.Form.GetControl<ITabPage>("TabPageDocumentation");197 m_TabPageExtended = base.Form.GetControl<ITabPage>("TabPageExtended");198 m_TabPageITShop = base.Form.GetControl<ITabPage>("TabPageITShop");199 m_TabPageRuleDiff = base.Form.GetControl<ITabPage>("TabPageRuleDiff");200 m_TextComboBoxDetectRuleTypeForPWO = base.Form.GetControl<ITextComboBox>("TextComboBoxDetectRuleTypeForPWO");201 m_TextComboBoxSignificancyClass = base.Form.GetControl<ITextComboBox>("TextComboBoxSignificancyClass");202 m_TrackBarRiskIndex = base.Form.GetControl<ITrackBar>("TrackBarRiskIndex");203 m_TrackBarRiskIndexReduced = base.Form.GetControl<ITrackBar>("TrackBarRiskIndexReduced");204 m_TrackBarTransparencyIndex = base.Form.GetControl<ITrackBar>("TrackBarTransparencyIndex");205 m_TrackBartRuleSeverity = base.Form.GetControl<ITrackBar>("TrackBartRuleSeverity");206 m_TreeComboUIDComplianceGroup = base.Form.GetControl<ITreeComboBox>("TreeComboUIDComplianceGroup");207 m_TreeComboUIDDepartment = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDepartment");208 m_TreeComboUIDDialogRichMailNewViolation = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogRichMailNewViolation");209 m_TreeComboUIDDialogScheduleCheck = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogScheduleCheck");210 m_TreeComboUIDDialogScheduleFill = base.Form.GetControl<ITreeComboBox>("TreeComboUIDDialogScheduleFill");211 m_TreeComboUIDFunctionalArea = base.Form.GetControl<ITreeComboBox>("TreeComboUIDFunctionalArea");212 m_TreeComboUIDOrgAttestator = base.Form.GetControl<ITreeComboBox>("TreeComboUIDOrgAttestator");213 m_TreeComboUIDOrgResponsible = base.Form.GetControl<ITreeComboBox>("TreeComboUIDOrgResponsible");214 m_TreeComboUIDOrgRuler2 = base.Form.GetControl<ITreeComboBox>("TreeComboUIDOrgRuler2");215 m_TreeComboUIDPersonLastAudit = base.Form.GetControl<ITreeComboBox>("TreeComboUIDPersonLastAudit");216 m_CaptionLabelFilterDesigner = base.Form.GetControl<ICaptionLabel>("CaptionLabelFilterDesigner");217 m_FilterDesigner = base.Form.GetControl<IComplianceRuleControl>("FilterDesigner");218 m_NewObjectButtonOrgResponsible.SetUpNewObjectAction = delegate(ISingleDbObject newObject)219 {220 newObject.SetValueSafe("UID_ParentAERole", "CPL-9667F18E2E85452E82DEF67949372855");221 newObject.SetValueSafe("UID_OrgRoot", "QER-V-AERole");222 };223 m_NewObjectButtonOrgRuler.SetUpNewObjectAction = delegate(ISingleDbObject newObject)224 {225 newObject.SetValueSafe("UID_ParentAERole", "CPL-19F059811C9D4C98900E93F52CF867DF");226 newObject.SetValueSafe("UID_OrgRoot", "QER-V-AERole");227 };228 m_EditVersionMajor.Width = 240;229 m_EditVersionMinor.Width = 60;230 m_EditVersionPatch.Width = 60;231 m_RadioButtonIsSimpleMode.Width += 100;232 m_RadioButtonIsSimpleModeNegate.Width += 100;233 }234 catch (System.Exception innerException)235 {236 throw new FormCustomizerException(874825, innerException, ((object)this).ToString());237 }238 }239240 private void InitializeComponent()241 {242 }243244 protected override void OnFormLoad()245 {246 m_TabPageCommon.Caption = "CPL_FormCommon_General";247 m_TabPageExtended.Caption = "CPL_FormComplianceRuleMasterData_TabPage_Extended";248 m_TabPageRuleDiff.Caption = "CPL_FormComplianceRuleMasterData_TabPage_RuleDiff";249 m_TabPageITShop.Caption = "CPL_FormComplianceRuleMasterData_TabPage_ITShop";250 m_TabPageAssessmentCriteria.Caption = "CPL_FormComplianceRuleMasterData_TabPage_AssessmentCriteria";251 m_TabPageDocumentation.Caption = "CPL_FormComplianceRuleMasterData_TabPage_Documentation";252 m_TabPageConditions.Caption = "CPL_FormComplianceRuleMasterData_FilterDesigner";253 m_CaptionLabelFilterDesigner.Caption = "";254 m_RadioButtonIsSimpleMode.Caption = "CPL_FormComplianceRuleMasterData_Option_IsSimpleMode";255 m_RadioButtonIsSimpleModeNegate.Caption = "CPL_FormComplianceRuleMasterData_Option_IsSimpleModeNegate";256 m_TabPageRuleDiff.VisibleByUser = false;257 using (new UpdateHelper(base.Tasks))258 {259 Task task = base.Tasks["RecalculateRule"];260 task.TaskMethod = Task_RecalculateRule;261 task.Caption = "CPL_FormComplianceRuleMasterData_Task_RecalculateRule";262 task.StockImage = StockImage.Refresh;263 task.Enabled = true;264 task.Visible = false;265 Task task2 = base.Tasks["RecalculatePerson"];266 task2.TaskMethod = Task_RecalculatePerson;267 task2.Caption = "CPL_FormComplianceRuleMasterData_Task_RecalculatePerson";268 task2.StockImage = StockImage.Refresh;269 task2.Enabled = true;270 task2.Visible = false;271 Task task3 = base.Tasks["RecalculateAll"];272 task3.TaskMethod = Task_RecalculateAll;273 task3.Caption = "CPL_FormComplianceRuleMasterData_Task_RecalculateAll";274 task3.StockImage = StockImage.Refresh;275 task3.Enabled = true;276 task3.Visible = false;277 Task task4 = base.Tasks["RuleDiff"];278 task4.TaskMethod = Task_RuleDiff;279 task4.Caption = "CPL_FormComplianceRuleMasterData_Task_DiffRule";280 task4.StockImage = StockImage.RemoveRow;281 task4.Enabled = true;282 task4.Visible = false;283 Task task5 = base.Tasks["EnablePlainSQL"];284 task5.TaskMethod = Task_EnablePlainSQL;285 task5.Caption = "CPL_FormComplianceRuleMasterData_Task_EnablePlainSQL";286 task5.StockImage = StockImage.TextDocument;287 task5.Enabled = true;288 task5.Visible = false;289 Task task6 = base.Tasks["Copy"];290 task6.TaskMethod = TaskCopy;291 task6.Caption = "CPL_FormComplianceRuleCopyDialog_FormTitle";292 task6.StockImage = StockImage.Copy;293 task6.Enabled = true;294 task6.Visible = true;295 }296 }297298 public void Task_RecalculateRule()299 {300 try301 {302 ISingleDbObject dbObject = m_MainActivator.DbObject;303 if (dbObject != null)304 {305 dbObject.Custom.CallMethod("RecalculateRule");306 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_RecalculateSuccessfullySaved");307 }308 }309 catch (System.Exception innerException)310 {311 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Task_RecalculateRule").Replace("&", "")), this);312 }313 }314315 public void Task_RecalculatePerson()316 {317 try318 {319 ISingleDbObject dbObject = m_MainActivator.DbObject;320 if (dbObject != null)321 {322 dbObject.Custom.CallMethod("RecalculatePerson");323 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_RecalculateSuccessfullySaved");324 }325 }326 catch (System.Exception innerException)327 {328 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Task_RecalculatePerson").Replace("&", "")), this);329 }330 }331332 public void Task_RecalculateAll()333 {334 try335 {336 ISingleDbObject dbObject = m_MainActivator.DbObject;337 if (dbObject != null)338 {339 dbObject.Custom.CallMethod("RecalculateAll");340 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_RecalculateSuccessfullySaved");341 }342 }343 catch (System.Exception innerException)344 {345 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Task_RecalculateAll").Replace("&", "")), this);346 }347 }348349 public void Task_EnablePlainSQL()350 {351 try352 {353 if (m_MainActivator.DbObject != null)354 {355 m_FilterDesigner.ForceRawSql = true;356 m_FilterDesigner.ReloadData();357 }358 }359 catch (System.Exception innerException)360 {361 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Task_RecalculateAll").Replace("&", "")), this);362 }363 }364365 public void Task_RuleDiff()366 {367 try368 {369 m_EditDiffEqual.Text = "";370 m_EditDiffNew.Text = "";371 m_EditDiffRemoved.Text = "";372 ISingleDbObject dbobject = m_MainActivator.DbObject;373 if (dbobject == null)374 {375 return;376 }377 m_FilterDesigner.WriteBack();378 string text = base.Session.Source().GetSingleValue<string>("ComplianceRule", "WhereClause", dbobject.PKWhereClause);379 if (text.Length == 0)380 {381 text = "1=1";382 }383 Query query = (from t in Query.From("ComplianceRule")384 where t.Column("UID_ComplianceRuleWork") == dbobject.GetValue<string>("UID_ComplianceRule")385 select t).Select("WhereClause");386 IEntityCollection collection = base.Session.Source().GetCollection(query, EntityCollectionLoadType.Slim);387 if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count != 1)388 {389 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_DiffImposibleBecauseOriginalNotFound");390 return;391 }392 string value = ((System.Collections.Generic.IReadOnlyList<IEntity>)collection)[0].GetValue<string>("WhereClause");393 IEqualityComparer<IEntity> val = GenericEqualityComparer.Create<IEntity>((IEntity e1, IEntity e2) => e1.GetValue<string>("UID_Person") == e2.GetValue<string>("UID_Person"), (IEntity entity) => ((object)entity.GetValue<string>("UID_Person")).GetHashCode());394 IEntityCollection collection2 = base.Session.Source().GetCollection(Query.From("Person").Where(value).Select("firstname", "lastname"), EntityCollectionLoadType.Slim);395 IEntityCollection collection3 = base.Session.Source().GetCollection(Query.From("Person").Where(text).Select("firstname", "lastname"), EntityCollectionLoadType.Slim);396 if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count != 1)397 {398 System.Collections.Generic.IEnumerable<IEntity> entities = Enumerable.Except<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)collection3, (System.Collections.Generic.IEnumerable<IEntity>)collection2, val);399 m_EditDiffNew.Text = GenerateRuleDiffList(entities);400 m_EditDiffEqual.Text = BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Message_DiffImposibleBecauseOriginalNotFound");401 m_EditDiffRemoved.Text = BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Message_DiffImposibleBecauseOriginalNotFound");402 }403 else404 {405 System.Collections.Generic.IEnumerable<IEntity> entities2 = Enumerable.Except<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)collection3, (System.Collections.Generic.IEnumerable<IEntity>)collection2, val);406 m_EditDiffNew.Text = GenerateRuleDiffList(entities2);407 System.Collections.Generic.IEnumerable<IEntity> entities3 = Enumerable.Intersect<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)collection2, (System.Collections.Generic.IEnumerable<IEntity>)collection3, val);408 m_EditDiffEqual.Text = GenerateRuleDiffList(entities3);409 System.Collections.Generic.IEnumerable<IEntity> entities4 = Enumerable.Except<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)collection2, (System.Collections.Generic.IEnumerable<IEntity>)collection3, val);410 m_EditDiffRemoved.Text = GenerateRuleDiffList(entities4);411 }412 m_TabPageRuleDiff.VisibleByUser = true;413 m_TabControl.SelectedTab = m_TabPageRuleDiff;414 }415 catch (System.Exception innerException)416 {417 ExceptionMgr.Instance.HandleException((System.Exception)(object)new FormCustomizerException(929001, innerException, BaseCustomizer.GetString("CPL_FormComplianceRuleMasterData_Task_DiffRule").Replace("&", "")), this);418 }419 }420421 private string GenerateRuleDiffList(System.Collections.Generic.IEnumerable<IEntity> entities)422 {423 //IL_0000: Unknown result type (might be due to invalid IL or missing references)424 //IL_0006: Expected O, but got Unknown425 StringBuilder val = new StringBuilder();426 int num = 0;427 System.Collections.Generic.IEnumerator<IEntity> enumerator = entities.GetEnumerator();428 try429 {430 while (((System.Collections.IEnumerator)enumerator).MoveNext())431 {432 IEntity current = enumerator.Current;433 val.AppendFormat("{0} {1}{2}", (object)current.GetValue<string>("lastname"), (object)current.GetValue<string>("firstname"), (object)Environment.NewLine);434 num++;435 }436 }437 finally438 {439 ((System.IDisposable)enumerator)?.Dispose();440 }441 if (val.Length > 0)442 {443 val.AppendLine();444 val.AppendLine();445 }446 LanguageManager instance = LanguageManager.Instance;447 object obj = num;448 val.Append(instance.FormatString("CPL_FormComplianceRuleMasterData_Message_RecordsEffected", new System.ReadOnlySpan<object>(ref obj)));449 return ((object)val).ToString();450 }451452 public void TaskCopy()453 {454 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)455 //IL_0171: Unknown result type (might be due to invalid IL or missing references)456 //IL_0177: Invalid comparison between Unknown and I4457 ISingleDbObject dbObject = m_MainActivator.DbObject;458 if (dbObject == null)459 {460 return;461 }462 if (dbObject.IsChanged || !dbObject.IsLoaded || m_MainActivator.IsChanged)463 {464 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_PleaseSaveFirst");465 return;466 }467 ISingleDbObject singleDbObject = SingleObject.Copy(dbObject, "UID_NonCompliance");468 string text = dbObject.GetValue<string>("Ident_ComplianceRule") + "_" + LanguageManager.Instance.GetString("CPL_FormComplianceRuleCopy");469 int num = 0;470 string text2 = "";471 while (base.Session.Source().Exists(dbObject.Tablename, base.SqlFormatter.Comparison("Ident_ComplianceRule", text + text2, ValType.String)))472 {473 num++;474 text2 = num.ToString();475 }476 singleDbObject.PutValue("Ident_ComplianceRule", text + text2);477 if (FormTool.ShowForm(base.ComponentContainer, m_FormDialogComponent, m_MainPanel, "FormComplianceRuleCopyDialog", "CPL_ComplianceRuleCopy_Dialog", singleDbObject).Item1 != UISnapInResultOption.Ok)478 {479 return;480 }481 IConnection connection = dbObject.Connection;482 using (new BusyIndicator(connection, BusyTime.Short))483 {484 Dictionary<string, object> obj = new Dictionary<string, object>();485 obj.Add("Ident_ComplianceRule", (object)singleDbObject["Ident_ComplianceRule"].New.String);486 Dictionary<string, object> val = obj;487 DbObjectKey key = (DbObjectKey)dbObject.Custom.CallMethod("Copy", val);488 ISingleDbObject dbObject2 = connection.CreateSingle(key);489 if ((int)FormTool.ShowQuestion("CPL_FormComplianceRuleMasterData_Question_CopySuccessEdit", (MessageBoxButtons)4) == 6)490 {491 NavigateTo(dbObject2, "VI_Compliance_ComplianceRule_MasterData");492 }493 }494 }495496 private void _AdaptTasks()497 {498 try499 {500 ISingleDbObject dbObject = m_MainActivator.DbObject;501 using (new UpdateHelper(base.Tasks))502 {503 base.Tasks["RecalculatePerson"].Visible = !string.IsNullOrEmpty(base.Session?.User().Uid);504 if (dbObject == null)505 {506 base.Tasks["RecalculateRule"].Visible = false;507 base.Tasks["RecalculateAll"].Visible = false;508 base.Tasks["EnablePlainSQL"].Visible = false;509 }510 else511 {512 bool valueSafe = dbObject.GetValueSafe("IsWorkingCopy", defaultValue: true);513 bool flag = !dbObject.GetValueSafe("IsInActive", defaultValue: true);514 base.Tasks["RecalculateRule"].Visible = dbObject.IsLoaded && !valueSafe && flag;515 base.Tasks["RecalculateAll"].Visible = !valueSafe;516 base.Tasks["EnablePlainSQL"].Visible = valueSafe && !dbObject.GetValueSafe("IsSimpleMode", defaultValue: true) && base.Session.Config().GetConfigParm("QER\\ComplianceCheck\\PlainSQL") == "1";517 }518 }519 }520 catch (System.Exception exception)521 {522 ExceptionMgr.Instance.HandleException(exception, this);523 }524 }525526 private void MainActivator_OnActivating(object sender, EventArgs e)527 {528 bool flag = false;529 try530 {531 _AdaptTasks();532 m_EditDiffEqual.Text = "";533 m_EditDiffNew.Text = "";534 m_EditDiffRemoved.Text = "";535 ISingleDbObject dbObject = m_MainActivator.DbObject;536 if (dbObject != null)537 {538 m_TabPageITShop.VisibleByUser = base.Session.Config().GetConfigParm("QER\\ComplianceCheck\\EnableITSettingsForRule") == "1";539 IVarContext variables = m_NewObjectButtonOrgResponsible.Variables;540 string value = (m_TreeComboUIDOrgResponsible.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "CPL-AEROLE-RULEADMIN-RESPONSIBLE" }));541 variables["ParentAERoleWhereClause"] = value;542 IVarContext variables2 = m_NewObjectButtonOrgRuler.Variables;543 value = (m_TreeComboUIDOrgRuler2.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "CPL-AEROLE-RULEADMIN-EXCEPTION" }));544 variables2["ParentAERoleWhereClause"] = value;545 IVarContext variables3 = m_NewObjectButtonOrgAttestator.Variables;546 value = (m_TreeComboUIDOrgAttestator.WhereClause = Attestation.BuildAERoleFilterClause(base.Session, new string[1] { "CPL-AEROLE-RULEADMIN-ATTESTATOR" }));547 variables3["ParentAERoleWhereClause"] = value;548 ITreeComboBox treeComboUIDDialogScheduleFill = m_TreeComboUIDDialogScheduleFill;549 value = (m_TreeComboUIDDialogScheduleCheck.WhereClause = base.SqlFormatter.UidComparison("UID_DialogTableBelongsTo", base.Session.MetaData().GetTable("ComplianceRule").Uid));550 treeComboUIDDialogScheduleFill.WhereClause = value;551 m_TreeComboUIDDialogRichMailNewViolation.WhereClause = base.SqlFormatter.UidComparison("UID_DialogTableBaseObject", base.Session.MetaData().GetTable("ComplianceRule").Uid);552 flag = dbObject.GetValueSafe("IsWorkingCopy", defaultValue: false) && dbObject.GetEntity().Columns["WhereClause"].CanSee;553 IRadioButton radioButtonIsSimpleMode = m_RadioButtonIsSimpleMode;554 bool visibleByUser = (m_RadioButtonIsSimpleModeNegate.VisibleByUser = base.Session.Config().GetConfigParm("QER\\ComplianceCheck\\SimpleMode\\NonSimpleAllowed").Length > 0);555 radioButtonIsSimpleMode.VisibleByUser = visibleByUser;556 m_FilterDesigner.ForceRawSql = false;557 }558 }559 catch (System.Exception exception)560 {561 ExceptionMgr.Instance.HandleException(exception, this);562 }563 finally564 {565 m_TabControl.SelectedTab = m_TabPageCommon;566 if (!flag)567 {568 m_TabPageRuleDiff.VisibleByUser = false;569 }570 base.Tasks["RuleDiff"].Visible = flag;571 }572 }573574 private void ObjectChangeComponent_ColumnValueChanged(object sender, ColumnEventArgs e)575 {576 try577 {578 if (m_MainActivator.DbObject == null)579 {580 return;581 }582 string text = e.Column.Columnname.ToLowerInvariant();583 if (!(text == "isexceptionallowed"))584 {585 if (text == "issimplemode")586 {587 _AdaptTasks();588 m_TabPageITShop.VisibleByUser = e.New.Bool && base.Session.Config().GetConfigParm("QER\\ComplianceCheck\\EnableITSettingsForRule") == "1";589 }590 }591 else if (e.Old.Bool && !e.New.Bool)592 {593 FormTool.ShowMessage("CPL_FormComplianceRuleMasterData_Message_IsExceptionAllowedChanged", e.Column.ColDef.Display);594 }595 }596 catch (System.Exception exception)597 {598 ExceptionMgr.Instance.HandleException(exception, this);599 }600 }601602 private void MainActivator_Saved(object sender, EventArgs e)603 {604 try605 {606 ISingleDbObject dbObject = m_MainActivator.DbObject;607 if (dbObject.IsChanged)608 {609 dbObject.Save();610 dbObject.Load();611 return;612 }613 DbObjectKey dbObjectKey = new DbObjectKey(dbObject);614 if (!dbObject.IsLoaded)615 {616 dbObject.Save();617 }618 dbObject.Clear();619 dbObjectKey.FillObject(dbObject);620 dbObject.Load();621 }622 catch (System.Exception exception)623 {624 ExceptionMgr.Instance.HandleException(exception, this);625 }626 }627}628