>>>From your desc it sounds as if the UI could work the same on both states -
>>>that makes it automatically a biz rule...
>>
>>Thanks, that's my feeling too. Now how do I do this in MM.NET?
>
>Here's what I think needs to be done:
>
>When the BO gets created and data populated I need to check what the status is. If it is not "Pending" then I need to change the BO to think it is in adding mode and change the PK to a new one.
>
>I've created an override HookPostGeteEntity and can check teh status, but how do I raise the statechange so theat MM.NET thinks it's a new record?
I'm having a good conversation with myself today :)
I've tried this:
protected override void HookPostGetEntity(PolicyEntity policyEntity)
{
if (policyEntity.StatusFK != (int)StatusCode.Pending)
{
this.CallStateChange(mmBusinessState.Adding);
policyEntity.PolicyPK = Guid.NewGuid();
}
}
but i then get an exception when trying to save:
"this.oPolicy.Exception.Message: "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records."
Which I guess means there's more to it than just telling the BO it is in Add mode.
Any help appreciated.