Simplify User Interface, added Fix Transitions button, fixed problems with loader and fix transitions

This commit is contained in:
2010-03-25 14:37:01 +00:00
parent 77b8e31d8d
commit 037c3f47e0
2 changed files with 177 additions and 92 deletions

View File

@@ -24,6 +24,7 @@ using vlnObjectLibrary;
using vlnServerLibrary;
using VEPROMS.CSLA.Library;
using Config;
using Volian.Controls.Library;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
@@ -239,7 +240,7 @@ namespace DataLoader
if (wordProcesses.Length > 0)
{
AddError("{0} copies of MS Word are running", wordProcesses.Length);
if (MessageBox.Show("MS Word is Running and must be stopped", "MS Word is Running", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (MessageBox.Show("MS Word is Running and must be stopped before proceeding.\n\nStop MS Word?", "MS Word is Running", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
TerminateProcesses(wordProcesses);
MyFrmErrors.Clear();
@@ -274,18 +275,22 @@ namespace DataLoader
DocVersion v = null;
foreach (DocVersionInfo vi in vl)
{
if (vi.Title.ToUpper() == tbSource.Text.ToUpper()) // is this the procedure set we want to convert?
{
//if (vi.Title.ToUpper() == tbSource.Text.ToUpper()) // is this the procedure set we want to convert?
//{
v = DocVersion.Get(vi.VersionID);
Status = "Load " + v.Title + " - " + v.Name;
lblCurSetFolder.Text = v.Title;
lblCurSetFolder.Visible = true;
lblProcessing.Visible = true;
ts += ldr.MigrateDocVersion(v, true);
}
//}
//v = DocVersion.Get(vi.VersionID);
//bool convertProcedures = (vi.Title.ToUpper() == tbSource.Text.ToUpper());
//Item itm = ldr.MigrateDocVersion(v, convertProcedures);
}
MessageBox.Show(string.Format("{0} seconds", ts.TotalSeconds));
MessageBox.Show(string.Format("Conversion completion time: {0:D2}:{1:D2}:{2:D2}.{3}\r\n\n({4} Total Seconds)", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds, ts.TotalSeconds));
//MessageBox.Show(string.Format("{0} seconds", ts.TotalSeconds));
//TextConvert.ListSpecialCharacters();
}
}
@@ -454,6 +459,7 @@ namespace DataLoader
private void frmLoader_FormClosing(object sender, FormClosingEventArgs e)
{
TextConvert.MyGlitches.Save(@"C:\Temp\ConversionGlitches.xml");
Properties.Settings.Default.VeSamFilename = tbVesamPath.Text;
Properties.Settings.Default.DbfPathname = tbSource.Text;
Properties.Settings.Default.LoadWordDoc = cbSaveDoc.CheckState;
@@ -468,5 +474,24 @@ namespace DataLoader
if (fbd.ShowDialog() == DialogResult.OK)
tbVePromsPath.Text = fbd.SelectedPath;
}
private void tbVePromsPath_TextChanged(object sender, EventArgs e)
{
tbVesamPath.Text = tbVePromsPath.Text + @"\vesam.opt";
}
private void btnFixTransitions_Click(object sender, EventArgs e)
{
StepRTB rtb = new StepRTB();
TransitionFixer myFixer = new TransitionFixer(rtb);
myFixer.StatusChanged += new TransitionFixerEvent(myFixer_StatusChanged);
TimeSpan howlong = myFixer.Process();
MessageBox.Show(string.Format("Fix Transitions completion time: {0:D2}:{1:D2}:{2:D2}.{3}\r\n\n({4} Total Seconds)", howlong.Hours, howlong.Minutes, howlong.Seconds, howlong.Milliseconds, howlong.TotalSeconds));
}
void myFixer_StatusChanged(object sender, TransitionFixerEventArgs args)
{
Status = args.MyStatus;
}
}
}
}