0

I have a table called AutoNumber which have fields like

    Public Class AutoNumber{
    int Id,
    Bool Autogenerate 
    Book IsLocked,
    Int IncrementValue,
    String Prefix,
    String Postfix,
    int IdentityValue
    string ModuleName
    }

I store the settings for a module in this table.In this table i store the Next AutoNumber for a module .So whenever I am creating Customer I would fire the query and get the Value for the AutoNumber.

Now this works fine with the Single Create and Single save where in i could check the Identity Value and set the NextAutoNumber after a customer is saved.

I have functionality where in users can create multiple customer at once specifying the count like 10,so it would create the tentative autoNos for customer making sure its not duplicate.

But there is setting which is autogenerate is true and is islocked is false which kinds of the breaks my code .

i am unable to set next autoNumber when this settings are enabled . The user changes the autoNos as his wish and i am unable to determine whether that user entered new value or he its system generated and thus unable to set the next autoNumber

garyson ford
  • 71
  • 1
  • 5

1 Answers1

0

It is not an answer. But I want give you a suggestion that you may use a static counter. This counter will keep on updating by all users and then on some event you may restart the counting after adding that counter in existing number of database. By this you may minimize the calls to database.

Ammar
  • 152
  • 2
  • 12