예제 #1
0
        public ContactDetailHeadViewModel(IDatabase database, Translator translator, Session session, Contact contact)
        {
            var writeAccess = session.HasAccess(contact, PartAccess.Demography, AccessRight.Read);

            Id           = contact.Id.ToString();
            Organization = contact.Organization.Value.EscapeHtml();

            if (session.HasAccess(contact, PartAccess.Demography, AccessRight.Read))
            {
                FullName = contact.FullName.EscapeHtml();
            }
            else
            {
                FullName = string.Empty;
            }

            if (session.HasAccess(contact, PartAccess.Demography, AccessRight.Write))
            {
                Editable = "editable";
            }
            else
            {
                Editable = "accessdenied";
            }

            PhraseHeadOrganization = translator.Get("Contact.Detail.Head.Header.Organization", "Column 'Organization' in the head of the contact detail page", "Organization").EscapeHtml();
            PhraseHeadFullName     = translator.Get("Contact.Detail.Head.Header.FullName", "Column 'Full name' in the head of the contact detail page", "Full name").EscapeHtml();
            PhraseHeadVotingRight  = translator.Get("Contact.Detail.Head.Header.VotingRight", "Column 'Voting right' in the head of the contact detail page", "Voting right").EscapeHtml();
        }
예제 #2
0
        public ContactMasterServiceAddressViewModel(Translator translator, Session session, Contact contact, ServiceType service)
            : base(contact, GetTitle(translator, service))
        {
            List = new List <ServiceAddressViewModel>(
                contact.ServiceAddresses
                .Where(a => a.Service.Value == service)
                .OrderBy(a => a.Precedence.Value)
                .Select(a => new ServiceAddressViewModel(translator, a)));
            Editable =
                session.HasAccess(contact, PartAccess.Contact, AccessRight.Write) ?
                "editable" : "accessdenied";

            switch (service)
            {
            case ServiceType.EMail:
                PhraseDeleteConfirmationTitle = translator.Get("Contact.Detail.Master.Mail.Delete.Confirm.Title", "Delete E-Mail address confirmation title", "Delete?").EscapeHtml();
                break;

            case ServiceType.Phone:
                PhraseDeleteConfirmationTitle = translator.Get("Contact.Detail.Master.Phone.Delete.Confirm.Title", "Delete phone number confirmation title", "Delete?").EscapeHtml();
                break;

            default:
                throw new NotSupportedException();
            }
            PhraseDeleteConfirmationInfo = string.Empty;
        }
예제 #3
0
 public ExportEditViewModel(Translator translator, IDatabase db, Session session, Export export)
     : this(translator)
 {
     Method         = "edit";
     Id             = export.Id.ToString();
     Name           = export.Name.Value.EscapeHtml();
     SelectFeed     = string.Empty;
     SelectTag      = string.Empty;
     SelectLanguage = string.Empty;
     Feeds          = new List <NamedIdViewModel>(db
                                                  .Query <Feed>()
                                                  .Where(o => session.HasAccess(o, PartAccess.Demography, AccessRight.Read))
                                                  .Select(o => new NamedIdViewModel(translator, o, o == export.SelectFeed.Value))
                                                  .OrderBy(o => o.Name));
     if (session.HasSystemWideAccess(PartAccess.Demography, AccessRight.Read))
     {
         Feeds.Add(new NamedIdViewModel(translator.Get("Export.Edit.Field.SelectFeed.None", "No selection in the select feed field of the edit export page", "None"), false, export.SelectFeed.Value == null));
     }
     Tags = new List <NamedIdViewModel>(db
                                        .Query <Tag>()
                                        .Select(t => new NamedIdViewModel(translator, t, t == export.SelectTag.Value))
                                        .OrderBy(t => t.Name));
     Tags.Add(new NamedIdViewModel(translator.Get("Export.Edit.Field.SelectTag.None", "No selection in the select tag field of the edit export page", "None"), false, export.SelectTag.Value == null));
     Languages = new List <NamedIntViewModel>();
     Languages.Add(new NamedIntViewModel(translator, Language.English, export.SelectLanguage.Value == Language.English));
     Languages.Add(new NamedIntViewModel(translator, Language.German, export.SelectLanguage.Value == Language.German));
     Languages.Add(new NamedIntViewModel(translator, Language.French, export.SelectLanguage.Value == Language.French));
     Languages.Add(new NamedIntViewModel(translator, Language.Italian, export.SelectLanguage.Value == Language.Italian));
     Languages.Add(new NamedIntViewModel(translator.Get("Export.Edit.Field.SelectLanguage.None", "No selection in the select language field of the edit export page", "None"), false, export.SelectLanguage.Value == null));
     var columns = new ExportColumnManager(translator);
     Columns = new List <NamedStringViewModel>(columns.Columns.Select(c => new NamedStringViewModel(c.Id, c.Title, false)));
 }
