public static Tabstrip GetInboxTabs(string currentFormId, int inboxId) { return(new Tabstrip { CurrentTab = currentFormId, Tabs = new List <Tab> { InboxOverview.Button(inboxId, "Overview").AsTab(), LinkedFolders.Button(inboxId, "Linked folders").AsTab(), Users.Button(inboxId, "Users").AsTab() } }); }
public async Task <Response> Handle(Request message) { var email = await this.context.ImportedEmails .Include(t => t.LinkedFolder) .ThenInclude(t => t.Inbox) .SingleOrExceptionAsync(t => t.Id == message.Id); return(new Response { Body = new EmailBody(email.Body, email.BodyType), From = email.From, ReceivedOn = email.ReceivedOn, ImportedOn = email.ImportedOn, Inbox = InboxOverview.Button(email.LinkedFolder.InboxId, email.LinkedFolder.Inbox.Name), LinkedFolder = LinkedFolderOverview.Button(email.LinkedFolderId, email.LinkedFolder.Name), Metadata = new MyFormResponseMetadata { Title = email.Subject } }); }
public async Task <Response> Handle(Request message) { var linkedFolder = await this.context.LinkedFolders .Include(t => t.Inbox) .SingleOrExceptionAsync(t => t.Id == message.LinkedFolderId); var emailCount = await this.context.ImportedEmails.CountAsync(t => t.LinkedFolderId == message.LinkedFolderId); return(new Response { Tabs = TabstripUtility.GetLinkedFolderTabs(typeof(LinkedFolderOverview).GetFormId(), linkedFolder.Id), Inbox = InboxOverview.Button(linkedFolder.InboxId, linkedFolder.Inbox.Name), NewItemsFolder = linkedFolder.NewItemsFolder, ProcessedItemsFolder = linkedFolder.ProcessedItemsFolder, EmailCount = MyEmails.Button(emailCount.ToString(), linkedFolder.Id), Actions = new ActionList(EditLinkedFolder.Button(linkedFolder.Id), ImportEmails.Button(linkedFolder.Id, "Import emails")), Metadata = new MyFormResponseMetadata { Title = linkedFolder.Name } }); }