This is a migrated thread and some comments may be shown as answers.

An issue of numeration

2 Answers 55 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vitaliy
Top achievements
Rank 1
Vitaliy asked on 29 Apr 2010, 10:11 AM
Probably you answered on a similar question already - I cannot find.

MS SQL 2005, FW 3.5, window forms

We have two persistent objects:
1. Vouchers - a grouping of financial transactions
2. Cheques - bank cheques

For both of them we use an 'user friendly'  numeration.
I.e. started with 1, within a group (the voucher numbers are unique within a financial group, the cheque numbers are unique within the bank account), and no gaps.

We implemented numeration for both of objects.
For vouchers in the insert trigger.
For cheques in the C# code.

Everything worked fine, but the accountants want to see the voucher order should really match the order of the Cheque Numbers.
I.e. this is no good:
Voucher Number Cheque Number
409 100624
411 100625
412 100626
410 100627

Cheque number chains are user editable.
The system recreates every cheque voucher when the cheque changed.
Every cheque can have 1:many vouchers associated with.

I do understand that this in not a clear Open Access issue. And the direct solution would be to implement both numerations on the client side code.
But It would be grateful if you could help me with any suggestion about how to implement this easier.
E.g. if I could change the insert statement order for vouchers?
Any other idea?

Many thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Serge
Telerik team
answered on 30 Apr 2010, 06:35 PM
Hello Vitaliy,

 Unfortunately there is no good and easy solution to your problem. The best case would be to implement both number generation on the client side. The only thing I can remember of other than that, is to commit after each insert and make sure that you are inserting them in the correct order. Note that this approach might cause your application to lose performance.

Also are these numbers the underlying primary keys or are they just for the purpose of displaying some friendly strings? If they are the later it should not be too hard to implement some procedure that updates them correctly.

I do hope this helps.

Sincerely yours,
Serge
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Vitaliy
Top achievements
Rank 1
answered on 04 May 2010, 06:33 PM
Also are these numbers the underlying primary keys or are they just for the purpose of displaying some friendly strings?
They are data domain primary keys, but not the database primary keys.

Thank you.
'No' answer is an answer too :-)
Tags
Development (API, general questions)
Asked by
Vitaliy
Top achievements
Rank 1
Answers by
Serge
Telerik team
Vitaliy
Top achievements
Rank 1
Share this question
or