Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi! I'm studding computer engineering and I'm starting in programming . I have to prepare a inventory control system with c# ,using a binary tree for the view of the items in the stock (which are in the database) . could someone help me ? I need some instructions,recommendations,manuals,opinions , in fact everything you could give me is going to be good.thank you so much !
Posted
Comments
sorawit amorn 25-Jun-13 13:10pm    
Could you provide a little more detail about how are you with c# ? and the requirements of this app ?
argentinapp 25-Jun-13 13:24pm    
I'm a student , I´m 18 years old and i never use c# before. the requirements are quite simple , i have to build a inventory control system , which should work properly . Using tree view for the view of the different articles in the database ( in fact its a inventory system of a supermarket) , and the program should give the possibility of controlling the stock of the products , adding new products or deleting products from the stock ( from the database ).
sorawit amorn 25-Jun-13 13:58pm    
should this app has any interface ? How much do you about database and programming it ?
sorawit amorn 25-Jun-13 13:58pm    
should this app has any interface ? How much do you about database and programming it ?
argentinapp 25-Jun-13 15:06pm    
No ,i choose which kind of interface I prefer. Im Junior in programming and I know a little bit more in database .

First Solution
The solution would be that on the database side you have a column of Product ID as your primary key and some other column as needed. On your coding side, you will need a function to get all of productID on database and put them in an sorted array of int or long, depending on the number of product. From that you can simply create a function that look through that array using binary search to check the existent of the product.
Binary search algorithm.

Second Solution
You can create object class of product that contain ProductID and whatever needed. From that you can created Binary Tree using your productID to sort the object. To look up the inventory, you would have to create a function similar to Binary search algorithm

EDIT: Your table probably looks like :
PRODUCT_TABLE : PRODUCT_ID AS Primary Key,GROUP_ID As Foreign Key, PRODUCT_NAME, PRODUCT_PRICE
GROUP_TABLE : GROUP_ID As Primary Key, Group_Name

NOTE: You probably want 2 binary trees one for product and one for group. In the Group class and Product class will need the property that reference to one another
 
Share this answer
 
v2
As you have not used C Sharp yet, I suggest you to learn it first.

MSDN is the best place to get all the resources related to the technology. You will find articles and sample codes also.

When you start learning C#, you will also build many demo apps. Those demos will help you to understand the concepts easily.

If you face any difficulty while programming, you can always post questions here specifying the exact issue. You can find many awesome articles on .NET here also.

Last, but not the least, remember that Google is your friend. Search your query in Google first, try to implement the solutions or suggestions. After that, if u still face problems, come back here.

So, get started. Good luck. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900