Пример #1
0
 internal EmailSettings()
 {
     NewAssignment        = new EmailDetails();
     CancelAssignment     = new EmailDetails();
     SubmitAssignment     = new EmailDetails();
     ReactivateAssignment = new EmailDetails();
     ReturnAssignment     = new EmailDetails();
     CollectAssignment    = new EmailDetails();
     AssignmentReminder   = new EmailDetails();
 }
Пример #2
0
        /// <summary>Initializes a new instance of <see cref="EmailSettings"/>.</summary>
        /// <param name="reader">The XmlReader containing the setting details.</param>
        public EmailSettings(XmlReader reader)
        {
            if (reader.IsEmptyElement == false)
            {
                reminderDaysInput = reader.GetAttribute("ReminderDays");
                EmailOnSubmitOff  = SlkSettings.BooleanAttribute(reader, "EmailOnSubmitOff");
                DefaultEmailingOn = SlkSettings.BooleanAttribute(reader, "DefaultEmailingOn");
                reader.Read();

                while (reader.Name != "EmailSettings")
                {
                    switch (reader.Name)
                    {
                    case "NewAssignment":
                        NewAssignment = new EmailDetails(reader);
                        break;

                    case "CancelAssignment":
                        CancelAssignment = new EmailDetails(reader);
                        break;

                    case "SubmitAssignment":
                        SubmitAssignment = new EmailDetails(reader);
                        break;

                    case "ReactivateAssignment":
                        ReactivateAssignment = new EmailDetails(reader);
                        break;

                    case "ReturnAssignment":
                        ReturnAssignment = new EmailDetails(reader);
                        break;

                    case "CollectAssignment":
                        CollectAssignment = new EmailDetails(reader);
                        break;

                    case "AssignmentReminder":
                        AssignmentReminder = new EmailDetails(reader);
                        break;

                    default:
                        reader.Read();
                        break;
                    }
                }
            }

            // Do not Move off end element
        }
Пример #3
0
        string SubjectText(EmailType type, string defaultText)
        {
            string       subject = null;
            EmailDetails details = EmailDetails(type);

            if (details != null)
            {
                subject = details.Subject;
            }
            else
            {
                subject = defaultText;
            }

            return(EmailText(subject));
        }
Пример #4
0
        string BodyText(EmailType type, string defaultText)
        {
            string body = null;

            EmailDetails details = EmailDetails(type);

            if (details != null)
            {
                body = details.Body;
            }
            else
            {
                body = defaultText;
            }

            return(EmailText(body));
        }