예제 #4
0
        public MailingSendingViewModel(Translator translator, Sending sending)
        {
            Name    = sending.Address.Value.Contact.Value.ShortHand;
            Address = sending.Address.Value.Address.Value;

            var sentDate =
                sending.SentDate.Value.HasValue ?
                sending.SentDate.Value.Value.ToLocalTime().ToString("dd.MM.yyyy HH:mm") :
                string.Empty;

            switch (sending.Status.Value)
            {
            case SendingStatus.Created:
                Status = translator.Get("Mailing.Sending.Field.Status.Sending", "Sending value in the sending status field the scheduled mailing page", "Sending").EscapeHtml();
                break;

            case SendingStatus.Sent:
                Status = translator.Get("Mailing.Sending.Field.Status.Sent", "Sent value in the sending status field the scheduled mailing page", "Sent at {0}", sentDate).EscapeHtml();
                break;

            case SendingStatus.Failed:
                Status = translator.Get("Mailing.Sending.Field.Status.Failed", "Failed value in the sending status field the scheduled mailing page", "Failed at {0} width message '{1}'", sentDate, sending.FailureMessage.Value ?? string.Empty).EscapeHtml();
                break;

            default:
                throw new NotSupportedException();
            }
        }
예제 #5
0
 public DialogViewModel(Translator translator, string title, string dialogId)
 {
     PhraseButtonOk     = translator.Get("Dialog.Button.OK", "Button 'OK' in any dialog", "OK").EscapeHtml();
     PhraseButtonCancel = translator.Get("Dialog.Button.Cancel", "Button 'Cancel' in any dialog", "Cancel").EscapeHtml();
     Title    = title.EscapeHtml();
     DialogId = dialogId;
     ButtonId = dialogId + "Button";
 }
 public TagAssignmentEditViewModel(Translator translator)
     : base(translator,
            translator.Get("TagAssignment.Edit.Title", "Title of the edit tagAssignment dialog", "Edit tag assignment"),
            "tagAssignmentEditDialog")
 {
     PhraseFieldTag = translator.Get("TagAssignment.Edit.Field.Tag", "Field 'Tag' in the edit tagAssignment dialog", "Tag").EscapeHtml();
     Tags           = new List <NamedIdViewModel>();
 }
예제 #7
0
 public DemographyEditViewModel(Translator translator)
     : base(translator,
            translator.Get("Demography.Edit.Title", "Title of the demography edit dialog", "Edit demography"),
            "demographyEditDialog")
 {
     PhraseFieldBirthdate = translator.Get("Demography.Edit.Field.Birthdate", "Field 'Birthdate' in the edit demography address dialog", "Birthdate").EscapeHtml();
     PhraseFieldLanguage  = translator.Get("Demography.Edit.Field.Language", "Field 'Language' in the edit demography address dialog", "Language").EscapeHtml();
 }
예제 #8
0
 public AccessDeniedViewModel(Translator translator)
     : base(translator,
            translator.Get("Access.Denied.Title", "Title of the access denied page", "Access Denied"),
            translator.Get("Access.Denied.Text", "Text on the access denied page", "Access to this page is denied."),
            translator.Get("Access.Denied.Back", "Back text on the access denied page", "Back to dashboard"),
            "/")
 {
 }
