Added ProcName attribute with value to History node of ConfigInfo xml
Added RevDate attribute with value to Procedure node of ConfigInfo xml Added ReviewDate attribute with value to Procedure node of ConfigInfo xml Changed how procedure applicability obtained from procedure APL file For multi unit data added slave node to ConfigInfo xml For multi unit data added Rev attribute with value, RevDate attribute with value and ReviewDate attribute with value to selected slave node of ConfigInfo xml
This commit is contained in:
parent
de08f24053
commit
4a7496482a
@ -64,11 +64,14 @@ namespace DataLoader
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "RevDate", tstr2);
|
||||
}
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("History", "ProcName", ProcFileName.ToUpper());
|
||||
|
||||
// Load in format data, i.e. default number of columns:
|
||||
string tstr1 = dr["Format"].ToString();
|
||||
if (tstr1 != null && tstr1 != "")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Format", "Columns", tstr1);
|
||||
}
|
||||
// try to load in fix file data:
|
||||
@ -78,10 +81,17 @@ namespace DataLoader
|
||||
FixItems fixItems = new FixItems(fi);
|
||||
if (fixItems.Count > 0)
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
if (fixItems[0].Rev != null && fixItems[0].Rev != "") ci.AddItem("Procedure", "Rev", fixItems[0].Rev);
|
||||
if (fixItems[0].RevDate != null && fixItems[0].RevDate != "") ci.AddItem("Procedure", "RevDate", fixItems[0].RevDate);
|
||||
if (fixItems[0].ReviewDate != null && fixItems[0].ReviewDate != "") ci.AddItem("Procedure", "ReviewDate", fixItems[0].ReviewDate);
|
||||
}
|
||||
}
|
||||
fi = new FileInfo(pth + @"\" + ProcFileName + @".apl");
|
||||
if (fi.Exists)
|
||||
{
|
||||
MyProcAPL = GetApple(fi.FullName);
|
||||
}
|
||||
// check that there is a "Series" column, i.e. the 10th column, some datasets
|
||||
// may not have it, for example vetuec\master.sl1
|
||||
if (dr.ItemArray.Length > 10)
|
||||
@ -89,11 +99,47 @@ namespace DataLoader
|
||||
tstr = dr["Series"].ToString();
|
||||
if (tstr != null && tstr != "")
|
||||
{
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
if (ci == null) ci = new ConfigInfo(null);
|
||||
ci.AddItem("Procedure", "Series", tstr);
|
||||
}
|
||||
}
|
||||
|
||||
if (docver.DocVersionConfig.Unit_Count > 1)
|
||||
{
|
||||
for (int i = 1; i <= docver.DocVersionConfig.Unit_Count; i++)
|
||||
{
|
||||
ci.AddSlaveNode(i);
|
||||
docver.DocVersionConfig.SelectedSlave = i;
|
||||
string un = ".SL" + docver.DocVersionConfig.Old_Index;
|
||||
|
||||
string mupth = pth.Replace(".prc", un);
|
||||
fi = new FileInfo(mupth + @"\" + ProcFileName + @".fix");
|
||||
if (fi.Exists)
|
||||
{
|
||||
FixItems fixItems = new FixItems(fi);
|
||||
if (fixItems.Count > 0)
|
||||
{
|
||||
if (fixItems[0].Rev != null && fixItems[0].Rev != "")
|
||||
ci.AddSlaveItem(i, "Rev", fixItems[0].Rev);
|
||||
else
|
||||
ci.AddSlaveItem(i, "Rev", "");
|
||||
if (fixItems[0].RevDate != null && fixItems[0].RevDate != "")
|
||||
ci.AddSlaveItem(i, "RevDate", fixItems[0].RevDate);
|
||||
else
|
||||
ci.AddSlaveItem(i, "RevDate", "");
|
||||
if (fixItems[0].ReviewDate != null && fixItems[0].ReviewDate != "")
|
||||
ci.AddSlaveItem(i, "ReviewDate", fixItems[0].ReviewDate);
|
||||
else
|
||||
ci.AddSlaveItem(i, "ReviewDate", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ci.AddSlaveItem(i, "Rev", "");
|
||||
ci.AddSlaveItem(i, "RevDate", "");
|
||||
ci.AddSlaveItem(i, "ReviewDate", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
DataSet ds = new DataSet();
|
||||
DataTable dt = null;
|
||||
|
||||
@ -180,18 +226,18 @@ namespace DataLoader
|
||||
//Console.WriteLine("number {0}", number);
|
||||
//Console.WriteLine("Item Key {0} List {1}", Item.CacheCountPrimaryKey, Item.CacheCountList);
|
||||
//Console.WriteLine("ItemInfo Key {0} List {1}", ItemInfo.CacheCountPrimaryKey, ItemInfo.CacheCountList);
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
dvi.ResetProcedures(); // need this to clear out Procedures so that they are retrieved (resolves a caching problem)
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
{
|
||||
if (ii.MyContent.Number == number)
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
{
|
||||
//Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
if (ii.MyContent.Number == number)
|
||||
{
|
||||
//Console.WriteLine(number);
|
||||
itm = ii.Get();
|
||||
cont = ii.MyContent.Get();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!convertProcedures || (docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft && docver.VersionType != (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved))
|
||||
{
|
||||
// if this procedure already exists for this docversion, just use it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user