internal override void PerformAction() { foreach (TreeListNode node in _senderNodes) { PolicyTreeListTag polTag = node.Tag as PolicyTreeListTag; FunctionTreeListTag funTag = node.Tag as FunctionTreeListTag; ParameterTreeListTag parTag = node.Tag as ParameterTreeListTag; if (polTag != null) { foreach (CountryConfig.PolicyRow policyRow in polTag.GetPolicyRows()) { policyRow.Private = policyRow.Private == DefPar.Value.YES ? DefPar.Value.NO : DefPar.Value.YES; } node.StateImageIndex = polTag.GetDefaultPolicyRow().Private == DefPar.Value.YES ? DefGeneral.IMAGE_IND_PRIV_POL : DefGeneral.IMAGE_IND_POL; } else if (funTag != null) { foreach (CountryConfig.FunctionRow funRow in funTag.GetFunctionRows()) { funRow.Private = funRow.Private == DefPar.Value.YES ? DefPar.Value.NO : DefPar.Value.YES; } node.StateImageIndex = funTag.GetDefaultFunctionRow().Private == DefPar.Value.YES ? DefGeneral.IMAGE_IND_PRIV_FUN : DefGeneral.IMAGE_IND_FUN; } else if (parTag != null) { foreach (CountryConfig.ParameterRow parRow in parTag.GetParameterRows()) { parRow.Private = parRow.Private == DefPar.Value.YES ? DefPar.Value.NO : DefPar.Value.YES; } node.StateImageIndex = parTag.GetDefaultParameterRow().Private == DefPar.Value.YES ? DefGeneral.IMAGE_IND_PRIV_PAR : -1; } } }
internal override void PerformAction() { PolicyTreeListTag policyTreeListTag = _senderNode.Tag as PolicyTreeListTag; if (CountryConfigFacade.IsReferencePolicy(policyTreeListTag.GetDefaultPolicyRow())) { Tools.UserInfoHandler.ShowInfo("The policy cannot be deleted as it is used by a(t least one) reference policy." + Environment.NewLine + "Please delete the reference policies before deleting the policy itself."); _actionIsCanceled = true; return; } _senderNode.TreeList.DeleteNode(_senderNode); foreach (CountryConfig.PolicyRow policyRow in policyTreeListTag.GetPolicyRows()) { policyRow.Delete(); EM_AppContext.Instance.GetActiveCountryMainForm().GetTreeListBuilder().RemoveFromAvailablePolicies(policyRow); } }
internal override void PerformAction() { PolicyTreeListTag policyTreeListTag = _senderNode.Tag as PolicyTreeListTag; string countryShortName = CountryConfigFacade.GetCountryShortName((_senderNode.Tag as PolicyTreeListTag).GetDefaultPolicyRow()).ToLower(); string policyName = policyTreeListTag.GetPolicyName(); string currentName = policyTreeListTag.GetDefaultPolicyRow().Name; if (!UserInfoHandler.GetPolicyName(ref policyName, countryShortName, _senderNode.TreeList, currentName)) { _actionIsCanceled = true; return; } foreach (CountryConfig.PolicyRow policyRow in policyTreeListTag.GetPolicyRows()) //loop over systems (actually over neighbour policies within systems) { policyRow.Name = policyName; _senderNode.SetValue(_mainForm.GetTreeListBuilder().GetSystemColumnByID(policyRow.SystemID), policyRow.Switch); } _senderNode.SetValue(_mainForm.GetTreeListBuilder().GetPolicyColumn(), policyName); }