this.oPolicy.GetPolicyByPolicyPK(this.PolicyPK);>>>
public PolicyEntity GetPolicyByPolicyPK(Guid policyPK) >>> { >>> //return this.GetEntity("PoliciesSelectByPK", >>> // this.CreateParameter("@PolicyPK", policyPK)); >>> >>> // get the requested entity >>> PolicyEntity oPolicyEntity = this.GetEntity("PoliciesSelectByPK", >>> this.CreateParameter("@PolicyPK", policyPK)); >>> // check its status >>> if (oPolicyEntity.StatusFK != (int)StatusCode.Pending) >>> { >>> // if it is not Pending then create a new entity, copy the data from the original entity >>> PolicyEntity oNewPolicyEntity = new PolicyEntity(); >>> //CopyPolicyEntity(oPolicyEntity, oNewPolicyEntity); >>> >>> // return the new entity >>> return oNewPolicyEntity; >>> } >>> else >>> return oPolicyEntity; >>> }>>>
>> public PolicyEntity GetPolicyByPolicyPK(Guid policyPK) >> { >> >> >> // get the requested entity - leave on the business object for return in the event we need it. >> this.GetEntity("PoliciesSelectByPK", >> this.CreateParameter("@PolicyPK", policyPK)); >> >> // check its status >> if (oPolicyEntity.StatusFK != (int)StatusCode.Pending) >> { >> // if it is not Pending then create a new entity, copy the data from the original entity >> PolicyEntity oNewPolicyEntity = new PolicyEntity(); >> //CopyPolicyEntity(oPolicyEntity, oNewPolicyEntity); >> >> // Clear the current entity list and add this one instead >> this.EntityList.Clear(); >> this.EntityList.Add(oNewPolicyEntity); >> } >> // This will return either the original or the newly created one that is added. >> return this.Entity; >>} >>>