void GetRelateRules(QCRule rule, string relateIds, IList <QCCondition> allconditions, IList <QCResult> allresults) { rule.ClearRelateRules(); string[] ruleIds = relateIds.Split(','); for (int i = 0; i < ruleIds.Length; i++) { string ruleId = ruleIds[i].Trim(); if (string.IsNullOrEmpty(ruleId)) { continue; } QCRule relaterule = null; if (allconditions == null || allresults == null) { relaterule = GetQCRuleById(ruleId); } else { relaterule = GetQCRuleById(ruleId, allconditions, allresults); } if (relaterule != null) { rule.AddRelateRule(relaterule); } } }
void listBoxRelateRules_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Insert) { string codevalue = _currentRule.RelateRuleIds; _showlistwindow.CallLookUpWindow(_rulewordbook, WordbookKind.Sql, codevalue, ShowListFormMode.Full, textEditRelateRules.PointToScreen(textEditRelateRules.Location), new Size(100, 25), this.Bounds); _currentRule.ClearRelateRules(); if (!string.IsNullOrEmpty(_showlistwindow.CodeValue)) { string[] ruleids = _showlistwindow.CodeValue.Split(','); foreach (string ruleid in ruleids) { QCRule qcr = QCRule.SelectQCRule(ruleid).Clone(); _currentRule.AddRelateRule(qcr); } } textEditRelateRules.Text = _currentRule.RelateRuleIds; } }