예제 #9
0
 public CountryListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderName = translator.Get("Country.List.Header.Name", "Column 'Name' in the country list", "Name").EscapeHtml();
     PhraseDeleteConfirmationTitle = translator.Get("Country.List.Delete.Confirm.Title", "Delete country confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = translator.Get("Country.List.Delete.Confirm.Info", "Delete country confirmation info", "This will also delete all postal addresses in that country.").EscapeHtml();
     List = new List <CountryListItemViewModel>(
         database.Query <Country>()
         .Select(c => new CountryListItemViewModel(translator, c)));
 }
예제 #10
0
 public SubscriptionEditViewModel(Translator translator)
     : base(translator,
            translator.Get("Subscription.Edit.Title", "Title of the edit subscription dialog", "Edit subscription"),
            "subscriptionEditDialog")
 {
     PhraseFieldFeed      = translator.Get("Subscription.Edit.Field.Feed", "Field 'Feed' in the edit subscription dialog", "Feed").EscapeHtml();
     PhraseFieldStartDate = translator.Get("Subscription.Edit.Field.StartDate", "Field 'Start date' in the edit subscription dialog", "Start date").EscapeHtml();
     PhraseFieldEndDate   = translator.Get("Subscription.Edit.Field.EndDate", "Field 'End date' in the edit subscription dialog", "End date").EscapeHtml();
     Feeds = new List <NamedIdViewModel>();
 }
예제 #11
0
 public StateListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderName = translator.Get("State.List.Header.Name", "Column 'Name' in the state list page", "Name").EscapeHtml();
     PhraseDeleteConfirmationTitle = translator.Get("State.List.Delete.Confirm.Title", "Delete state confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = translator.Get("State.List.Delete.Confirm.Info", "Delete state confirmation info", "This will remove that state from all postal addresses.").EscapeHtml();
     List = new List <StateListItemViewModel>(
         database.Query <State>()
         .Select(c => new StateListItemViewModel(translator, c))
         .OrderBy(c => c.Name));
 }
예제 #12
0
 public PermissionEditViewModel(Translator translator)
     : base(translator, translator.Get("Permission.Edit.Title", "Title of the permission edit dialog", "Edit permission"), "permissionEditDialog")
 {
     PhraseFieldPart    = translator.Get("Permission.Edit.Field.Part", "Part field in the permission edit dialog", "Part").EscapeHtml();
     PhraseFieldSubject = translator.Get("Permission.Edit.Field.Subject", "Subject field in the permission edit dialog", "Subject").EscapeHtml();
     PhraseFieldRight   = translator.Get("Permission.Edit.Field.Right", "Right field in the permission edit dialog", "Right").EscapeHtml();
     Parts    = new List <NamedIntViewModel>();
     Subjects = new List <NamedIntViewModel>();
     Rights   = new List <NamedIntViewModel>();
 }
