Re: Business objects, subset of collection
- From: frebe <frebe73@xxxxxxxxx>
- Date: Fri, 18 Jan 2008 10:42:20 -0800 (PST)
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)
After adding a payment, you obviously need to refresh the grids. How
many millis does this take? How many millis does it take to execute
the SQL? What is your time constraint?
//frebe
.
- Follow-Ups:
- Re: Business objects, subset of collection
- From: jimbalo22
- Re: Business objects, subset of collection
- References:
- Business objects, subset of collection
- From: jimbalo22
- Re: Business objects, subset of collection
- From: H. S. Lahman
- Re: Business objects, subset of collection
- From: jimbalo22
- Re: Business objects, subset of collection
- From: H. S. Lahman
- Re: Business objects, subset of collection
- From: jimbalo22
- Re: Business objects, subset of collection
- From: H. S. Lahman
- Re: Business objects, subset of collection
- From: frebe
- Re: Business objects, subset of collection
- From: H. S. Lahman
- Re: Business objects, subset of collection
- From: frebe
- Re: Business objects, subset of collection
- From: jimbalo22
- Business objects, subset of collection
- Prev by Date: Re: Business objects, subset of collection
- Next by Date: Re: Business objects, subset of collection
- Previous by thread: Re: Business objects, subset of collection
- Next by thread: Re: Business objects, subset of collection
- Index(es):
Relevant Pages
|