QER.Forms/QER.Forms/FormITShopAssistant.cs
Decompiler Source FileQER.Forms.FormITShopAssistantDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- Generate: DeleteBoard at line 198
- UnitOfWork.Generate: DeleteBoard at line 198
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 FormITShopAssistant, ShopInfo; methods OnInit, _ApplyChanges, _FireEventOfDependedProducts, _GetFilterWhereClause, _LoadListViewFixedAssignments, _LoadListViewShops; references ITShopOrg, ITShopSrc, OrgRoot, OrgType; markers reads entity values, writes entity values, references DB/Dialog objects, IT Shop related markers
Classes
FormITShopAssistant ShopInfoMethods
- OnInit
- _ApplyChanges
- _FireEventOfDependedProducts
- _GetFilterWhereClause
- _LoadListViewFixedAssignments
- _LoadListViewShops
- _LoadTemplateCombo
- InitializeComponent
- MainActivator_OnActivating
- ComboTemplate_OnSelectionChangeCommitted
- CommandApply_OnClick
- CommandChooseAll_OnClick
- CommandChooseNone_OnClick
- CommandInvertSelected_OnClick
- _SwitchTreeListShopsCheckboxes
- OnFormSizeChanged
- MainActivator_OnActivated
OIM key/entity markers
UID_ITShopSrc UID_ParentITShopSrc UID_OrgBoardTemplate UID_ParentITShopOrg UID_OrgType UID_ITShopOrg UID_OrgRootAPI/entity calls
GetValue CreateNew PutValue AndRelation Comparison UidComparison From Source StartUnitOfWork GetValue MetaData InlineFunctionCall MaskLikeSpecialChars CleanWhereClauseRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Data;5using System.Linq;6using System.Runtime.CompilerServices;7using System.Windows.Forms;8using VI.Base;9using VI.Controls;10using VI.Controls.Interfaces;11using VI.DB;12using VI.DB.DataAccess;13using VI.DB.Entities;14using VI.DB.Sync;15using VI.FormBase;16using VI.FormCustomizers;17using VI.FormTools;1819namespace QER.Forms;2021public class FormITShopAssistant : BaseCustomizer22{23 private class ShopInfo24 {25 [field: CompilerGenerated]26 public string UIDOrg27 {28 [CompilerGenerated]29 get;30 }3132 [field: CompilerGenerated]33 public bool Assigned34 {35 [CompilerGenerated]36 get;37 [CompilerGenerated]38 set;39 }4041 [field: CompilerGenerated]42 public bool IsShoppingCenter43 {44 [CompilerGenerated]45 get;46 }4748 public ShopInfo(string uidOrg, bool assigned, bool isShoppingCenter)49 {50 Assigned = assigned;51 IsShoppingCenter = isShoppingCenter;52 UIDOrg = uidOrg;53 }54 }5556 private string[] _dependenttables;5758 private const string ConstColumnIdTree = "Tree";5960 private const string ConstColumnIdTreeCheck = "TreeCheck";6162 private IActivatorComponent m_MainActivator;6364 private IButton m_CommandApply;6566 private IButton m_CommandChooseAll;6768 private IButton m_CommandChooseNone;6970 private IButton m_CommandInvertSelected;7172 private ICaptionLabel m_LabelFilter;7374 private ICaptionLabel m_LabelTemplate;7576 private INetComboBox m_ComboTemplate;7778 private ITreeListControl m_TreeListFixedAssignments;7980 private ITreeListControl m_TreeListShops;8182 private INetTextBox m_TextFilter;8384 private ITabControl m_FormHeader;8586 private ITabPage m_TabPage1;8788 private ITabPage m_TabPage2;8990 private IVIPanel m_MainPanel;9192 protected override void OnInit()93 {94 base.OnInit();95 try96 {97 m_ComboTemplate = base.Form.GetControl<INetComboBox>("ComboTemplate");98 m_CommandApply = base.Form.GetControl<IButton>("CommandApply");99 m_CommandChooseAll = base.Form.GetControl<IButton>("CommandChooseAll");100 m_CommandChooseNone = base.Form.GetControl<IButton>("CommandChooseNone");101 m_CommandInvertSelected = base.Form.GetControl<IButton>("CommandInvertSelected");102 m_FormHeader = base.Form.GetControl<ITabControl>("FormHeader");103 m_LabelFilter = base.Form.GetControl<ICaptionLabel>("LabelFilter");104 m_LabelTemplate = base.Form.GetControl<ICaptionLabel>("LabelTemplate");105 m_TreeListFixedAssignments = base.Form.GetControl<ITreeListControl>("TreeListFixedAssignments");106 m_TreeListShops = base.Form.GetControl<ITreeListControl>("TreeListShops");107 m_MainActivator = base.Form.GetComponent<IActivatorComponent>("MainActivator");108 m_MainPanel = base.Form.GetControl<IVIPanel>("MainPanel");109 m_TabPage1 = base.Form.GetControl<ITabPage>("TabPage1");110 m_TabPage2 = base.Form.GetControl<ITabPage>("TabPage2");111 m_TextFilter = base.Form.GetControl<INetTextBox>("TextFilter");112 ITreeListControl treeListShops = m_TreeListShops;113 ITreeListControl treeListShops2 = m_TreeListShops;114 ITreeListControl treeListFixedAssignments = m_TreeListFixedAssignments;115 ITreeListControl treeListFixedAssignments2 = m_TreeListFixedAssignments;116 ITreeListControl treeListShops3 = m_TreeListShops;117 bool flag = (m_TreeListFixedAssignments.ShowHeader = false);118 bool flag3 = (treeListShops3.ShowHeader = flag);119 bool flag5 = (treeListFixedAssignments2.ShowRootLines = flag3);120 bool flag7 = (treeListFixedAssignments.ShowLines = flag5);121 bool showRootLines = (treeListShops2.ShowLines = flag7);122 treeListShops.ShowRootLines = showRootLines;123 ITreeListControl treeListShops4 = m_TreeListShops;124 showRootLines = (m_TreeListFixedAssignments.ShowNodeImages = false);125 treeListShops4.ShowNodeImages = showRootLines;126 m_TreeListShops.Proxy.AddColumn("", 0, "");127 m_TreeListShops.Proxy.AddColumn("", 25, "TreeCheck");128 m_TreeListShops.Proxy.AddColumn("", 300, "Tree");129 }130 catch (System.Exception innerException)131 {132 throw new FormCustomizerException(874825, innerException, ((object)this).ToString());133 }134 }135136 private void _ApplyChanges()137 {138 //IL_0034: Unknown result type (might be due to invalid IL or missing references)139 //IL_040e: Unknown result type (might be due to invalid IL or missing references)140 //IL_0413: Unknown result type (might be due to invalid IL or missing references)141 //IL_0419: Unknown result type (might be due to invalid IL or missing references)142 //IL_041e: Unknown result type (might be due to invalid IL or missing references)143 if (m_MainActivator.DbObject == null || m_ComboTemplate.SelectedItem == null)144 {145 return;146 }147 if (!(m_ComboTemplate.SelectedItem is IEntity entity))148 {149 throw new ArgumentException("SelectedItem");150 }151 string value = entity.GetValue<string>("UID_ITShopSrc");152 Dictionary<ITreeListNode, System.Exception> val = new Dictionary<ITreeListNode, System.Exception>();153 using (new BusyIndicator(base.Session, BusyTime.Normal))154 {155 foreach (ITreeListNode item in (System.Collections.IEnumerable)m_TreeListShops.Proxy.GetNodes())156 {157 if (!(item.Data is ShopInfo shopInfo))158 {159 continue;160 }161 bool flag = (bool)m_TreeListShops.Proxy.GetItem(item, 0).Data;162 if (shopInfo.Assigned == flag)163 {164 continue;165 }166 try167 {168 if (shopInfo.Assigned)169 {170 if (shopInfo.IsShoppingCenter)171 {172 string whereClause = base.SqlFormatter.AndRelation(base.SqlFormatter.Comparison("ITShopInfo", "BO", ValType.String), base.SqlFormatter.UidComparison("UID_ParentITShopSrc", shopInfo.UIDOrg), base.SqlFormatter.UidComparison("UID_OrgBoardTemplate", value));173 Query query = Query.From("ITShopSrc").Where(whereClause).SelectNone();174 System.Collections.Generic.IEnumerator<IEntity> enumerator2 = ((System.Collections.Generic.IEnumerable<IEntity>)base.Session.Source().GetCollection(query, EntityCollectionLoadType.Bulk)).GetEnumerator();175 try176 {177 while (((System.Collections.IEnumerator)enumerator2).MoveNext())178 {179 enumerator2.Current.DeepDelete(base.Session).Execute(base.Session);180 }181 }182 finally183 {184 ((System.IDisposable)enumerator2)?.Dispose();185 }186 }187 else188 {189 string whereClause2 = base.SqlFormatter.AndRelation(base.SqlFormatter.Comparison("ITShopInfo", "BO", ValType.String), base.SqlFormatter.UidComparison("UID_OrgBoardTemplate", value), base.SqlFormatter.UidComparison("UID_ParentITShopOrg", shopInfo.UIDOrg));190 Query query2 = Query.From("ITShopOrg").Where(whereClause2).SelectNone();191 using IUnitOfWork unitOfWork = base.Session.StartUnitOfWork();192 System.Collections.Generic.IEnumerator<IEntity> enumerator2 = ((System.Collections.Generic.IEnumerable<IEntity>)base.Session.Source().GetCollection(query2, EntityCollectionLoadType.Bulk)).GetEnumerator();193 try194 {195 while (((System.Collections.IEnumerator)enumerator2).MoveNext())196 {197 IEntity current = enumerator2.Current;198 unitOfWork.Generate(current, "DeleteBoard");199 }200 }201 finally202 {203 ((System.IDisposable)enumerator2)?.Dispose();204 }205 unitOfWork.Commit();206 }207 }208 else209 {210 IEntity entity2 = base.Session.Source().CreateNew(shopInfo.IsShoppingCenter ? "ITShopSrc" : "ITShopOrg");211 entity2.PutValue("Ident_Org", entity.GetValue("Ident_Org").Value);212 entity2.PutValue("UID_OrgBoardTemplate", entity.GetValue("UID_ITShopSrc").Value);213 entity2.PutValue(shopInfo.IsShoppingCenter ? "UID_ParentITShopSrc" : "UID_ParentITShopOrg", shopInfo.UIDOrg);214 entity2.PutValue("itshopinfo", "BO");215 entity2.PutValue("UID_OrgType", entity.GetValue("UID_OrgType").Value);216 entity2.PutValue("IsCutNode", entity.GetValue("IsCutNode").Value);217 entity2.PutValue("Description", entity.GetValue("Description").Value);218 entity2.PutValue("InternalName", entity.GetValue("InternalName").Value);219 entity2.PutValue("Commentary", entity.GetValue("Commentary").Value);220 entity2.Save(base.Session);221 _FireEventOfDependedProducts(entity, "Insert");222 }223 shopInfo.Assigned = !shopInfo.Assigned;224 }225 catch (System.Exception ex)226 {227 val[item] = ex;228 }229 }230 }231 Enumerator<ITreeListNode, System.Exception> enumerator3 = val.GetEnumerator();232 try233 {234 while (enumerator3.MoveNext())235 {236 KeyValuePair<ITreeListNode, System.Exception> current2 = enumerator3.Current;237 ExceptionMgr.Instance.HandleException(current2.Value, current2.Key);238 }239 }240 finally241 {242 ((System.IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose();243 }244 }245246 private void _FireEventOfDependedProducts(IEntity org, string evnt)247 {248 try249 {250 using (new BusyIndicator(base.Session, BusyTime.Short))251 {252 string whereClause = base.SqlFormatter.UidComparison("UID_ITShopSrc", org.GetValue<string>("UID_ITShopSrc"));253 using IUnitOfWork unitOfWork = base.Session.StartUnitOfWork();254 System.Collections.Generic.IEnumerator<string> enumerator = Enumerable.Where<string>((System.Collections.Generic.IEnumerable<string>)_dependenttables, (Func<string, bool>)([CompilerGenerated] (string t) => base.Session.MetaData().GetTables().Contains(t))).GetEnumerator();255 try256 {257 while (((System.Collections.IEnumerator)enumerator).MoveNext())258 {259 string current = enumerator.Current;260 if (base.Session.MetaData().GetTable(current).IsDeactivated)261 {262 continue;263 }264 Query query = Query.From(current).Where(whereClause).SelectNone();265 System.Collections.Generic.IEnumerator<IEntity> enumerator2 = ((System.Collections.Generic.IEnumerable<IEntity>)base.Session.Source().GetCollection(query, EntityCollectionLoadType.Bulk)).GetEnumerator();266 try267 {268 while (((System.Collections.IEnumerator)enumerator2).MoveNext())269 {270 IEntity current2 = enumerator2.Current;271 unitOfWork.Generate(current2, evnt);272 }273 }274 finally275 {276 ((System.IDisposable)enumerator2)?.Dispose();277 }278 }279 }280 finally281 {282 ((System.IDisposable)enumerator)?.Dispose();283 }284 unitOfWork.Commit();285 }286 }287 catch (System.Exception exception)288 {289 ExceptionMgr.Instance.HandleException(exception, this);290 }291 }292293 private string _GetFilterWhereClause()294 {295 try296 {297 m_TextFilter.Text = m_TextFilter.Text.Trim();298 if (m_TextFilter.Text.Length == 0)299 {300 return "(1=1)";301 }302 return string.Format("UID_ITShopOrg in (select UID_ITShopOrg from {0})", (object)base.SqlFormatter.InlineFunctionCall(new SqlFunction("QER", "QER", "FTITShopOrgByIdentOrg")303 {304 TableFunction = true305 }, "'" + base.SqlFormatter.MaskLikeSpecialChars(base.SqlFormatter.CleanWhereClause(m_TextFilter.Text)) + "'"));306 }307 catch (System.Exception exception)308 {309 ExceptionMgr.Instance.HandleException(exception, this);310 return "1=2";311 }312 }313314 private void _LoadListViewFixedAssignments(IEntity board)315 {316 try317 {318 ITreeListProxy proxy = m_TreeListFixedAssignments.Proxy;319 proxy.Clear();320 if (m_MainActivator.DbObject == null || m_ComboTemplate.SelectedIndex < 0)321 {322 return;323 }324 ISqlFormatter sqlFormatter = base.SqlFormatter;325 string value = board.GetValue<string>("UID_ITShopSrc");326 string[] obj = new string[3]327 {328 _GetFilterWhereClause(),329 sqlFormatter.Comparison("ITShopInfo", "SH", ValType.String),330 null331 };332 global::_003C_003Ey__InlineArray7<object> buffer = default(global::_003C_003Ey__InlineArray7<object>);333 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 0) = sqlFormatter.FormatColumnname("UID_ITShopOrg", forComparisons: true, ValType.String);334 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 1) = sqlFormatter.FormatColumnname("UID_ParentITShopOrg", forComparisons: true, ValType.String);335 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 2) = sqlFormatter.Comparison("ITShopInfo", "BO", ValType.String);336 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 3) = "NOT " + sqlFormatter.EmptyClause("UID_ParentITShopOrg", ValType.String, FormatterOptions.NonUnicodeLiterals);337 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 4) = sqlFormatter.FormatColumnname("UID_OrgBoardTemplate", forComparisons: true, ValType.String);338 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 5) = sqlFormatter.UidComparison("UID_OrgBoardTemplate", value);339 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<object>, object>(ref buffer, 6) = sqlFormatter.FormatColumnname("UID_ITShopSrc", forComparisons: true, ValType.String);340 obj[2] = string.Format("{0} in (select {1} from ITShopOrg where {2} and {3} and {4} in (select {6} from ITShopSrc where {2} and {3} and {5}))", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray7<object>, object>(in buffer, 7));341 string whereClause = sqlFormatter.AndRelation(obj);342 Query query = Query.From("ITShopOrg").Where(whereClause).OrderBy("ITShopInfo", "FullPath")343 .Select("Ident_Org", "ITShopInfo", "UID_ITShopOrg", "UID_OrgBoardTemplate", "UID_OrgRoot");344 IEntityCollection collection = base.Session.Source().GetCollection(query, EntityCollectionLoadType.LoadForeignDisplaysEvenWhenExpensive);345 using (new UpdateHelper(m_TreeListFixedAssignments))346 {347 System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)collection).GetEnumerator();348 try349 {350 while (((System.Collections.IEnumerator)enumerator).MoveNext())351 {352 IEntity current = enumerator.Current;353 proxy.AddNode(((object)current).ToString(), -1);354 }355 }356 finally357 {358 ((System.IDisposable)enumerator)?.Dispose();359 }360 }361 }362 catch (System.Exception exception)363 {364 ExceptionMgr.Instance.HandleException(exception, this);365 }366 }367368 private void _LoadListViewShops(IEntity board)369 {370 try371 {372 ITreeListProxy proxy = m_TreeListShops.Proxy;373 proxy.Clear();374 if (m_MainActivator.DbObject == null)375 {376 return;377 }378 string value = board.GetValue<string>("UID_ITShopSrc");379 string id = "QER-FormITShopAssistant-Shops";380 List<QueryParameter> obj = new List<QueryParameter>();381 obj.Add(new QueryParameter("UID_OrgBoardTemplate", ValType.String, value));382 List<QueryParameter> val = obj;383 try384 {385 m_TextFilter.Text = m_TextFilter.Text.Trim();386 if (!string.IsNullOrWhiteSpace(m_TextFilter.Text))387 {388 id = "QER-FormITShopAssistant-Shops-Filter";389 val.Add(new QueryParameter("Filter", ValType.String, $"%{m_TextFilter.Text.ToUpperInvariant()}%"));390 }391 }392 catch (System.Exception exception)393 {394 ExceptionMgr.Instance.HandleException(exception, this);395 }396 IStatementRunner runner = base.Session.Resolve<IStatementRunner>();397 using (new BusyIndicator(base.Session, BusyTime.Short))398 {399 using (new UpdateHelper(m_TreeListShops))400 {401 IDataReader val2 = (IDataReader)(object)new CachedDataReader(runner.SqlExecute(id, (System.Collections.Generic.IEnumerable<QueryParameter>)val));402 try403 {404 while (val2.Read())405 {406 bool flag = ((IDataRecord)val2).GetString(1).ToUpperInvariant() == "SH";407 ShopInfo data = new ShopInfo(((IDataRecord)val2).GetString(3), ((IDataRecord)val2).GetBoolean(2), !flag);408 bool boolean = ((IDataRecord)val2).GetBoolean(2);409 ITreeListNode treeListNode = proxy.AddNode("", -1);410 treeListNode.Data = data;411 proxy.AddItem(treeListNode, proxy.CreateCheckBoxItem(boolean));412 proxy.AddItem(treeListNode, ((IDataRecord)val2).GetString(4));413 }414 }415 finally416 {417 ((System.IDisposable)val2)?.Dispose();418 }419 }420 }421 }422 catch (System.Exception exception2)423 {424 ExceptionMgr.Instance.HandleException(exception2, this);425 }426 }427428 private void _LoadTemplateCombo()429 {430 try431 {432 m_ComboTemplate.ComboItems.Clear();433 m_TreeListShops.Proxy.Clear();434 ISingleDbObject dbObject = m_MainActivator.DbObject;435 if (dbObject == null)436 {437 return;438 }439 string valueSafe = dbObject.GetValueSafe("UID_ITShopSrc", "");440 Query query = Query.From("ITShopSrc").Where(base.SqlFormatter.Comparison("ITShopInfo", "BT", ValType.String)).OrderBy("Ident_Org")441 .SelectAll();442 System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)base.Session.Source().GetCollection(query, EntityCollectionLoadType.LoadForeignDisplaysEvenWhenExpensive | EntityCollectionLoadType.BulkReadOnly)).GetEnumerator();443 try444 {445 while (((System.Collections.IEnumerator)enumerator).MoveNext())446 {447 IEntity current = enumerator.Current;448 int selectedIndex = m_ComboTemplate.ComboItems.Add((object)current);449 if (string.Equals(valueSafe, current.GetValue<string>("UID_ITShopSrc"), (StringComparison)5))450 {451 m_ComboTemplate.SelectedIndex = selectedIndex;452 }453 }454 }455 finally456 {457 ((System.IDisposable)enumerator)?.Dispose();458 }459 }460 catch (System.Exception exception)461 {462 ExceptionMgr.Instance.HandleException(exception, this);463 }464 }465466 private void InitializeComponent()467 {468 }469470 private void MainActivator_OnActivating(object sender, EventArgs e)471 {472 try473 {474 if (m_MainActivator.DbObject == null)475 {476 return;477 }478 _LoadListViewShops(m_MainActivator.DbObject.GetEntity());479 try480 {481 List<string> val = new List<string>();482 IStatementRunner runner = base.Session.Resolve<IStatementRunner>();483 using (new BusyIndicator(base.Session, BusyTime.Short))484 {485 IDataReader val2 = (IDataReader)(object)new CachedDataReader(runner.SqlExecute("QER_FormITShopAssistant_GetDependentTables", Enumerable.Empty<QueryParameter>()));486 try487 {488 while (val2.Read())489 {490 val.Add(((IDataRecord)val2).GetString(0));491 }492 }493 finally494 {495 ((System.IDisposable)val2)?.Dispose();496 }497 }498 _dependenttables = val.ToArray();499 }500 catch (System.Exception exception)501 {502 ExceptionMgr.Instance.HandleException(exception, this);503 _dependenttables = new string[0];504 }505 }506 catch (System.Exception exception2)507 {508 ExceptionMgr.Instance.HandleException(exception2, this);509 }510 }511512 private void ComboTemplate_OnSelectionChangeCommitted(object sender, EventArgs e)513 {514 try515 {516 if (!(m_ComboTemplate.SelectedItem is IEntity board))517 {518 return;519 }520 using (new BusyIndicator(base.Session, BusyTime.Short))521 {522 _LoadListViewShops(board);523 _LoadListViewFixedAssignments(board);524 }525 }526 catch (System.Exception exception)527 {528 ExceptionMgr.Instance.HandleException(exception, this);529 }530 }531532 private void CommandApply_OnClick(object sender, EventArgs e)533 {534 //IL_000b: Unknown result type (might be due to invalid IL or missing references)535 //IL_0011: Invalid comparison between Unknown and I4536 try537 {538 if ((int)FormTool.ShowQuestion("QER_FormITShopAssistant_Question_ApplyChanges", (MessageBoxButtons)4) != 6)539 {540 return;541 }542 using (new UpdateHelper(m_CommandApply, "Enabled", updateValue: false))543 {544 _ApplyChanges();545 }546 }547 catch (System.Exception exception)548 {549 ExceptionMgr.Instance.HandleException(exception, this);550 }551 }552553 private void CommandChooseAll_OnClick(object sender, EventArgs e)554 {555 try556 {557 _SwitchTreeListShopsCheckboxes((bool cb) => true);558 }559 catch (System.Exception exception)560 {561 ExceptionMgr.Instance.HandleException(exception, this);562 }563 }564565 private void CommandChooseNone_OnClick(object sender, EventArgs e)566 {567 try568 {569 _SwitchTreeListShopsCheckboxes((bool cb) => false);570 }571 catch (System.Exception exception)572 {573 ExceptionMgr.Instance.HandleException(exception, this);574 }575 }576577 private void CommandInvertSelected_OnClick(object sender, EventArgs e)578 {579 try580 {581 _SwitchTreeListShopsCheckboxes((bool cb) => !cb);582 }583 catch (System.Exception exception)584 {585 ExceptionMgr.Instance.HandleException(exception, this);586 }587 }588589 private void _SwitchTreeListShopsCheckboxes(Func<bool, bool> action)590 {591 using (new UpdateHelper(m_TreeListShops))592 {593 bool flag = default(bool);594 foreach (ITreeListNode item2 in (System.Collections.IEnumerable)m_TreeListShops.Proxy.GetNodes())595 {596 ITreeListItemSmall item = m_TreeListShops.Proxy.GetItem(item2, 0);597 bool.TryParse(item.Data?.ToString(), ref flag);598 item.Data = action.Invoke(flag);599 }600 }601 }602603 protected override void OnFormSizeChanged()604 {605 FormTool.StretchControl(m_TreeListFixedAssignments, ExtOrientation.Vertical, keepSpaceForScrollBars: true);606 FormTool.StretchControl(m_TreeListShops, ExtOrientation.Vertical, keepSpaceForScrollBars: true);607 FormTool.StretchControl(m_TreeListFixedAssignments, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);608 FormTool.StretchControl(m_TreeListShops, ExtOrientation.Horizontal, keepSpaceForScrollBars: true);609 m_TreeListShops.Height -= m_CommandApply.Height * 2 + 10;610 }611612 private void MainActivator_OnActivated(object sender, EventArgs e)613 {614 try615 {616 using (new BusyIndicator(base.Session, BusyTime.Normal))617 {618 _LoadTemplateCombo();619 if (m_ComboTemplate.SelectedItem is IEntity board)620 {621 _LoadListViewShops(board);622 _LoadListViewFixedAssignments(board);623 }624 }625 }626 catch (System.Exception exception)627 {628 ExceptionMgr.Instance.HandleException(exception, this);629 }630 }631}632