Пример #1
0
        public object getParameter(string p_name, object default_val)
        {
            SBTableParameters table = new SBTableParameters();
            Hashtable         param = table.getRow(string.Format("key = '{0}'", p_name));

            if (param == null)
            {
                return(default_val);
            }
            return(param["value"]);
        }
Пример #2
0
        public bool addParameter(string p_name, object p_value)
        {
            SBTableParameters table = new SBTableParameters();
            Hashtable         param = new Hashtable();

            param.Add("key", p_name);
            param.Add("value", p_value);
            param.Add("creation_date", DateTime.Now);
            table.insertRow(param);
            return(true);
        }
Пример #3
0
        public void updateParameter(string name, object vvalue)
        {
            SBTableParameters table = new SBTableParameters();
            Hashtable         param = table.getRow(string.Format("key = '{0}'", name));

            if (param == null)
            {
                this.addParameter(name, vvalue);
            }
            else
            {
                param["value"] = vvalue;
                table.updateRow(param);
            }
        }