示例#1
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (greyFoxSettingID == 0)
            {
                obj = new GreyFoxSetting();
            }
            else
            {
                obj = new GreyFoxSetting(greyFoxSettingID);
            }

            obj.Name            = tbName.Text;
            obj.SettingValue    = tbSettingValue.Text;
            obj.IsSystemSetting = cbIsSystemSetting.Checked;

            if (msParent.SelectedItem != null && msParent.SelectedItem.Value != "Null")
            {
                obj.Parent = GreyFoxSetting.NewPlaceHolder(
                    int.Parse(msParent.SelectedItem.Value));
            }
            else
            {
                obj.Parent = null;
            }

            if (msModifyRole.SelectedItem != null && msModifyRole.SelectedItem.Value != "Null")
            {
                obj.ModifyRole = GreyFoxRole.NewPlaceHolder(
                    int.Parse(msModifyRole.SelectedItem.Value));
            }
            else
            {
                obj.ModifyRole = null;
            }

            if (editOnAdd)
            {
                greyFoxSettingID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbName.Text                = string.Empty;
                tbSettingValue.Text        = string.Empty;
                cbIsSystemSetting.Checked  = false;
                msParent.SelectedIndex     = 0;
                msModifyRole.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
示例#2
0
        private static void setSetting(string key, string value)
        {
            GreyFoxSetting setting =
                GreyFoxSettingManager.GetSetting(key);

            setting.SettingValue = value;
            setting.Save();
        }
示例#3
0
        public void InitSettings()
        {
            GreyFoxSetting tessenSetting;
            GreyFoxSetting setting;

            tessenSetting = GreyFoxSettingManager.GetSetting("Tessen");
            if (tessenSetting == null)
            {
                setting              = new GreyFoxSetting();
                setting.Name         = "Tessen";
                setting.SettingValue = "Tessen Settings";
                setting.Save();

                tessenSetting = setting;
            }

            setting = GreyFoxSettingManager.GetSetting(tessenSetting, "RappahanockEnabled");
            if (setting == null)
            {
                setting              = new GreyFoxSetting();
                setting.Name         = "RappahanockEnabled";
                setting.SettingValue = false.ToString();
                setting.Parent       = tessenSetting;
                setting.Save();
            }

            setting              = new GreyFoxSetting();
            setting.Name         = "CustomerExportMode";
            setting.SettingValue = RHCustomerExportMode.ExportParentsOnly.ToString();
            setting.Parent       = tessenSetting;
            setting.Save();

            setting              = new GreyFoxSetting();
            setting.Name         = "CustomerSyncMode";
            setting.SettingValue = RHCustomerSyncMode.UpdateBoth.ToString();
            setting.Parent       = tessenSetting;
            setting.Save();

            setting              = new GreyFoxSetting();
            setting.Name         = "MembershipIncomeAccount";
            setting.SettingValue = "-1";
            setting.Parent       = tessenSetting;
            setting.Save();

            setting              = new GreyFoxSetting();
            setting.Name         = "MembershipTaxCode";
            setting.SettingValue = "-1";
            setting.Parent       = tessenSetting;
            setting.Save();

            setting              = new GreyFoxSetting();
            setting.Name         = "SeminarIncomeAccount";
            setting.SettingValue = "-1";
            setting.Parent       = tessenSetting;
            setting.Save();

            setting              = new GreyFoxSetting();
            setting.Name         = "SeminarTaxCode";
            setting.SettingValue = "-1";
            setting.Parent       = tessenSetting;
            setting.Save();
        }