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:
parent
ed9d8d641b
commit
f9d47b82cb
@ -15,6 +15,8 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
public partial class dlgExportImport : Form
|
public partial class dlgExportImport : Form
|
||||||
{
|
{
|
||||||
|
private int oldRODbID;
|
||||||
|
private int newRODbID;
|
||||||
private string PEIPath;
|
private string PEIPath;
|
||||||
private string _MyMode;
|
private string _MyMode;
|
||||||
private FolderInfo MyFolder = null;
|
private FolderInfo MyFolder = null;
|
||||||
@ -1828,6 +1830,7 @@ namespace DataLoader
|
|||||||
}
|
}
|
||||||
private RODb AddRODb(XmlReader xr)
|
private RODb AddRODb(XmlReader xr)
|
||||||
{
|
{
|
||||||
|
oldRODbID = int.Parse(xr.GetAttribute("rodbid"));
|
||||||
string roname = xr.GetAttribute("roname");
|
string roname = xr.GetAttribute("roname");
|
||||||
string folderpath = xr.GetAttribute("folderpath");
|
string folderpath = xr.GetAttribute("folderpath");
|
||||||
string dbconnectionstring = xr.GetAttribute("dbconnectionstring");
|
string dbconnectionstring = xr.GetAttribute("dbconnectionstring");
|
||||||
@ -1838,12 +1841,14 @@ namespace DataLoader
|
|||||||
rv = RODb.GetByFolderPath(folderpath);
|
rv = RODb.GetByFolderPath(folderpath);
|
||||||
if (rv == null)
|
if (rv == null)
|
||||||
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
||||||
|
newRODbID = rv.RODbID;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private RODb AddRODb(XmlNode xrodb)
|
private RODb AddRODb(XmlNode xrodb)
|
||||||
{
|
{
|
||||||
lblImportStatus.Text = "Creating RODb...";
|
lblImportStatus.Text = "Creating RODb...";
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
|
oldRODbID = int.Parse(xrodb.Attributes.GetNamedItem("rodbid").InnerText);
|
||||||
string roname = xrodb.Attributes.GetNamedItem("roname").InnerText;
|
string roname = xrodb.Attributes.GetNamedItem("roname").InnerText;
|
||||||
string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText;
|
string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText;
|
||||||
string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText;
|
string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText;
|
||||||
@ -1854,6 +1859,7 @@ namespace DataLoader
|
|||||||
rv = RODb.GetByFolderPath(folderpath);
|
rv = RODb.GetByFolderPath(folderpath);
|
||||||
if (rv == null)
|
if (rv == null)
|
||||||
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
||||||
|
newRODbID = rv.RODbID;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private int GetProcedureData(XmlReader xr)
|
private int GetProcedureData(XmlReader xr)
|
||||||
@ -1933,8 +1939,8 @@ namespace DataLoader
|
|||||||
DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
|
DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
|
||||||
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
||||||
rou.Save();
|
rou.Save();
|
||||||
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
|
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
|
||||||
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
|
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
|
||||||
if (lookFor != replaceWith)
|
if (lookFor != replaceWith)
|
||||||
{
|
{
|
||||||
content.Text = content.Text.Replace(lookFor, replaceWith);
|
content.Text = content.Text.Replace(lookFor, replaceWith);
|
||||||
@ -1952,8 +1958,8 @@ namespace DataLoader
|
|||||||
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||||
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
||||||
rou.Save();
|
rou.Save();
|
||||||
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
|
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
|
||||||
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
|
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
|
||||||
if (lookFor != replaceWith)
|
if (lookFor != replaceWith)
|
||||||
{
|
{
|
||||||
content.Text = content.Text.Replace(lookFor, replaceWith);
|
content.Text = content.Text.Replace(lookFor, replaceWith);
|
||||||
|
@ -15,6 +15,8 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
public partial class dlgExportImport : Form
|
public partial class dlgExportImport : Form
|
||||||
{
|
{
|
||||||
|
private int oldRODbID;
|
||||||
|
private int newRODbID;
|
||||||
private FolderInfo _MyNewFolder;
|
private FolderInfo _MyNewFolder;
|
||||||
public FolderInfo MyNewFolder
|
public FolderInfo MyNewFolder
|
||||||
{
|
{
|
||||||
@ -1834,6 +1836,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private RODb AddRODb(XmlReader xr)
|
private RODb AddRODb(XmlReader xr)
|
||||||
{
|
{
|
||||||
|
oldRODbID = int.Parse(xr.GetAttribute("rodbid"));
|
||||||
string roname = xr.GetAttribute("roname");
|
string roname = xr.GetAttribute("roname");
|
||||||
string folderpath = xr.GetAttribute("folderpath");
|
string folderpath = xr.GetAttribute("folderpath");
|
||||||
string dbconnectionstring = xr.GetAttribute("dbconnectionstring");
|
string dbconnectionstring = xr.GetAttribute("dbconnectionstring");
|
||||||
@ -1844,12 +1847,14 @@ namespace VEPROMS
|
|||||||
rv = RODb.GetByFolderPath(folderpath);
|
rv = RODb.GetByFolderPath(folderpath);
|
||||||
if (rv == null)
|
if (rv == null)
|
||||||
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
||||||
|
newRODbID = rv.RODbID;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private RODb AddRODb(XmlNode xrodb)
|
private RODb AddRODb(XmlNode xrodb)
|
||||||
{
|
{
|
||||||
lblImportStatus.Text = "Creating RODb...";
|
lblImportStatus.Text = "Creating RODb...";
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
|
oldRODbID = int.Parse(xrodb.Attributes.GetNamedItem("rodbid").InnerText);
|
||||||
string roname = xrodb.Attributes.GetNamedItem("roname").InnerText;
|
string roname = xrodb.Attributes.GetNamedItem("roname").InnerText;
|
||||||
string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText;
|
string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText;
|
||||||
string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText;
|
string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText;
|
||||||
@ -1860,6 +1865,7 @@ namespace VEPROMS
|
|||||||
rv = RODb.GetByFolderPath(folderpath);
|
rv = RODb.GetByFolderPath(folderpath);
|
||||||
if (rv == null)
|
if (rv == null)
|
||||||
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid);
|
||||||
|
newRODbID = rv.RODbID;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private int GetProcedureData(XmlReader xr)
|
private int GetProcedureData(XmlReader xr)
|
||||||
@ -1939,8 +1945,8 @@ namespace VEPROMS
|
|||||||
DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
|
DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
|
||||||
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
||||||
rou.Save();
|
rou.Save();
|
||||||
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
|
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
|
||||||
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
|
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
|
||||||
if (lookFor != replaceWith)
|
if (lookFor != replaceWith)
|
||||||
{
|
{
|
||||||
content.Text = content.Text.Replace(lookFor, replaceWith);
|
content.Text = content.Text.Replace(lookFor, replaceWith);
|
||||||
@ -1958,8 +1964,8 @@ namespace VEPROMS
|
|||||||
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||||
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
|
||||||
rou.Save();
|
rou.Save();
|
||||||
string lookFor = string.Format("#Link:ReferencedObject:{0} ", rousageid);
|
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
|
||||||
string replaceWith = string.Format("#Link:ReferencedObject:{0} ", rou.ROUsageID.ToString());
|
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
|
||||||
if (lookFor != replaceWith)
|
if (lookFor != replaceWith)
|
||||||
{
|
{
|
||||||
content.Text = content.Text.Replace(lookFor, replaceWith);
|
content.Text = content.Text.Replace(lookFor, replaceWith);
|
||||||
|
@ -299,6 +299,7 @@ namespace VEPROMS
|
|||||||
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi);
|
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi);
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
MySessionInfo.CheckInItem(ownerid);
|
MySessionInfo.CheckInItem(ownerid);
|
||||||
|
if(args.Index == 1 && dlg.MyNewFolder != null)
|
||||||
tv.AddNewNode(dlg.MyNewFolder);
|
tv.AddNewNode(dlg.MyNewFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user