Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

16 Experts available now in Live!

Get 1:1 Help Now