public string GetUUTReferenceId(string partNumber, string tpsName, string ofpSwitchPin,
string swNo, string testType, string nomen, string model,
string system, string refDes, string wuc, string tpm, string tm, string tec)
{
string refUUID = "";
try
{
//UUT is a Model Number type Asset.
//TODO: Verify that this is correct: UUT - if no model then use part no
if (string.IsNullOrWhiteSpace(model))
model = partNumber;
AssetIdentificationBean asset = DocumentManager.FindAsset("Model", model);
if (asset != null)
refUUID = asset.uuid.ToString();
else
{
string prompt =
string.Format("A UUT was not found for Model Number \"{0}\" - Would you like to create one?",
model);
if (DialogResult.Yes ==
MessageBox.Show(prompt, @"V E R I F Y", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
{
refUUID = UUTController.Instance.Create(partNumber, nomen, model);
}
}
}
catch (Exception e)
{
LogManager.SourceError(ATMLReader.SOURCE, "An error has occurred attempting to save the UUT information.\nError:{0}", e.Message);
}
return refUUID;
}