Need help with Classes

H

HSalim

Hi All:

I want to learn about classes, and am having some difficulty getting to the
end.
I have a working application that I'd like to re-write using classes.
Or, atleast, use that as a basis to understand the subject, and apply it if
it would make the application better.

I am building a shipment processing application, complete with integrated
UPS Labels.
The application links to a Great Plains database to read existing orders.
The warehouse needs to be able to "split" the order into multiple packages
for streamlined pick-list operations and
to produce integrated Invoice-cum-shipping labels.


I have put together a sample MDB based on Northwind's Order and OrderDetails
tables to model my application, and can email the mdb to anyone who would be
kind enough to guide me on this. Other "students" are welcome to have it
too. At the end of the learning exercise, I'll make the project available
to all - perhaps one of the many sites dedicated to Access will agree to add
it to their sample library.

The sample - ClassExample has all the forms/code to split order information
and it works well. Now, to see how we can make it better.

So, as you know, the hierarchy in Northwind is:
Orders (1)
--Items(M) (OrderDetails table)

New Hierarchy (with physical representation in parentheses)
Orders(1)
--Items(M) (Order Details Table)
----Packages(M) (ItemPackages Table)
--Packages(M) (Not Physically represented. Can be constructed as a View or
query)
----PackageItems(M) (Package Table)

It would help to outline the table structures. (Only the most relevant
columns are shown).
Orders: OrderID, CustomerID(FK), OrderDate, ...,Row_ID
PK:OrderID
OrderItems: OrderID(FK), ProductID(FK), DetailID, Quantity, Row_ID
PK:OrderID, DetailID
ItemPackage:OrderID(FK), ProductID(FK), Seq, Quantity(to fulfill),
PkgQuantity, PkgNum,
Row_ID
PK:OrderID, ProductID, Seq
Package:OrderID(FK), PkgNum, BoxID(FK), ItemCount, ShipDate, Weight,
TrackingNumber, Row_ID
PK:OrderID, PkgNum
(Note: ItemCount in PackageItem is an aggregate, meaning that I have
some de-normalization.)

When an Order Detail row is split, a new row is added to ItemPackage and
either a new row is added to PAckage, or an existing row is updated.
Now, all of this is working well - both in the original application and in
the sample.
I am able to add/reallocate/remove line quantities to as many cartons as
needed to fill the order.

I have clearly defined ideas on what I want. (Perhaps the wrong ideas,
but...)
to start with, the class should expose the following methods:

1. Split - where a given line is split into one additional row

2. SplitAll - where a given line is split into as many rows as needed
(eg: a line with Quantity 10 is split into 4 rows (quantity per row -
3,3,3,1)

3. RemoveLine - where one split line is removed

4. Restore - where all splits are restored and the order is restored to
"original" state

I suppose once I get this far, I can add the rest of the stuff pretty
quickly.

Thanks to all who would like to help. If you want a copy of the mdb, post a
reply on the newsgroup or send me an email.

Regards
HS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top