Esempio n. 1
0
        public void CopyValues(MReportConfig srcCfg)
        {
            Hashtable hash = srcCfg.GetFieldHash();

            ReportName = srcCfg.ReportName;
            ReportID   = srcCfg.ReportID;

            variables.Clear();
            foreach (String key in hash.Keys)
            {
                MGlobalVariable s = (MGlobalVariable)hash[key];
                MGlobalVariable v = new MGlobalVariable(new CTable(""));

                v.VariableName  = s.VariableName;
                v.VariableValue = s.VariableValue;
                v.VariableType  = s.VariableType;
                v.VariableDesc  = s.VariableDesc;

                fieldHash[key] = v;

                if (!defaultFields.ContainsKey(v.VariableName))
                {
                    variables.Add(v);
                }
            }
        }
Esempio n. 2
0
        public void InitItem(GenericStringTypeFilterCallback requireFunc)
        {
            items.Clear();

            CTable    o    = GetDbObject();
            ArrayList narr = o.GetChildArray("GLOBAL_VARIABLE_ITEM");

            if (narr == null)
            {
                narr = new ArrayList();
                o.AddChildArray("GLOBAL_VARIABLE_ITEM", narr);
            }

            foreach (CTable t in narr)
            {
                MGlobalVariable v = new MGlobalVariable(t);

                if (!requireFunc(v.VariableName))
                {
                    continue;
                }

                items.Add(v);
                v.ExtFlag = "I";
            }
        }
Esempio n. 3
0
        public void InitReportConfig()
        {
            variables.Clear();

            CTable o = GetDbObject();

            if (o == null)
            {
                return;
            }

            ArrayList arr = o.GetChildArray("REPORT_CONFIG_LIST");

            if (arr == null)
            {
                return;
            }

            foreach (CTable obj in arr)
            {
                MGlobalVariable v = new MGlobalVariable(obj);
                fieldHash[v.VariableName] = v;

                if (!defaultFields.ContainsKey(v.VariableName))
                {
                    variables.Add(v);
                }
            }
        }
Esempio n. 4
0
        public void SetConfigValue(String varName, String value, String type, String note)
        {
            MGlobalVariable obj = new MGlobalVariable(new CTable(""));

            obj.VariableName  = varName;
            obj.VariableValue = value;
            obj.VariableType  = type;
            obj.VariableDesc  = note;

            fieldHash[varName] = obj;
        }
Esempio n. 5
0
        public String GetConfigValue(String cfgName, String defaultIfNull)
        {
            MGlobalVariable obj = (MGlobalVariable)fieldHash[cfgName];

            if (obj == null)
            {
                return(defaultIfNull);
            }

            return(obj.VariableValue);
        }
Esempio n. 6
0
        public CTable GetParamObject()
        {
            CTable o = new CTable("");

            foreach (String key in fieldHash.Keys)
            {
                MGlobalVariable s = (MGlobalVariable)fieldHash[key];
                o.SetFieldValue(s.VariableName, s.VariableValue);
            }

            return(o);
        }
Esempio n. 7
0
        public void PrepareForSaving()
        {
            CTable    o   = GetDbObject();
            ArrayList arr = new ArrayList();

            foreach (String key in fieldHash.Keys)
            {
                MGlobalVariable s = (MGlobalVariable)fieldHash[key];
                arr.Add(s.GetDbObject());
            }

            o.RemoveChildArray("REPORT_CONFIG_LIST");
            o.AddChildArray("REPORT_CONFIG_LIST", arr);
        }
Esempio n. 8
0
        public void PopulateMissingValue(MReportConfig defCfg)
        {
            Hashtable hash = defCfg.GetFieldHash();

            foreach (String key in hash.Keys)
            {
                if (!fieldHash.ContainsKey(key))
                {
                    MGlobalVariable s = (MGlobalVariable)hash[key];
                    MGlobalVariable v = new MGlobalVariable(new CTable(""));

                    v.VariableName  = s.VariableName;
                    v.VariableValue = s.VariableValue;
                    v.VariableType  = s.VariableType;
                    v.VariableDesc  = s.VariableDesc;

                    fieldHash[key] = v;
                }
            }
        }
Esempio n. 9
0
        public MGlobalVariable GetConfig(String cfgName)
        {
            MGlobalVariable obj = (MGlobalVariable)fieldHash[cfgName];

            return(obj);
        }