StreamReader & error handling

CheckOff & ChangeBar changes
CheckOff & Gen -> Base
This commit is contained in:
Rich
2010-05-25 16:06:14 +00:00
parent 4e3887c611
commit 699b412bcd
3 changed files with 269 additions and 138 deletions

View File

@@ -41,8 +41,10 @@ namespace DataLoader
{
try
{
StreamReader srf = new StreamReader(path);
xd = new XmlDocument();
xd.Load(path);
xd.Load(srf);
//xd.Load(path);
fmtdata = xd.OuterXml;
}
catch(Exception ex)
@@ -61,8 +63,10 @@ namespace DataLoader
{
try
{
StreamReader sr = new StreamReader(path);
XmlDocument xdg = new XmlDocument();
xdg.Load(path);
xdg.Load(sr);
//xdg.Load(path);
genmacdata = xdg.OuterXml;
}
catch (Exception ex)
@@ -89,7 +93,15 @@ namespace DataLoader
}
// use the format name if base or non sub. If it's a sub, remove the "_".
string fname = issub ? format.Replace("_", "") : format;
Format rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
Format rec = null;
try
{
rec = Format.MakeFormat(parent, fname, nmattr, fmtdata, genmacdata, Dts, Userid);
}
catch (Exception ex)
{
frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
}
return rec;
}
public void LoadAllFormats()