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