internal BusinessObjectActionReport <DataRepositoryActionStatus> Update(CMSContentUser cmsContentUser) { BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success); businessObjectActionReport.ValidationResult = BusinessObjectManager.Validate(cmsContentUser); if (businessObjectActionReport.ValidationResult.IsValid) { int num = 0; DateTime utcNow = DateTime.UtcNow; try { using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext()) { num = dataStoreContext.cms_ContentUser_InsertOrUpdate(cmsContentUser.CMSContentId, cmsContentUser.CMSReceivingUserId); } } catch (Exception ex) { _Log.Error("Error at cms_ContentUser_InsertOrUpdate", ex); throw new DataStoreException(ex, true); } if (num == 0) { businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected; } else { cmsContentUser.DateReceivedUtc = DateTime.UtcNow; } } else { businessObjectActionReport.Status = DataRepositoryActionStatus.ValidationFailed; _Log.WarnFormat("CMSContentUser {0} was not updated at the database because the validation failed.\nReport: {1}", DebugUtility.GetObjectString(cmsContentUser), businessObjectActionReport.ValidationResult.ToString(TextFormat.ASCII)); } return(businessObjectActionReport); }