Separate listings of one object for each object of the type of another class [closed]

-1

Good Night. My question is regarding the algorithm of my project, I am trying to make an application where each Client can make several requests but each request belongs to a different Client. I still remember that one-to-many logic and aggregation where every customer has a request as well. Only I do not know how to do this in the graphical interface of the program to separate each request by a client, how would I make the logic more or less in the application? Thank you.

    
asked by anonymous 06.04.2017 / 02:54

1 answer

0

Graphic Interface

In the Graphical Interface you can make a Customer Table , with columns such as "Customer Name", "Order Quantity", etc. That is, each Line with a different Client.

When you click on a Line in this Customer Table you open another Screen with another Table; this second screen will have Customer information and will also have a Order Table from this Customer, with Columns such as "Order Quantity", "Order Date" etc. All Orders made by this Client will be in this Table.

When you click on a line in the Order Table you can open a Screen with the Items that are displayed in another Screen (or open in a "Call Box" [floating or not] below the Line) in this Order, where the Columns would be "Product Name", "Quantity", "Unit Value", "Total Value", etc.

Here is an example I created here from the Client Data Screen:

Notethatyouwillneedalotmorethings,suchaspaymentmethods,installments,etc.Thisisjustanideaoflayou.

ClassDesign(applicationlogic):

Youcancreatea"Customer" Class that will have a "Request" List of Objects, each "Order" Object will have List of Objects "Ordered Item", and each "Ordered Item"

  • ONE (Exactly ONE) Item "Item" (the Product) that already has "Code" his and his name;
  • The Amount (% with% of units purchased in this Order);
  • The "Unit Value", the "Total Value" (which is "amount * Unit Value"), and the "Paid Value".

Remember to use " Money and Currency API " or at least int to deal with money, do not use BigDecimal for this (see here because using BigDecimal instead of Double to deal with money).

    
07.04.2017 / 22:03