This commit is contained in:
@@ -106,6 +106,7 @@ namespace DataLoader
|
||||
frmMain.Status = "Load All Formats";
|
||||
//LoadAllFormats();
|
||||
//Format.UpdateFormats(_FmtAllPath, _GenmacAllPath);
|
||||
|
||||
Format.UpdateFormats(frmMain.MySettings.FormatFolder, frmMain.MySettings.GenMacFolder);
|
||||
|
||||
//Format baseFormat = Format.Get(1);
|
||||
@@ -139,6 +140,43 @@ namespace DataLoader
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool LoadFoldersIntoExisting(string s)
|
||||
{
|
||||
try
|
||||
{
|
||||
frmMain.Status = "Getting Connection";
|
||||
// get the connection and annotations from the existing database.
|
||||
dbConn = Connection.GetByName("Default");
|
||||
//dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.MySettings.DBName), 1, null, DateTime.Now, "Migration");
|
||||
|
||||
frmMain.Status = "Getting AnnotationTypes";
|
||||
CommentType = AnnotationType.GetByName("Comment"); // .MakeAnnotationType("Comment", null);
|
||||
MigrationErrorType = AnnotationType.GetByName("Migration Error");
|
||||
VerificationRequiredType = AnnotationType.GetByName("Verification Required");
|
||||
|
||||
List<Folder> lfldr = vlnDataPathFolders(); // get plant level list.
|
||||
|
||||
List<vlnObject> dp2 = new List<vlnObject>();
|
||||
foreach (Folder fldr in lfldr)
|
||||
{
|
||||
TreeNode tn = frmMain.TV.Nodes.Add(fldr.Name);
|
||||
tn.Tag = fldr;
|
||||
vlnObject vb = new vlnObject(null, "datapath", fldr.Name, fldr.Title);
|
||||
dp2.Add(vb);
|
||||
vlnServer vs = new vlnServer();
|
||||
frmMain.Status = "Loading " + fldr.Name;
|
||||
MigrateChildren(vb, vs, dbConn, fldr, tn);
|
||||
tn.Expand();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Could not load data, error = {0}", ex.Message);
|
||||
//return false;
|
||||
throw new Exception("Error in LoadFolders", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void ClearData()
|
||||
{
|
||||
Database.PurgeData();
|
||||
|
Reference in New Issue
Block a user