Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private static void CleanAllConditions(KBObject obj)
        {
            ConditionsPart cndPart = obj.Parts.Get <ConditionsPart>();

            cndPart.Source = "";
        }
Exemplo n.º 3
0
 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;
 }