Added code to prevent user from importing a procedure set more than once.
This commit is contained in:
parent
d194f751d9
commit
bb6d3827c4
@ -180,6 +180,11 @@ namespace DataLoader
|
|||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
LoadFormats(xd);
|
LoadFormats(xd);
|
||||||
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
||||||
|
if (ff == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("You can not import the same procedure set more than once", "Duplicate Import Error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
||||||
AddAnnotationTypes(xd);
|
AddAnnotationTypes(xd);
|
||||||
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
||||||
@ -1825,6 +1830,8 @@ namespace DataLoader
|
|||||||
DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText);
|
||||||
string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText;
|
string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText;
|
||||||
Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid));
|
Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid));
|
||||||
|
if (Folder.GetByParentID_Name(p.FolderID, name) != null)
|
||||||
|
return null;
|
||||||
Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid);
|
Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,11 @@ namespace VEPROMS
|
|||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
LoadFormats(xd);
|
LoadFormats(xd);
|
||||||
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
||||||
|
if (ff == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("You can not import the same procedure set more than once", "Duplicate Import Error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
||||||
AddAnnotationTypes(xd);
|
AddAnnotationTypes(xd);
|
||||||
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
||||||
@ -1825,6 +1830,8 @@ namespace VEPROMS
|
|||||||
DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText);
|
||||||
string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText;
|
string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText;
|
||||||
Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid));
|
Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid));
|
||||||
|
if (Folder.GetByParentID_Name(p.FolderID, name) != null)
|
||||||
|
return null;
|
||||||
Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid);
|
Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user