Solved

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

Posted on 2006-06-24
3
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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