Re: Business objects, subset of collection



Frebe,

You got my attention earlier with your statements, but seem unable to
apply your theories to the problem at hand. Would you mind backing up
your theories with some advice on how to apply them to this scenario:

The app is for scheduling payments of invoices and has three grids
(regular DataGridViews):
A Vendor grid showing a summary view of each vendor (with total Due,
etc.)
An Invoice grid listing all invoices for the selected vendor
(including a total amount of payments scheduled for each invoice)
A Payment grid listing all payments scheduled for the selected
Invoice.

Any payments added / removed or modifed in the payment grid (or mass-
updated via code) needs to be reflected instantly in the other two
grids.

Note that the vendor grid (parent) is based on the same DB table as
the invoice grid (the children), but the vendor grid is a summary view
and the invoice grid is a detail view.

The DB tables are:
Invoice (VendNo, InvNo, DueDate, Amount)
Payment (VendNo, InvNo, SeqNo, PayDate, PayAmount)

The Vendor Grid should contain the equivalent of this simplified SQL
statement:
SELECT Invoice.VendNo, SUM(Invoice.BalDue) as TotalDue,
SUM(Payment.PayAmount) as TotalPay
FROM Invoice LEFT OUTER JOIN Payment ON
Invoice.VendNo = Payment.VendNo AND
Invoice.InvNo = Payment.InvNo
GROUP BY Invoice.VendNo

I could of course do this as a view on the DB server and use that for
the vendor grid and use the Invoice table for the Invoice grid, but
how do you keep them in sync when payments are added / deleted or
modified from the invoices? Would I have to persist the data to the
DB and rebind the grids? (too slow)

Thanks,
Jim
.



Relevant Pages

  • Re: Business objects, subset of collection
    ... The app is for scheduling payments of invoices and has three grids ... A Vendor grid showing a summary view of each vendor (with total Due, ... An Invoice grid listing all invoices for the selected vendor ...
    (comp.object)
  • Re: Business objects, subset of collection
    ... A Vendor grid showing a summary view of each vendor (with total Due, ... An Invoice grid listing all invoices for the selected vendor ... A Payment grid listing all payments scheduled for the selected ...
    (comp.object)
  • Re: Business objects, subset of collection
    ... A Vendor grid showing a summary view of each vendor (with total Due, ... An Invoice grid listing all invoices for the selected vendor ... A Payment grid listing all payments scheduled for the selected ...
    (comp.object)
  • Re: Sorting dataset
    ... The CF implementation is the same as the full framework. ... I created a DS and bound it to a Grid Control. ... What are you using to print the invoice? ... Dim DVinvoice As DataView ...
    (microsoft.public.dotnet.framework.compactframework)
  • Is there an SQL statement I can use to help populate a grid...?
    ... My grid is linked to a data control that is linked to the database. ... I would like the grid to have an extra column showing the total of the customers' payments. ...
    (comp.lang.basic.visual.misc)