public void Save()
{
string content = Serialize();
var document = new dbDocument();
var dao = new DocumentDAO();
bool documentExists = dao.hasDocument(uuid);
//if( !documentExists )
// LogManager.Trace("Creating new Test Adapter Description with uuid of {0}", uuid);
//else
// LogManager.Trace("Saving Test Adapter Description with uuid of {0}", uuid);
document.contentType = "text/xml";
document.documentDescription = "Test Adapter";
document.documentName = Identification.ModelName;
document.documentVersion = version;
document.documentSize = content.Length;
document.documentTypeId = (int) dbDocument.DocumentType.TEST_ADAPTER_DESCRIPTION;
document.documentContent = Encoding.UTF8.GetBytes(content);
document.UUID = Guid.Parse(uuid);
document.DataState = documentExists ? BASEBean.eDataState.DS_EDIT : BASEBean.eDataState.DS_ADD;
document.save();
foreach (IdentificationNumber idNumber in Identification.IdentificationNumbers)
{
string type = Enum.GetName(typeof (IdentificationNumberType), idNumber.type);
string number = idNumber.number;
var asset = new AssetIdentificationBean();
asset.assetNumber = number;
asset.assetType = type;
asset.uuid = Guid.Parse(uuid);
asset.DetermineDataState();
asset.save();
}
}