예제 #13
0
        public MailingListItemViewModel(Translator translator, Session session, Mailing mailing)
        {
            Title   = mailing.Title.Value.EscapeHtml();
            Feed    = mailing.RecipientFeed.Value.Name.Value[translator.Language].EscapeHtml();
            Creator = mailing.Creator.Value.UserName.Value.EscapeHtml();

            switch (mailing.Status.Value)
            {
            case MailingStatus.Scheduled:
                if (mailing.SendingDate.Value.HasValue)
                {
                    var dateString = mailing.SendingDate.Value.Value.ToLocalTime().ToString("dd.MM.yyyy HH:mm");
                    Status = translator.Get("Mailing.List.Status.ScheduledFor", "Status 'Scheduled for' in the mailing list page", "Scheduled for {0}", dateString).EscapeHtml();
                }
                else
                {
                    Status = mailing.Status.Value.Translate(translator).EscapeHtml();
                }
                break;

            case MailingStatus.Sending:
                if (mailing.SendingDate.Value.HasValue)
                {
                    var dateString = mailing.SendingDate.Value.Value.ToLocalTime().ToString("dd.MM.yyyy HH:mm");
                    Status = translator.Get("Mailing.List.Status.SendingSince", "Status 'Sending since' in the mailing list page", "Sending since {0}", dateString).EscapeHtml();
                }
                else
                {
                    Status = mailing.Status.Value.Translate(translator).EscapeHtml();
                }
                break;

            case MailingStatus.Sent:
                if (mailing.SentDate.Value.HasValue)
                {
                    var dateString = mailing.SentDate.Value.Value.ToLocalTime().ToString("dd.MM.yyyy HH:mm");
                    Status = translator.Get("Mailing.List.Status.SentAt", "Status 'Sent at' in the mailing list page", "Sent at {0}", dateString).EscapeHtml();
                }
                else
                {
                    Status = mailing.Status.Value.Translate(translator).EscapeHtml();
                }
                break;

            default:
                Status = mailing.Status.Value.Translate(translator).EscapeHtml();
                break;
            }

            Id = mailing.Id.Value.ToString();
            bool access = session.HasAccess(mailing.RecipientFeed.Value, PartAccess.Mailings, AccessRight.Write);

            Editable = access ? "editable" : "accessdenied";
            PhraseDeleteConfirmationQuestion = translator.Get("Mailing.List.Delete.Confirm.Question", "Delete mailing confirmation question", "Do you really wish to delete mailing {0}?", mailing.GetText(translator)).EscapeHtml();
        }
 public ContactDetailJournalViewModel(Translator translator, IDatabase database, Session session, Contact contact)
 {
     Id   = contact.Id.Value.ToString();
     List = new List <ContactDetailJournalItemViewModel>(database
                                                         .Query <JournalEntry>(DC.Equal("contactid", contact.Id.Value))
                                                         .OrderByDescending(d => d.Moment.Value)
                                                         .Select(d => new ContactDetailJournalItemViewModel(translator, d)));
     PhraseHeaderMoment  = translator.Get("Contact.Detail.Journal.Header.Moment", "Column 'Moment' on the journal tab of the contact detail page", "When").EscapeHtml();
     PhraseHeaderSubject = translator.Get("Contact.Detail.Journal.Header.Subject", "Column 'Subject' on the journal tab of the contact detail page", "Who").EscapeHtml();
     PhraseHeaderText    = translator.Get("Contact.Detail.Journal.Header.Text", "Column 'Text' on the journal tab of the contact detail page", "What").EscapeHtml();
 }
예제 #15
0
 public ExportListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderName              = translator.Get("Export.List.Header.Name", "Column 'Name' in the export list page", "Name").EscapeHtml();
     PhraseExportDownload          = translator.Get("Export.List.Link.Download", "Download link in the export list page", "Download").EscapeHtml();
     PhraseDeleteConfirmationTitle = translator.Get("Export.List.Delete.Confirm.Title", "Delete export confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = translator.Get("Export.List.Delete.Confirm.Info", "Delete export confirmation info", "This will remove that export from all postal addresses.").EscapeHtml();
     List = new List <ExportListItemViewModel>(
         database.Query <Export>()
         .Select(c => new ExportListItemViewModel(translator, c))
         .OrderBy(c => c.Name));
 }
예제 #16
0
 public PhraseListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderKey     = translator.Get("Phrase.List.Header.Key", "Column 'Key' in the phrase list", "Key");
     PhraseHeaderEnglish = translator.Get("Phrase.List.Header.English", "Column 'English' in the phrase list", "English");
     PhraseHeaderGerman  = translator.Get("Phrase.List.Header.German", "Column 'German' in the phrase list", "German");
     PhraseHeaderFrench  = translator.Get("Phrase.List.Header.French", "Column 'French' in the phrase list", "French");
     PhraseHeaderItalian = translator.Get("Phrase.List.Header.Italian", "Column 'Italian' in the phrase list", "Italian");
     List = new List <PhraseListItemViewModel>(
         database.Query <Phrase>()
         .OrderBy(p => p.Key.Value)
         .Select(c => new PhraseListItemViewModel(translator, c)));
 }
