>> 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 get this entity into a local reference. >> PolicyEntity oOldPolicyEntity = this.GetEntity("PoliciesSelectByPK", >> this.CreateParameter("@PolicyPK", policyPK)); >> //Get an empty dataset and add a new row >> this.GetEmptyDataSet(); >> this.NewRow(this.GetCurrentDataSet()); >> //CopyPolicyEntity(oOldPolicyEntity, this.Entity); >> } >> // This will return either the original or the newly created one that is added. >> return this.Entity; >>} >>>