예제 #1
0
 private void LoadProperties()
 {
     using (IDataReader reader = DBUser.GetProperties(m_UserID))
     {
         if (reader != null)
         {
             while (reader.Read())
             {
                 string name = (string)reader["Key"];
                 if (!m_properties.ContainsKey(name))
                 {
                     m_properties[name] = new UserLightProperty((int)reader["SettingId"], name, (string)reader["Value"]);
                 }
             }
         }
     }
 }
예제 #2
0
        public void Add(string Name, string Value)
        {
            using (DbTransaction tran = DbTransaction.Begin())
            {
                int id = DBUser.SetProperty(m_UserID, Name, Value);

                UserLightProperty prop = (UserLightProperty)m_properties[Name];
                if (prop != null && prop.PropertyID == id)
                {
                    prop.Value = Value;
                }
                else
                {
                    m_properties[Name] = new UserLightProperty(id, Name, Value);
                }

                tran.Commit();
            }
        }
예제 #3
0
 public string this[string Name]
 {
     get
     {
         string            ret  = null;
         UserLightProperty prop = (UserLightProperty)m_properties[Name];
         if (prop != null)
         {
             ret = prop.Value;
         }
         return(ret);
     }
     set
     {
         if (value != null)
         {
             this.Add(Name, value);
         }
         else
         {
             this.Remove(Name);
         }
     }
 }
예제 #4
0
 private void LoadProperties()
 {
     using(IDataReader reader = DBUser.GetProperties(m_UserID))
     {
         if(reader != null)
         {
             while(reader.Read())
             {
                 string name = (string)reader["Key"];
                 if(!m_properties.ContainsKey(name))
                     m_properties[name] = new UserLightProperty((int)reader["SettingId"], name, (string)reader["Value"]);
             }
         }
     }
 }
예제 #5
0
        public void Add(string Name, string Value)
        {
            using(DbTransaction tran = DbTransaction.Begin())
            {
                int id = DBUser.SetProperty(m_UserID, Name, Value);

                UserLightProperty prop = (UserLightProperty)m_properties[Name];
                if(prop != null && prop.PropertyID == id)
                    prop.Value = Value;
                else
                    m_properties[Name] = new UserLightProperty(id, Name, Value);

                tran.Commit();
            }
        }