Exemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="SettingsModel"/> class.</summary>
        public SettingsModel()
        {
            Item settingsItem = null;

            using (new DatabaseSwitcher(Factory.GetDatabase("master")))
            {
                settingsItem = Sitecore.Context.Database.GetItem(new ID(Constants.SettingsItemId));
            }

            SenderName      = settingsItem.Fields["Sender Name"].HasValue ? settingsItem.Fields["Sender Name"].Value : string.Empty;
            SenderEmail     = settingsItem.Fields["Sender Email"].HasValue ? settingsItem.Fields["Sender Email"].Value : string.Empty;
            RecipientEmails = settingsItem.Fields["Recipient Emails"].HasValue ? settingsItem.Fields["Recipient Emails"].Value : string.Empty;
            Subject         = settingsItem.Fields["Subject"].HasValue ? settingsItem.Fields["Subject"].Value : string.Empty;

            if (!string.IsNullOrEmpty(settingsItem["Error Level"]))
            {
                this.ErrorLevel = (HealthcheckStatus)Enum.Parse(typeof(HealthcheckStatus), settingsItem["Error Level"]);
            }
            else
            {
                this.ErrorLevel = HealthcheckStatus.UnKnown;
            }
        }
Exemplo n.º 2
0
 public string Post(HealthcheckStatus state)
 {
     return("OK");
 }