Exemplo n.º 1
0
        private static void SaveStartMenuCheckedItems(string value)
        {
            UserContext user = UserContext.Current;

            if (user != null)
            {
                SettingCollection settings = user.Settings;
                Setting           setting  = settings["StartMenuCheckedItems"];
                if (setting != null)
                {
                    if (string.IsNullOrEmpty(setting.Value) || (string.Compare(setting.Value, bool.TrueString, StringComparison.OrdinalIgnoreCase) == 0))
                    {
                        setting.Value = value;
                    }
                    else
                    {
                        setting.Value += "," + value;
                    }

                    if ((ActionProvider.StartPageSettingsLevels & SettingLevels.Instance) == SettingLevels.Instance)
                    {
                        settings.UpdateValues(user.OrganizationId, user.InstanceId);
                    }
                    else
                    {
                        settings.UpdateValues(user.OrganizationId);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void UpdateSettings()
        {
            SettingCollection settings = this.Settings;
            string            value    = null;

            foreach (Setting setting in settings)
            {
                value = GetSettingValue(setting.SettingId, setting.SettingType);
                if (value != null)
                {
                    setting.Value = value;
                }
            }

            switch (this.DisplayedSettingLevel)
            {
            case SettingLevels.Organization:
                if (this.Action != null)
                {
                    settings.UpdateValues(m_UserContext.OrganizationId);
                }
                break;

            case SettingLevels.Instance:
                if (this.Action != null)
                {
                    settings.UpdateValues(m_UserContext.OrganizationId, m_UserContext.InstanceId);
                }
                break;

            case SettingLevels.Group:
                settings.UpdateValues(m_UserContext.OrganizationId, this.InstanceId, this.GroupId);
                break;
            }

            if (this.ValuesUpdated != null)
            {
                this.ValuesUpdated(this, EventArgs.Empty);
            }

            m_Settings = null;
        }
Exemplo n.º 3
0
        protected void checkBox_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox          chk      = sender as CheckBox;
            SettingCollection settings = this.PaidSettings;

            if (chk.ID == "chkPhoneSupport")
            {
                settings["PhoneSupport"].Value = chk.Checked.ToString();
            }
            else
            {
                Guid settingId = Guid.Parse(chk.ID.Replace("chkOptionOnOff_", string.Empty));
                settings[settingId].Value = chk.Checked.ToString();
            }
            settings.UpdateValues(OrganizationId, InstanceId);

            this.List_DataBind();
        }