Solved

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

Posted on 2006-06-24
3
203 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now