Delete Empty CPS Annotation

This commit is contained in:
Rich 2016-04-21 20:21:18 +00:00
parent ca12e39a6b
commit 09331fa227

View File

@ -496,21 +496,34 @@ namespace Volian.Controls.Library
if(ai != null) // Update existing Annotation
using(Annotation aa = Annotation.Get(ai.AnnotationID))
{
aa.Config=config;
aa.DTS=DateTime.Now;
aa.UserID = Volian.Base.Library.VlnSettings.UserID;
aa.Save();
AnnotationInfo.Refresh(aa);
if (config == "")
{
Annotation.DeleteAnnotation(ai);
UpdateAnnotationGrid();
}
else
{
aa.Config = config;
aa.DTS = DateTime.Now;
aa.UserID = Volian.Base.Library.VlnSettings.UserID;
aa.Save();
AnnotationInfo.Refresh(aa);
UpdateAnnotationGrid();
}
}
else // Add a new Annotation
{
using(Item myItem = Item.Get(itemID ))
if (config != "")
{
using (AnnotationType myType = AnnotationType.Get(ExeType))
using (Item myItem = Item.Get(itemID))
{
using (Annotation annotation = Annotation.MakeAnnotation(myItem, myType,null, "New",config))
using (AnnotationType myType = AnnotationType.Get(ExeType))
{
annotation.Save();
using (Annotation annotation = Annotation.MakeAnnotation(myItem, myType, null, "New", config))
{
annotation.Save();
UpdateAnnotationGrid();
}
}
}
}