handle having procedure in working draft and not in approved folder
utilize config column of revisions table to save start date time
This commit is contained in:
parent
7ff80c70f7
commit
0e74f50248
@ -64,6 +64,8 @@ namespace DataLoader
|
||||
{
|
||||
bool rv = false;
|
||||
frmMain.MyInfo = string.Format("Loading approved data for Procedure: {0}", pi.DisplayNumber);
|
||||
// if working draft procedure does not exist in approved folder, don't bother processing
|
||||
if (!af.EntryFromProc.ContainsKey(pi.DisplayNumber)) return rv;
|
||||
using (Revision revision = CreateRevision(af, pi))
|
||||
{
|
||||
System.DateTime dts = pi.DTS;
|
||||
@ -105,7 +107,9 @@ namespace DataLoader
|
||||
string revisionNumber = pinf.Rev;
|
||||
System.DateTime revisionDate = System.DateTime.Parse(pinf.RevDate ?? "1/1/1980");
|
||||
string notes = "Migration Of Current Approved Revision";
|
||||
string config = string.Empty;
|
||||
RevisionConfig cfg = new RevisionConfig();
|
||||
cfg.History_StartDate = pinf.StartDateTime;
|
||||
string config = cfg.ToString();
|
||||
System.DateTime dts = pi.DTS;
|
||||
string userID = pinf.UserID;
|
||||
return Revision.MakeRevision(pi.ItemID, typeID, revisionNumber, revisionDate, notes, config, dts, userID);
|
||||
@ -341,6 +345,12 @@ namespace DataLoader
|
||||
get { return _UserID; }
|
||||
set { _UserID = value; }
|
||||
}
|
||||
private System.DateTime _StartDateTime;
|
||||
public System.DateTime StartDateTime
|
||||
{
|
||||
get { return _StartDateTime; }
|
||||
set { _StartDateTime = value; }
|
||||
}
|
||||
private string _Rev;
|
||||
public string Rev
|
||||
{
|
||||
@ -365,14 +375,26 @@ namespace DataLoader
|
||||
Entry = dr["ENTRY"].ToString();
|
||||
UserID = dr["INITIALS"].ToString();
|
||||
if (UserID == string.Empty) UserID = "UNKNOWN";
|
||||
string date = System.DateTime.Parse(dr["DATE"].ToString()).ToString("MM/dd/yyyy");
|
||||
string time = dr["TIME"].ToString();
|
||||
date += " " + time.Substring(0, 2) + ":" + time.Substring(2, 2);
|
||||
StartDateTime = System.DateTime.Parse(date);
|
||||
FixItems fis = new FixItems(new FileInfo(string.Format(@"{0}\{1}.fix", afpath, Entry)));
|
||||
if (fis.Count > 0)
|
||||
{
|
||||
Rev = fis[0].Rev;
|
||||
RevDate = fis[0].RevDate;
|
||||
RevDate = fis[0].RevDate ?? GetDBFRevDate(afpath);
|
||||
ReviewDate = fis[0].ReviewDate;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetDBFRevDate(string afpath)
|
||||
{
|
||||
FileInfo fi = new FileInfo(afpath + @"\" + Entry + ".dbf");
|
||||
if (fi.Exists)
|
||||
return fi.LastWriteTime.ToShortDateString();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user