protected void Page_Load (object sender, EventArgs e) { // Get invoices and attestation rights this._attestationRights = GetAttestationRights(); this._invoices = InboundInvoices.ForOrganization(this.CurrentOrganization, true); _invoices.Sort(SortInvoicesByDueDateReverse); // Format as JSON and return Response.ContentType = "application/json"; string json = FormatAsJson(); Response.Output.WriteLine (json); Response.End(); }
private void PopulateInvoices(AttestableItems items) { InboundInvoices openInvoices = InboundInvoices.ForOrganization(Organization.PPSE); InboundInvoices unattestedInvoices = new InboundInvoices(); foreach (InboundInvoice invoice in openInvoices) { if (!invoice.Attested && invoice.Open) { if (attestationRights.ContainsKey(invoice.BudgetId)) { unattestedInvoices.Add(invoice); } } } unattestedInvoices.Sort(SortGridInvoices); foreach (InboundInvoice invoice in unattestedInvoices) { AddAttestableItem(items, invoice); } }