Delete Empty CPS Annotation

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

View File

@ -495,14 +495,25 @@ namespace Volian.Controls.Library
AnnotationInfo ai = FirstExeAnnotation(ItemInfo.Get(itemID));
if(ai != null) // Update existing Annotation
using(Annotation aa = Annotation.Get(ai.AnnotationID))
{
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
{
if (config != "")
{
using (Item myItem = Item.Get(itemID))
{
@ -511,6 +522,8 @@ namespace Volian.Controls.Library
using (Annotation annotation = Annotation.MakeAnnotation(myItem, myType, null, "New", config))
{
annotation.Save();
UpdateAnnotationGrid();
}
}
}
}