Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I need to create a simple ticketing system with ASP.NET MVC (C#).

I followed Microsoft's the tutorial here: http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3. And used it to create a page where customers can be added

Now that I have a simple system to add and edit customers, I need to be able to 'create a ticket' for a customer. I figured I'd do the same thing, just for tickets, but that just gets me a page to create customers and a page to create tickets, but no way to 'link' a ticket to a customer/customer ID

I want to be able to 'create a ticket' from the customer details page.

I'm sure this is very very simple to do, I'm just new to it and I've been googling for days without finding what i need. I just need pointed in the right direction so i can take that and run with it

Thanks in advance!
Posted
Comments
R. Giskard Reventlov 1-Jul-12 17:52pm    
Have you created a database? Have you got some sort of link between customers and their tickets? i.e. a 1-to-many relationship for customer to ticket? If not then stop and do it before proceeding. You will then be able to link a customer to a ticket. Do you know about databases and how to use them in conjunction with a web site?
Member 9195724 1-Jul-12 18:31pm    
Mark, first off thank you very much for replying. To answer your questions, yes there is a database for the customers, and the page works wonderfully. No, there is no relationship between customers and tickets (that's where I'm stuck at). how would I setup a 1-to-many relationship that will allow me to link tickets to a customer? I know little about databases. I'm used to using joomla and managing databases from cpanel with phpMyAdmin, but I'm pretty new to creating this stuff in Visual Studio and with ASP.NET all together, Which is why I'm eager to learn but sort of stuck. My current situation only allows me to be "self taught" or find online resources, so here I am
Member 9195724 1-Jul-12 19:03pm    
I'm actually googling '1-to-many relationship' and i found some good stuff that I'm trying out now. Thanks, just knowing what that was called is helping
Member 9195724 2-Jul-12 0:40am    
I have the databases created and linked, now I'm trying to figure out how to handle the code

You could watch this[^].

Read this[^].

You need to have a primary key in the customers table and a reference to that as a foreign key in the tickets table. So you would create join between CustomerID in the Customer table and CustomerID in the tickets table.

If I could draw a picture it would be easier to show you: search Google images fr one-to-many-relationship examples.

Once that is done you can easily associate customers and ther tickets.
 
Share this answer
 
Comments
DamithSL 1-Jul-12 23:20pm    
my 5!
Member 9195724 2-Jul-12 0:37am    
Thanks a lot! I have the databases created and linked, now I'm trying to figure out how to handle the code
Download this example like a model: http://ticketopensource.com/
 
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