Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-06-24
3
Medium Priority
?
209 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 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