Esempio n. 1
0
        public void TestSPUpdate()
        {
            SystemParameter sp = EntityGenerator.GetSystemParameter();

            spr.Save(sp);

            string newValue = "newValue";

            sp.Value = newValue;
            spr.Update(sp.Id, sp);

            SystemParameter act = spr.GetByKey(sp.Key);

            Assert.ReferenceEquals(act, sp);
        }
Esempio n. 2
0
        public void SetValue(string key, object value)
        {
            SystemParameter sp = spr.GetByKey(key);

            if (sp == null)
            {
                sp       = new SystemParameter();
                sp.Key   = key;
                sp.Value = value.ToString();
                spr.Save(sp);
            }
            else
            {
                sp.Value = value.ToString();
                spr.Update(sp.Id, sp);
            }
        }