Added code to resolve rodbid value in text proiperty of content object

Added code to correct error in refreshing treeview after importing procedure set
This commit is contained in:
Rich
2014-06-17 03:04:02 +00:00
parent ed9d8d641b
commit f9d47b82cb
3 changed files with 38 additions and 25 deletions

View File

@@ -15,6 +15,8 @@ namespace DataLoader
{
public partial class dlgExportImport : Form
{
private int oldRODbID;
private int newRODbID;
private string PEIPath;
private string _MyMode;
private FolderInfo MyFolder = null;
@@ -1828,7 +1830,8 @@ namespace DataLoader
}
private RODb AddRODb(XmlReader xr)
{
string roname = xr.GetAttribute("roname");
oldRODbID = int.Parse(xr.GetAttribute("rodbid"));
string roname = xr.GetAttribute("roname");
string folderpath = xr.GetAttribute("folderpath");
string dbconnectionstring = xr.GetAttribute("dbconnectionstring");
string config = xr.GetAttribute("config");
@@ -1838,12 +1841,14 @@ namespace DataLoader
rv = RODb.GetByFolderPath(folderpath);
if (rv == null)
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
return rv;
newRODbID = rv.RODbID;
return rv;
}
private RODb AddRODb(XmlNode xrodb)
{
lblImportStatus.Text = "Creating RODb...";
Application.DoEvents();
oldRODbID = int.Parse(xrodb.Attributes.GetNamedItem("rodbid").InnerText);
string roname = xrodb.Attributes.GetNamedItem("roname").InnerText;
string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText;
string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText;
@@ -1854,6 +1859,7 @@ namespace DataLoader
rv = RODb.GetByFolderPath(folderpath);
if (rv == null)
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
newRODbID = rv.RODbID;
return rv;
}
private int GetProcedureData(XmlReader xr)
@@ -1933,8 +1939,8 @@ namespace DataLoader
DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
rou.Save();
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
if (lookFor != replaceWith)
{
content.Text = content.Text.Replace(lookFor, replaceWith);
@@ -1952,8 +1958,8 @@ namespace DataLoader
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
rou.Save();
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
if (lookFor != replaceWith)
{
content.Text = content.Text.Replace(lookFor, replaceWith);