public static bool CheckObjUsesVariable(Variable v, KBObject obj) { bool varused = true; if (!v.IsStandard) { varused = false; ProcedurePart pp = obj.Parts.Get <ProcedurePart>(); if (pp != null) { varused = VariableIsUsedInText(pp.Source, v.Name); } if (!varused) { RulesPart rp = obj.Parts.Get <RulesPart>(); if (rp != null) { varused = VariableIsUsedInText(rp.Source, v.Name); } } if (!varused) { ConditionsPart cp = obj.Parts.Get <ConditionsPart>(); if (cp != null) { varused = VariableIsUsedInText(cp.Source, v.Name); } } if (!varused) { EventsPart ep = obj.Parts.Get <EventsPart>(); if (ep != null) { varused = VariableIsUsedInText(ep.Source, v.Name); } } if (!varused) { WebFormPart fp = obj.Parts.Get <WebFormPart>(); if (fp != null) { varused = VariableIsUsedInWebForm(fp, v.Id);; } } } return(varused); }
private static void CleanAllConditions(KBObject obj) { ConditionsPart cndPart = obj.Parts.Get <ConditionsPart>(); cndPart.Source = ""; }
internal int MergeConditions(ConditionsPart obj, PatternInstanceElement c, string template, bool overwrite) { string oldValue = obj.Source; if (!String.IsNullOrEmpty(template)) { obj.Source = MergeTextMarked(obj.Source, AppendTemplateOutput(obj.KBObject, obj, c, template),overwrite); } if (oldValue != obj.Source) return 1; return 0; }