?
Solved

could someone give me some classes for this and may be interfaces too ...?

Posted on 2006-06-24
3
Medium Priority
?
210 Views
Last Modified: 2010-04-16
Each table has add, edit, delete.

Products
--------
ProductID
Name


Materials
----------
MaterialID
Material


Colors
------
ColorID
Color

Weights
-------
WeightID
Weight


ProductSpeficitations
---------------------

ProdSpecID
ProdweightID
ProdColorID
ProdMatID
Price
0
Comment
Question by:tech_question
  • 2
3 Comments
 
LVL 3

Expert Comment

by:mistaeverly
ID: 16976459
You may need to be more specific in your question: I have not idea what you're asking.
0
 

Author Comment

by:tech_question
ID: 16976482
I meant specific classes. We sell products. Each product could have different weight, color, material etc.. Each of it would have its price. The above are the tables in the backend.

I need to get classes in C# for the above tables.

Eg of products:

Product
-----------
1)Product 1
2)Product 2

 
Material
---------
1) Sand
2) Wax

Weight
--------
1) 100
2) 2000
3)50

Colors
-------
1) Black
2) Green

ProductSpefications
-------------------
1,1,1,1,1000.00
1,2,2,2,2000.00
2,1,1,1,1000.00

Users should be able to select a particular product, then a particular material and then a parituclar color so that they can make orders in the website. Also, we could be adding more products in the future.


0
 
LVL 3

Accepted Solution

by:
mistaeverly earned 2000 total points
ID: 16976514
Your question is extremely broad (especially the last part about the user being able to choose the things).  I don't mind helping you with a simple class definition, though.  I'd go with a two classes Products and Product, defined below:

public class Products
{
    private System.Collections.ArrayList productList;

      public Products()
      {
        productList = new System.Collections.ArrayList();
      }

    public void AddProduct(string productName, string material, int weight, string color, string productSpecifications)
    {
        productList.Add(new Product(productName, material, weight, color, productSpecifications));
    }

}

public class Product
{
    public string ProductName;
    public string Material;
    public int Weight;
    public string Color;
    public string ProductSpecifications;

    public Product(string productName, string material, int weight, string color, string productSpecifications)
    {
        this.ProductName = productName;
        this.Material = material;
        this.Weight = weight;
        this.Color = color;
        this.ProductSpecifications = productSpecifications;
    }
}

Now, obviously you will need to interact with your DB to load up the class definitions, then write some addional code to output to screen, etc.
Hope this is helpful.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question