Implementing the Next ID Function


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
When implementing the next ID for a non-primary key field, I would like to retrieve that incremental number during the save rather than at the SetDefaultValues (see thread).  Here is what I did in my CustomersBO:

public override MicroFour.StrataFrame.Data.SaveUndoResult Save()
{
   
this.CustID = NextIDBO.GetNextID("CM");
   
return base.Save();
}

Is that right?

Then, within the NextIDBO, I am attempting to implement the function that will return the next ID based on the ID type passed in the argument.  I am running into a syntax hurdle.  For some reason, a public method in my NextIDBO cannot be seen by the CustomersBO.  The function looks like this (full implementation code stripped for simplicity):

public int GetNextID(string pRecordType)
{
   
int mNextID = 0;
   
return mNextID;
}

Within this function I would run the appropriate stored procedure that returns a scalar value representing the next ID for the new record.  Perhaps I have not had enough coffee this morning.  What am I missing in the BOs so that the one can see the public method of the other?

Thanks,
Bill


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 18 Years Ago
Bill Cunnien - 18 Years Ago
Bill Cunnien - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Bill Cunnien - 18 Years Ago
                         [quote]When a user clicks 'Add', is a new record created in the...
Trent L. Taylor - 18 Years Ago
                             [quote][b]Trent L. Taylor (12/20/2007)[/b][hr]In this case DO NOT use...
Bill Cunnien - 18 Years Ago
                                 In my CustomersBO I have the following: public override...
Bill Cunnien - 18 Years Ago
                                     This is the method to run: private void...
Bill Cunnien - 18 Years Ago
                                         Just to wrap this up and put a nice bow on it, I found that this...
Bill Cunnien - 18 Years Ago
                                         [quote][b]Bill Cunnien (12/28/2007)[/b][hr] private void...
Bill Cunnien - 17 Years Ago
                                             'Twas an easy fix. The custid field has a default value of 0, so I...
Bill Cunnien - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search