예제 #17
0
 public TagListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderName              = translator.Get("Tag.List.Header.Name", "Column 'Name' in the tag list", "Name").EscapeHtml();
     PhraseHeaderUsage             = translator.Get("Tag.List.Header.Usage", "Column 'Usage' in the tag list", "Usage").EscapeHtml();
     PhraseHeaderMode              = translator.Get("Tag.List.Header.Mode", "Column 'Mode' in the tag list", "Mode").EscapeHtml();
     PhraseDeleteConfirmationTitle = translator.Get("Tag.List.Delete.Confirm.Title", "Delete tag confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = translator.Get("Tag.List.Delete.Confirm.Info", "Delete tag confirmation info", "This will remove that tag from all contacts.").EscapeHtml();
     List = new List <TagListItemViewModel>(
         database.Query <Tag>()
         .Select(t => new TagListItemViewModel(translator, t))
         .OrderBy(t => t.Name));
 }
예제 #18
0
 public MailingElementListViewModel(Translator translator, IDatabase database)
 {
     PhraseHeaderOwner             = translator.Get("MailingElement.List.Header.Owner", "Column 'Owner' in the mailing element list", "Owner");
     PhraseHeaderName              = translator.Get("MailingElement.List.Header.Name", "Column 'Name' in the mailing element list", "Name");
     PhraseHeaderType              = translator.Get("MailingElement.List.Header.Type", "Column 'Type' in the mailing element list", "Type");
     PhraseDeleteConfirmationTitle = translator.Get("MailingElement.List.Delete.Confirm.Title", "Delete mailing element confirmation title", "Delete?");
     PhraseDeleteConfirmationInfo  = translator.Get("MailingElement.List.Delete.Confirm.Info", "Delete mailing element confirmation info", "That mailing element will be removed for all mailings.");
     List = new List <MailingElementListItemViewModel>(database
                                                       .Query <MailingElement>()
                                                       .Select(e => new MailingElementListItemViewModel(translator, e))
                                                       .OrderBy(e => e.Name));
 }
예제 #19
0
 public PublicKeyEditViewModel(Translator translator)
     : base(translator,
            translator.Get("PublicKey.Edit.Title", "Title of the edit publicKey dialog", "Edit public key"),
            "publicKeyEditDialog")
 {
     PhraseFieldType    = translator.Get("PublicKey.Edit.Field.Type", "Field 'Type' in the edit public key dialog", "Type").EscapeHtml();
     PhraseFieldKeyId   = translator.Get("PublicKey.Edit.Field.KeyId", "Field 'KeyId' in the edit public key dialog", "Key ID").EscapeHtml();
     PhraseFieldUid     = translator.Get("PublicKey.Edit.Field.Uid", "Field 'User ID' in the edit public key dialog", "User ID").EscapeHtml();
     PhraseFieldKeyFile = translator.Get("PublicKey.Edit.Field.KeyFile", "Field 'KeyFile' in the edit public key dialog", "Key file").EscapeHtml();
     Type     = string.Empty;
     FileData = string.Empty;
 }
