This commit is contained in:
John Jenko 2010-03-25 14:40:00 +00:00
parent 84f26c2f9b
commit 182e9a1fd3

View File

@ -56,6 +56,8 @@ namespace DataLoader
string retval = null; string retval = null;
string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'"; string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'";
using (OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect)) using (OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect))
{
try
{ {
DataSet ds = new DataSet(); DataSet ds = new DataSet();
da.Fill(ds); da.Fill(ds);
@ -65,10 +67,17 @@ namespace DataLoader
retval = dr["Procnum"].ToString(); // this should be the procedure number! retval = dr["Procnum"].ToString(); // this should be the procedure number!
ds.Dispose(); ds.Dispose();
} }
catch (Exception ex)
{
return "<Procedure Number>";//ex.GetType().Name + " " + ex.Message;
}
}
return retval; return retval;
} }
private string GetPath(string setid) private string GetPath(string setid)
{
try
{ {
string xtsetcmd = "SELECT * FROM [xtsetid] WHERE [SETID]='" + setid + "'"; string xtsetcmd = "SELECT * FROM [xtsetid] WHERE [SETID]='" + setid + "'";
OleDbDataAdapter da = new OleDbDataAdapter(xtsetcmd, _DbConnect); OleDbDataAdapter da = new OleDbDataAdapter(xtsetcmd, _DbConnect);
@ -82,9 +91,17 @@ namespace DataLoader
ds.Dispose(); ds.Dispose();
return retval; // dr["Path"].ToString(); // this should be the path to the proc set! return retval; // dr["Path"].ToString(); // this should be the path to the proc set!
} }
catch (Exception ex)
{
return "<Procedure Set Location>";//ex.GetType().Name + " " + ex.Message;
}
}
private string GetTitle(string setid, string procid) private string GetTitle(string setid, string procid)
{ {
try
{
string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'"; string xtproccmd = "SELECT * FROM [xtprocid] WHERE [SETID]='" + setid + "' AND [PROCID]='" + procid + "'";
OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect); OleDbDataAdapter da = new OleDbDataAdapter(xtproccmd, _DbConnect);
DataSet ds = new DataSet(); DataSet ds = new DataSet();
@ -97,6 +114,11 @@ namespace DataLoader
ds.Dispose(); ds.Dispose();
return retval; // dr["Proctitle"].ToString(); // this should be the procedure number! return retval; // dr["Proctitle"].ToString(); // this should be the procedure number!
} }
catch (Exception ex)
{
return "<Procedure Title>";//ex.GetType().Name + " " + ex.Message;
}
}
public string GetDescription(string key) public string GetDescription(string key)
{ {
@ -222,19 +244,28 @@ namespace DataLoader
private static DocVersionInfo PartialMatch(string path) private static DocVersionInfo PartialMatch(string path)
{ {
string partial = GetPartial(path); string partial = GetPartial(path);
if (partial != null)
{
foreach (DocVersionInfo dvi in _DocVersions) foreach (DocVersionInfo dvi in _DocVersions)
{ {
if (dvi.MyFolder.Title.ToUpper().EndsWith(partial.ToUpper())) if (dvi.MyFolder.Title.ToUpper().EndsWith(partial.ToUpper()))
return dvi; return dvi;
} }
}
return null; return null;
} }
private static string GetPartial(string path) private static string GetPartial(string path)
{
Console.WriteLine(string.Format("GetPartial path = {0}",path));
if (path.Contains("\\"))
{ {
string[] parts = path.Split("\\".ToCharArray()); string[] parts = path.Split("\\".ToCharArray());
return "\\" + parts[parts.Length - 2] + "\\" + parts[parts.Length - 1]; return "\\" + parts[parts.Length - 2] + "\\" + parts[parts.Length - 1];
} }
else
return null;
}
private static DocVersionInfo ExactMatch(string path) private static DocVersionInfo ExactMatch(string path)
{ {