internal static void SetSettingValue(SipProfileSettingTypes type, string value, SipProfile profile) { Connection conn = ConnectionPoolManager.GetConnection(typeof(SipProfileSetting)); if (GetSettingValue(type, profile) != null) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("Value", value); conn.Update(typeof(SipProfileSetting), fields, new SelectParameter[] { new EqualParameter("Profile", profile), new EqualParameter("SettingType", type) }); } else { SipProfileSetting sps = new SipProfileSetting(); sps.Profile = profile; sps.SettingType = type; sps.Value = value; conn.Save(sps); } conn.CloseConnection(); }
internal static void SetSettingValue(SipProfileSettingTypes type, string value, SipProfile profile) { Connection conn = ConnectionPoolManager.GetConnection(typeof(SipProfileSetting)); if (GetSettingValue(type, profile) != null) { Dictionary<string, object> fields = new Dictionary<string, object>(); fields.Add("Value", value); conn.Update(typeof(SipProfileSetting), fields, new SelectParameter[]{ new EqualParameter("Profile",profile), new EqualParameter("SettingType",type) }); } else { SipProfileSetting sps = new SipProfileSetting(); sps.Profile = profile; sps.SettingType = type; sps.Value = value; conn.Save(sps); } conn.CloseConnection(); }
public string this[SipProfileSettingTypes type] { get { return(SipProfileSetting.GetSettingValue(type, this)); } set { SipProfileSetting.SetSettingValue(type, value, this); } }