p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Basics (http://p2p.wrox.com/forumdisplay.php?f=136)
-   -   Ref numbers (http://p2p.wrox.com/showthread.php?t=65288)

RubyRue January 16th, 2008 06:22 AM

Ref numbers

We are currently building a system where a user can submit a request and is given an automated ref number ie 1001 (we are using identity in sql to auto generate the ref number). If that request gets rejected a user can resubmit the request by entering their ref number which will bring up their previous request, amend it and submit it again however when they submit it it adds an a, b, c etc to the end of the request ie 1001a. We have created a separate table in the db to hold the re-submitted requests so as not to overwrite the previous requests and so it doesn't auto generate a new number when another row is added to the table and so we can hold the alphanumeric characters.

Is this the right way to go about it? Can anyone give us an idea on how to add the alphanumeric character to the end of the ref number?

Many thanks

gbianchi January 16th, 2008 07:41 AM

hi there..

add a char to the end of a number is a string concatenation, nothing dificult.

But without seeing your system and not knowing how exactly works, if the new request is exactly the same as the old one (maybe with some change?) why not give the user a new ref. number and has a field in the same table that point to the last ref. number (or null is that is the first one?)



================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
================================================== =========
I know that CVS was evil, and now i got the proof:
================================================== =========

planoie January 16th, 2008 11:29 AM

Ask yourself these questions:

Do you have it working? Are you content with it working this way?

Are business rule such that this is an acceptable solution?

When you ask

Is this the right way to go about it?
are you asking if it's the right technical solution (i.e. second table with a text field for ref "#" instead of another solution) or are you asking if this is the right logical solution (i.e. appending a char to the end of an integer to indicate re-submitted requests)?

Echoing my previous questions: If the logical solution is acceptable by your business rules and the technical solution works, then sure, it's a perfectly fine way of doing it.


All times are GMT -4. The time now is 12:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.