예제 #20
0
 public DocumentEditViewModel(Translator translator)
     : base(translator,
            translator.Get("Document.Edit.Title", "Title of the edit document dialog", "Edit document"),
            "documentEditDialog")
 {
     PhraseFieldType        = translator.Get("Document.Edit.Field.Type", "Field 'Type' in the edit document dialog", "Type").EscapeHtml();
     PhraseFieldVerifier    = translator.Get("Document.Edit.Field.Verifier", "Field 'Verifier' in the edit document dialog", "Verifier").EscapeHtml();
     PhraseFieldCreatedDate = translator.Get("Document.Edit.Field.CreatedDate", "Field 'CreatedDate' in the edit document dialog", "CreatedDate").EscapeHtml();
     PhraseFieldFile        = translator.Get("Document.Edit.Field.File", "Field 'File' in the edit document dialog", "File").EscapeHtml();
     Type     = string.Empty;
     Verifier = string.Empty;
     FileData = string.Empty;
 }
 public ContactDetailPublicKeysViewModel(Translator translator, Session session, Contact contact)
 {
     Title = translator.Get("Contact.Detail.PublicKeys.Title", "Title of the public keys part of the contact detail page", "Public keys").EscapeHtml();
     Id    = contact.Id.Value.ToString();
     List  = new List <ContactDetailPublicKeyItemViewModel>(contact.PublicKeys
                                                            .Select(pk => new ContactDetailPublicKeyItemViewModel(translator, pk))
                                                            .OrderBy(pk => pk.Type + "/" + pk.KeyId));
     Editable =
         session.HasAccess(contact, PartAccess.Contact, AccessRight.Write) ?
         "editable" : "accessdenied";
     PhraseDeleteConfirmationTitle = translator.Get("Contact.Detail.Master.PublicKeys.Delete.Confirm.Title", "Delete public key confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = string.Empty;
 }
예제 #22
0
 public ContactDetailTagAssignmentViewModel(Translator translator, Session session, Contact contact)
 {
     Id   = contact.Id.Value.ToString();
     List = new List <ContactDetailTagAssignmentItemViewModel>(
         contact.TagAssignments
         .Select(m => new ContactDetailTagAssignmentItemViewModel(translator, m))
         .OrderBy(m => m.Name));
     Editable =
         session.HasAccess(contact, PartAccess.TagAssignments, AccessRight.Write) ?
         "editable" : "accessdenied";
     PhraseHeaderName  = translator.Get("Contact.Detail.TagAssignment.Header.Name", "Column 'Name' on the tagAssignment tab of the contact detail page", "Name").EscapeHtml();
     PhraseHeaderUsage = translator.Get("Contact.Detail.TagAssignment.Header.Usage", "Column 'Usage' on the tagAssignment tab of the contact detail page", "Usage").EscapeHtml();
 }
예제 #23
0
 public ContactDetailSubscriptionViewModel(IDatabase database, Translator translator, Session session, Contact contact)
 {
     Id   = contact.Id.Value.ToString();
     List = new List <ContactDetailSubscriptionItemViewModel>(
         contact.Subscriptions
         .Select(m => new ContactDetailSubscriptionItemViewModel(database, translator, m))
         .OrderBy(m => m.Feed));
     Editable =
         session.HasAccess(contact, PartAccess.TagAssignments, AccessRight.Write) ?
         "editable" : "accessdenied";
     PhraseHeaderFeed        = translator.Get("Contact.Detail.Subscription.Header.Feed", "Column 'Feed' on the subscription tab of the contact detail page", "Feed");
     PhraseHeaderStatus      = translator.Get("Contact.Detail.Subscription.Header.Status", "Column 'Status' on the subscription tab of the contact detail page", "Status");
     PhraseHeaderVotingRight = translator.Get("Contact.Detail.Subscription.Header.VotingRight", "Column 'Voting right' on the subscription tab of the contact detail page", "Voting right");
 }
예제 #24
0
        private static string GetTitle(Translator translator, ServiceType service)
        {
            switch (service)
            {
            case ServiceType.EMail:
                return(translator.Get("Contact.Detail.Master.Mail.Title", "Title of the section 'E-Mail addresses' on the master data tab in the contact detail page", "E-Mail addresses").EscapeHtml());

            case ServiceType.Phone:
                return(translator.Get("Contact.Detail.Master.Phone.Title", "Title of the section 'Phone numbers' on the master data tab in the contact detail page", "Phone numbers").EscapeHtml());

            default:
                throw new NotSupportedException();
            }
        }
예제 #25
0
 public ContactMasterPostalViewModel(Translator translator, Session session, Contact contact)
     : base(contact,
            translator.Get("Contact.Detail.Master.PostalAddresses.Title", "Title of the section 'Postal addreses' on the master data tab in the contact detail page", "Postal addresses"))
 {
     List = new List <PostalAddressViewModel>(
         contact.PostalAddresses
         .OrderBy(a => a.Precedence.Value)
         .Select(a => new PostalAddressViewModel(translator, a)));
     Editable =
         session.HasAccess(contact, PartAccess.Contact, AccessRight.Write) ?
         "editable" : "accessdenied";
     PhraseDeleteConfirmationTitle = translator.Get("Contact.Detail.Master.PostalAddresses.Delete.Confirm.Title", "Delete postal address confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = string.Empty;
 }
예제 #26
0
        public static string Translate(this TagUsage usage, Translator translator)
        {
            switch (usage)
            {
            case TagUsage.None:
                return(translator.Get("Enum.TagUsage.None", "None value in the tag usage flag enum", "None"));

            case TagUsage.Mailing:
                return(translator.Get("Enum.TagUsage.Mailing", "Mailing value in the tag usage flag enum", "Mailing"));

            default:
                throw new NotSupportedException();
            }
        }
예제 #27
0
        public static string Translate(this MailingElementType type, Translator translator)
        {
            switch (type)
            {
            case MailingElementType.Header:
                return(translator.Get("Enum.MailingElementType.Header", "Header value in the mailing element type enum", "Header"));

            case MailingElementType.Footer:
                return(translator.Get("Enum.MailingElementType.Footer", "Footer value in the mailing element type enum", "Footer"));

            default:
                throw new NotSupportedException();
            }
        }
        private static string Translate(Translator translator, ServiceType service)
        {
            switch (service)
            {
            case ServiceType.EMail:
                return(translator.Get("ServiceAddress,Edit.Title.EMail", "Title of the edit e-mail address dialog", "Edit E-Mail address").EscapeHtml());

            case ServiceType.Phone:
                return(translator.Get("ServiceAddress,Edit.Title.EMail", "Title of the edit phone number dialog", "Edit phone number").EscapeHtml());

            default:
                throw new NotSupportedException();
            }
        }
예제 #29
0
        public static string Translate(this DocumentType type, Translator translator)
        {
            switch (type)
            {
            case DocumentType.Other:
                return(translator.Get("Enum.DocumentType.Other", "Value 'Other' in DocumentType enum", "Other"));

            case DocumentType.Verification:
                return(translator.Get("Enum.DocumentType.Verification", "Value 'Verification' in DocumentType enum", "Verification"));

            default:
                throw new NotSupportedException();
            }
        }
예제 #30
0
 public MailingListViewModel(Translator translator, IDatabase database, Session session)
 {
     PhraseHeaderTitle             = translator.Get("Mailing.List.Header.Title", "Column 'Title' in the mailing list", "Title").EscapeHtml();
     PhraseHeaderFeed              = translator.Get("Mailing.List.Header.Feed", "Column 'Feed' in the mailing list", "Feed").EscapeHtml();
     PhraseHeaderStatus            = translator.Get("Mailing.List.Header.Status", "Column 'Status' in the mailing list", "Status").EscapeHtml();
     PhraseHeaderCreator           = translator.Get("Mailing.List.Header.Creator", "Column 'Creator' in the mailing list", "Creator").EscapeHtml();
     PhraseDeleteConfirmationTitle = translator.Get("Mailing.List.Delete.Confirm.Title", "Delete mailing confirmation title", "Delete?").EscapeHtml();
     PhraseDeleteConfirmationInfo  = string.Empty;
     List = new List <MailingListItemViewModel>(database
                                                .Query <Mailing>()
                                                .Where(m => session.HasAccess(m.RecipientFeed.Value, PartAccess.Mailings, AccessRight.Read))
                                                .OrderByDescending(m => m.CreatedDate.Value)
                                                .Select(m => new MailingListItemViewModel(translator, session, m)));
 }