Sql Script to Build Empty VE-PROMS Database

Use new settings (ConvertTo and ExecutableMode)
New Settings
Use new setting (PDF Folder)
Use and Control new settings
This commit is contained in:
Rich 2012-01-13 18:38:41 +00:00
parent a72f752b60
commit b480a879c5
14 changed files with 37654 additions and 728 deletions

View File

@ -58,7 +58,7 @@
</logger>
</log4net>
<appSettings>
<add key ="OperatingMode" value ="debug"/>
<add key="OperatingMode" value="debug" />
<add key="CslaAuthentication" value="Windows" />
<!-- Active Connection -->
<!-- Inactive Connections
@ -98,6 +98,54 @@
<setting name="BackupFileName" serializeAs="String">
<value />
</setting>
<setting name="BackupFolder" serializeAs="String">
<value />
</setting>
<setting name="ConnectionString" serializeAs="String">
<value>Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True</value>
</setting>
<setting name="DBName" serializeAs="String">
<value>VEPROMS</value>
</setting>
<setting name="DBPath" serializeAs="String">
<value />
</setting>
<setting name="PDFFolder" serializeAs="String">
<value />
</setting>
<setting name="CheckRTF" serializeAs="String">
<value>Unchecked</value>
</setting>
<setting name="Skip" serializeAs="String">
<value>0</value>
</setting>
<setting name="ConvertTo" serializeAs="String">
<value>1</value>
</setting>
<setting name="RedPDFs" serializeAs="String">
<value>Checked</value>
</setting>
<setting name="OnlyThisSet" serializeAs="String">
<value>Checked</value>
</setting>
<setting name="ExecutionMode" serializeAs="String">
<value>0</value>
</setting>
<setting name="Phase1" serializeAs="String">
<value>Phase1</value>
</setting>
<setting name="Phase2" serializeAs="String">
<value>Phase2</value>
</setting>
<setting name="Phase3" serializeAs="String">
<value>Phase3</value>
</setting>
<setting name="FormatFolder" serializeAs="String">
<value>c:\development\fmtall</value>
</setting>
<setting name="GenMacFolder" serializeAs="String">
<value>c:\development\genmacall</value>
</setting>
</DataLoader.Properties.Settings>
</userSettings>
</configuration>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,570 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing.Design;
using System.Reflection;
using System.Data;
using System.Collections;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Data.SqlClient;
namespace DataLoader
{
[Serializable]
class DataLoaderSettings:ICloneable
{
#region Clone
public object Clone()
{
MemoryStream memoryStream = new MemoryStream();
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, this);
memoryStream.Seek(0, SeekOrigin.Begin);
return binaryFormatter.Deserialize(memoryStream);
}
#endregion
#region 16-Bit Executable
private string _VEPromsPath; // Folder
[Category("16-Bit Executable")]
[DisplayName("VEProms Exe Folder")]
[Description("Path to the VE-PROMS Executable Folder")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string VEPromsPath
{
get { return _VEPromsPath; }
set { _VEPromsPath = value; }
}
private string _VESamFile; // File
[Category("16-Bit Executable")]
[DisplayName("VEProms Security File")]
[Description("VE-PROMS Securty File (VESam)")]
[UIFilenameEditor.FileDialogFilterAttribute("VEProms Security File|vesam.opt")]
[EditorAttribute(typeof(UIFilenameEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string VESamFile
{
get { return _VESamFile; }
set { _VESamFile = value; }
}
#endregion
#region 16-Bit Data
private string _ProcedureSetPath; // Folder
[Category("16-Bit Data")]
[DisplayName("Procedure Folder")]
[Description("Path to the Data Set being converted")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string ProcedureSetPath
{
get { return _ProcedureSetPath; }
set { _ProcedureSetPath = value; }
}
private bool _OnlyThisSet; // Boolean
[Category("16-Bit Data")]
[DisplayName("Only Process this Procedure Set")]
[Description("Only Convert the Selected Procedure Set")]
public bool OnlyThisSet
{
get { return _OnlyThisSet; }
set { _OnlyThisSet = value; }
}
#endregion
#region Format Data
private string _FormatFolder; // Folder
[Category("Format Data")]
[DisplayName("Format Folder")]
[Description("Location of XML Format Files.")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string FormatFolder
{
get { return _FormatFolder; }
set { _FormatFolder = value; }
}
private string _GenMacFolder; // Folder
[Category("Format Data")]
[DisplayName("GenMac Folder")]
[Description("Location of XML (SVG) GenMac Macro Files.")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string GenMacFolder
{
get { return _GenMacFolder; }
set { _GenMacFolder = value; }
}
#endregion
#region Backup Data
private string _BackupFileName; // String
[Category("Backup Data")]
[DisplayName("Backup File Name")]
[Description("Name of Backup File in the batch files created in the Log Folder")]
public string BackupFileName
{
get { return _BackupFileName; }
set { _BackupFileName = value; }
}
private string _BackupFolder; // Folder
[Category("Backup Data")]
[DisplayName("Backup Folder")]
[Description("Location of Backup Files created during each phase of the conversion process.")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string BackupFolder
{
get { return _BackupFolder; }
set { _BackupFolder = value; }
}
private string _Phase1Suffix; // String
[Category("Backup Data")]
[DisplayName("Phase 1 Suffix")]
[Description("Suffix to use for backup before Transitions are Fixed")]
public string Phase1Suffix
{
get { return _Phase1Suffix; }
set { _Phase1Suffix = value; }
}
private string _Phase2Suffix; // String
[Category("Backup Data")]
[DisplayName("Phase 2 Suffix")]
[Description("Suffix to use for backup before Change Manager Script")]
public string Phase2Suffix
{
get { return _Phase2Suffix; }
set { _Phase2Suffix = value; }
}
private string _Phase3Suffix; // String
[Category("Backup Data")]
[DisplayName("Phase 3 Suffix")]
[Description("Suffix to use for backup before Approval Script")]
public string Phase3Suffix
{
get { return _Phase3Suffix; }
set { _Phase3Suffix = value; }
}
#endregion
#region Process Log
private string _LogFilePath; // Folder
[Category("Process Log")]
[DisplayName("Log File Folder")]
[Description("Location of the Log Files")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string LogFilePath
{
get { return _LogFilePath; }
set { _LogFilePath = value; }
}
#endregion
#region Sql Database
private string _ConnectionString; // String
[Category("Sql Database")]
[DisplayName("SQL Connection String")]
[Description("Connection string for SQL")]
public string ConnectionString
{
get { return _ConnectionString; }
set { _ConnectionString = value; }
}
private string _DBName; // String
[Category("Sql Database")]
[DisplayName("Database Name")]
[Description("Name of the Database that will be created to contain the converted data.")]
public string DBName
{
get { return _DBName; }
set { _DBName = value; }
}
private string _DBPath; // Folder
[Category("Sql Database")]
[DisplayName("Database File Folder")]
[Description("Location of the Database files.")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string DBPath
{
get { return _DBPath; }
set { _DBPath = value; }
}
private bool _PurgeExistingData;
[Category("Sql Database")]
[DisplayName("Purge Existing Data")]
[Description("Should the data in the SQL database be purged (emptied) before adding this data.")]
public bool PurgeExistingData
{
get { return _PurgeExistingData; }
set { _PurgeExistingData = value; }
}
#endregion
#region PDFs
private string _PDFFolder; // Folder
[Category("PDFs")]
[DisplayName("PDF Folder")]
[Description("Location for PDFs when printing.")]
[EditorAttribute(typeof(UIFolderEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string PDFFolder
{
get { return _PDFFolder; }
set { _PDFFolder = value; }
}
#endregion
#region Debugging
private ExecutionMode _ExecutionMode;
[TypeConverter(typeof(EnumDescConverter))]
[DisplayName("Execution Mode")]
[Category("Debugging")]
[Description("Mode for Conversion")]
public ExecutionMode ExecutionMode
{
get { return _ExecutionMode; }
set { _ExecutionMode = value; }
}
private bool _CheckRTF;
[DisplayName("Check RTF")]
[Category("Debugging")]
[Description("This makes the Fix Transtion Code work Differently. Not sure what it does.")]
public bool CheckRTF
{
get { return _CheckRTF; }
set { _CheckRTF = value; }
}
private int _Skip; // Skip specified procedures during load.
[DisplayName("Skip First n Procedures")]
[Category("Debugging")]
[Description("Skip the specified number of procedures during conversion to get to a problem quicker.")]
public int Skip
{
get { return _Skip; }
set { _Skip = value; }
}
#endregion
#region Accessory Pages
private AccPageConversion _ConvertTo;
[TypeConverter(typeof(EnumDescConverter))]
[DisplayName("Convert To")]
[Category("Accessory Pages")]
[Description("Format to which the Accessory Page converted")]
public AccPageConversion ConvertTo
{
get { return _ConvertTo; }
set { _ConvertTo = value; }
}
private bool _RedPDFs; // Boolean
[Category("Accessory Pages")]
[DisplayName("Print MSWord PDFs in Red")]
[Description("Creates Word PDFs in Debug Mode so that Debug printing will not require Word to print again.")]
public bool RedPDFs
{
get { return _RedPDFs; }
set { _RedPDFs = value; }
}
#endregion
[Browsable(false)]
public string ValidityCheck
{
get
{
StringBuilder sb = new StringBuilder();
string ErrorPrefix = "Settings are not valid\r\n";
// VEPromsPath = has to be non-blank
if ((VEPromsPath ?? "") == "" || !Directory.Exists(VEPromsPath))
{
sb.Append(ErrorPrefix + "VEProms Exe Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// VESamFile = has to be non-blank
if ((VESamFile ?? "") == "" || !File.Exists(VESamFile))
{
sb.Append(ErrorPrefix + "VEProms Security File must point to an existing file\r\n");
ErrorPrefix = "";
}
// ProcedureSetPath = If OnlyThisSet is checked, then has to be non-blank
if (OnlyThisSet && (ProcedureSetPath ?? "") == "" || !Directory.Exists(ProcedureSetPath))
{
sb.Append(ErrorPrefix + "Procedure Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// BackupFileName = Has to be non-blank
if ((BackupFileName ?? "") == "")
{
sb.Append(ErrorPrefix + "Backup File Name must not be blank\r\n");
ErrorPrefix = "";
}
if ((Phase1Suffix ?? "") == "")
{
sb.Append(ErrorPrefix + "Phase 1 Suffix must not be blank\r\n");
ErrorPrefix = "";
}
if ((Phase2Suffix ?? "") == "")
{
sb.Append(ErrorPrefix + "Phase 2 Suffix must not be blank\r\n");
ErrorPrefix = "";
}
if ((Phase3Suffix ?? "") == "")
{
sb.Append(ErrorPrefix + "Phase 3 Suffix must not be blank\r\n");
ErrorPrefix = "";
}
// BackupFolder = Has to be non-blank
if (OnlyThisSet && (BackupFolder ?? "") == "" || !Directory.Exists(BackupFolder))
{
sb.Append(ErrorPrefix + "Backup Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// FormatFolder = Has to be non-blank
if (OnlyThisSet && (FormatFolder ?? "") == "" || !Directory.Exists(FormatFolder))
{
sb.Append(ErrorPrefix + "Format Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// GenMacFolder = Has to be non-blank
if (OnlyThisSet && (GenMacFolder ?? "") == "" || !Directory.Exists(GenMacFolder))
{
sb.Append(ErrorPrefix + "GenMac Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// LogFilePath = Has to be non-blank
if (OnlyThisSet && (LogFilePath ?? "") == "" || !Directory.Exists(LogFilePath))
{
sb.Append(ErrorPrefix + "Log File Folder must point to an existing folder\r\n");
ErrorPrefix = "";
}
// ConnectionString = Has to be non-blank
if ((ConnectionString ?? "") == "")
{
sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
ErrorPrefix = "";
}
else
{
// Validate ConnectionString
string checkConnectionString = ValidateConnectionString("Master");
if (checkConnectionString != "")
{
sb.Append(ErrorPrefix + "SQL Connection String must be a valid connection string\r\n");
sb.Append(checkConnectionString);
ErrorPrefix = "";
}
}
// DBName = Has to be non-blank
if ((DBName ?? "") == "")
{
sb.Append(ErrorPrefix + "SQL Database Name must be a valid database name\r\n");
ErrorPrefix = "";
}
// DBPath = if null check to see if DBName DB has Path, if it does then set DBPath
if ((DBPath ?? "") == "" || !Directory.Exists(DBPath))
{
string filePath = GetDBFileName();
if (filePath != null)
{
FileInfo fi = new FileInfo(filePath);
DBPath = fi.DirectoryName;
}
else
{
sb.Append(ErrorPrefix + "SQL Database Path must point to an existing folder\r\n");
ErrorPrefix = "";
}
}
// PDFFolder = if not set, then don't set PDFFolder in DocVersion.Config
if (ExecutionMode == ExecutionMode.Debug && ((PDFFolder ?? "") == "" || !Directory.Exists(PDFFolder)))
{
sb.Append(ErrorPrefix + "PDF Folder must point to an existing folder in debug mode\r\n");
ErrorPrefix = "";
}
// Skip = Any NUmber
// PurgeExistingData = N/A
// OnlyThisSet = N/A
// CheckRTF = N/A
// ConvertTo = N/A
// RedPDFs = N/A
return sb.ToString();
}
}
private string ValidateConnectionString(string dbName)
{
if(!ConnectionString.Contains("{DBName}"))
return " Needs to have a {DBName} token for the Initial Catalog";
string cnstr = ConnectionString.Replace("{DBName}", dbName);
try
{
SqlConnection cn = new SqlConnection(cnstr);
cn.Open();
cn.Close();
}
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
while (ex != null)
{
sb.Append(string.Format(" {0}-{1}",ex.GetType().Name,ex.Message));
ex = ex.InnerException;
}
return sb.ToString();
}
return "";
}
private string GetDBFileName()
{
string filename = null;
SqlConnection cn = new SqlConnection(ConnectionString.Replace("{DBName}","Master"));
cn.Open();
string cmd = string.Format("Select FileName from sysdatabases where Name = '{0}'",DBName);
SqlDataAdapter da = new SqlDataAdapter(cmd,cn);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables.Count == 1 && ds.Tables[0].Rows.Count == 1)
filename = ds.Tables[0].Rows[0][0].ToString();
cn.Close();
return filename;
}
}
public enum AccPageConversion : int
{
[Description("Don't Convert")] DoNotConvert=0,
[Description("MS Word")] MSWord = 1,
[Description("Rich Text Format")] RichTextFormat = 2
}
public enum ExecutionMode : int
{
[Description("Debug")] Debug = 0,
[Description("Production")] Production = 1,
}
public class EnumDescConverter : System.ComponentModel.EnumConverter
{
protected System.Type myVal;
/// <summary>
/// Gets Enum Value's Description Attribute
/// </summary>
/// <param name="value">The value you want the description attribute for</param>
/// <returns>The description, if any, else it's .ToString()</returns>
public static string GetEnumDescription(Enum value)
{
//Console.WriteLine("{0}", value);
FieldInfo fi = value.GetType().GetField(value.ToString());
DescriptionAttribute[] attributes =
(DescriptionAttribute[])fi.GetCustomAttributes(
typeof(DescriptionAttribute), false);
//Console.WriteLine("{0},{1},{2}", value.ToString(), attributes.Length, (attributes.Length > 0) ? attributes[0].Description : value.ToString());
return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
}
/// <summary>
/// Gets the description for certaing named value in an Enumeration
/// </summary>
/// <param name="value">The type of the Enumeration</param>
/// <param name="name">The name of the Enumeration value</param>
/// <returns>The description, if any, else the passed name</returns>
public static string GetEnumDescription(System.Type value, string name)
{
FieldInfo fi = value.GetField(name);
DescriptionAttribute[] attributes =
(DescriptionAttribute[])fi.GetCustomAttributes(
typeof(DescriptionAttribute), false);
return (attributes.Length > 0) ? attributes[0].Description : name;
}
/// <summary>
/// Gets the value of an Enum, based on it's Description Attribute or named value
/// </summary>
/// <param name="value">The Enum type</param>
/// <param name="description">The description or name of the element</param>
/// <returns>The value, or the passed in description, if it was not found</returns>
public static object GetEnumValue(System.Type value, string description)
{
FieldInfo[] fis = value.GetFields();
foreach (FieldInfo fi in fis)
{
DescriptionAttribute[] attributes =
(DescriptionAttribute[])fi.GetCustomAttributes(
typeof(DescriptionAttribute), false);
if (attributes.Length > 0)
{
if (attributes[0].Description == description)
{
return fi.GetValue(fi.Name);
}
}
if (fi.Name == description)
{
return fi.GetValue(fi.Name);
}
}
return description;
}
public EnumDescConverter(System.Type type)
: base(type.GetType())
{
myVal = type;
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (value is Enum && destinationType == typeof(string))
{
return EnumDescConverter.GetEnumDescription((Enum)value);
}
if (value is string && destinationType == typeof(string))
{
return EnumDescConverter.GetEnumDescription(myVal, (string)value);
}
return base.ConvertTo(context, culture, value, destinationType);
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string)
{
return EnumDescConverter.GetEnumValue(myVal, (string)value);
}
if (value is Enum)
{
return EnumDescConverter.GetEnumDescription((Enum)value);
}
return base.ConvertFrom(context, culture, value);
}
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
return false;
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
ArrayList values = new ArrayList();
FieldInfo[] fis = myVal.GetFields();
foreach (FieldInfo fi in fis)
{
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(
typeof(DescriptionAttribute), false);
//if (attributes.Length > 0)
if (fi.Name != "value__")
values.Add(fi.GetValue(fi.Name));
}
return new TypeConverter.StandardValuesCollection(values);
}
public static string GetEnumKeyDescription(Enum value)
{
FieldInfo fi = value.GetType().GetField(value.ToString());
DescriptionAttribute[] attributes =
(DescriptionAttribute[])fi.GetCustomAttributes(
typeof(DescriptionAttribute), false);
return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
}
public static DataTable GetEnumAsDataTable(System.Type EnumType)
{
DataTable DTEnum = new DataTable();
DTEnum.Columns.Add(new DataColumn("EnumID", typeof(Int32)));
DTEnum.Columns.Add(new DataColumn("Enum", typeof(string)));
DTEnum.Columns.Add(new DataColumn("Description", typeof(string)));
foreach (int i in Enum.GetValues(EnumType))
{
System.Enum fooItem = (System.Enum)Enum.ToObject(EnumType, i);
DTEnum.Rows.Add(new object[] { i, fooItem.ToString(), GetEnumKeyDescription(fooItem) });
}
return DTEnum;
}
}
}

View File

@ -85,6 +85,8 @@ namespace DataLoader
docver.MyItem = itm;
if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
if(frmMain.MySettings.ExecutionMode == ExecutionMode.Debug)
docver.DocVersionConfig.Print_PDFLocation = frmMain.MySettings.PDFFolder;
docver.Save();
}
return TimeSpan.FromTicks(lTime);

View File

@ -56,7 +56,8 @@ namespace DataLoader
//string tmpName = @"C:\Temp\DataLoader\" + myFile.Name.Replace(".", "_") + ".RTF";
string tmpName = Path.GetTempFileName();
string temppath = Path.GetTempFileName();
if (frmMain.cbSaveDocChecked)
if (frmMain.MySettings.ExecutionMode == ExecutionMode.Production ||
frmMain.MySettings.ConvertTo == AccPageConversion.MSWord)
{
FileInfo tmpFile = new FileInfo(tmpName);
if (tmpFile.Exists)
@ -176,7 +177,7 @@ namespace DataLoader
}
else
{
if (frmMain.cbSaveRTFChecked)
if (frmMain.MySettings.ConvertTo == AccPageConversion.RichTextFormat)
docid = SaveDoc(fname, title, ci,""); // Need to get Ascii Text from RTF
}
}

16964
PROMS/DataLoader/PROMS2010.SQL Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Sql;
using System.Data.SqlClient;
// Add .Net Reference Microsoft.SqlServer.ConnectionInfo
using Microsoft.SqlServer.Management.Common;
// Add .Net Reference Microsoft.SqlServer.Smo
using Microsoft.SqlServer.Management.Smo;
namespace DataLoader
{
public delegate void SQLScriptRunnerEvent(object sender, SqlInfoMessageEventArgs args);
public class SQLScriptRunner
{
public event SQLScriptRunnerEvent InfoMessage;
public void OnInfoMessage(object sender, SqlInfoMessageEventArgs args)
{
if (InfoMessage != null) InfoMessage(sender, args);
}
private string _Script;
public string Script
{
get { return _Script; }
set { _Script = value; }
}
private string _ConnectionString;
public string ConnectionString
{
get { return _ConnectionString; }
set { _ConnectionString = value; }
}
public SQLScriptRunner(string script, string connectionString)
{
_Script = script;
_ConnectionString = connectionString;
}
public SQLScriptRunner(string dbName, string backupFolder, string connectionString, DateTime dateTime, string suffix)
{
_Script = string.Format("Backup database [{0}] to disk = '{1}\\{0}_{2}{3}.BAK'\r\n" +
"GO\r\nPRINT '{0} backed up to {1}\\{0}_{2}{3}.BAK'",
dbName, backupFolder, dateTime.ToString("yyyyMMdd_HHmm"),suffix);
_ConnectionString = connectionString;
}
public void Run()
{
SqlConnection cn = new SqlConnection(ConnectionString);
cn.Open();
cn.InfoMessage += new SqlInfoMessageEventHandler(cn_InfoMessage);
Server srv = new Server(new ServerConnection(cn));
srv.ConnectionContext.ExecuteNonQuery(Script);
cn.Close();
}
void cn_InfoMessage(object sender, SqlInfoMessageEventArgs e)
{
OnInfoMessage(sender, e);
}
}
}

View File

@ -0,0 +1,111 @@
using System;
using System.ComponentModel;
using System.Drawing.Design;
//using System.Runtime.CompilerServices;
using System.Windows.Forms;
namespace DataLoader
{
public class UIFilenameEditor : System.Drawing.Design.UITypeEditor
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
if (context != null && context.Instance != null)
{
if (!context.PropertyDescriptor.IsReadOnly)
{
return UITypeEditorEditStyle.Modal;
}
}
return UITypeEditorEditStyle.None;
}
[RefreshProperties(RefreshProperties.All)]
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
if (context == null || provider == null || context.Instance == null)
{
return base.EditValue(provider, value);
}
FileDialog fileDlg;
if (context.PropertyDescriptor.Attributes[typeof(SaveFileAttribute)] == null)
{
fileDlg = new OpenFileDialog();
}
else
{
fileDlg = new SaveFileDialog();
}
fileDlg.Title = "Select " + context.PropertyDescriptor.DisplayName;
fileDlg.FileName = (string)value;
FileDialogFilterAttribute filterAtt = (FileDialogFilterAttribute)context.PropertyDescriptor.Attributes[typeof(FileDialogFilterAttribute)];
if (filterAtt != null)
{
fileDlg.Filter = filterAtt.Filter;
}
if (fileDlg.ShowDialog() == DialogResult.OK)
{
value = fileDlg.FileName;
}
fileDlg.Dispose();
return value;
}
[AttributeUsage(AttributeTargets.Property)]
public class FileDialogFilterAttribute : Attribute
{
private string _filter;
public string Filter
{
get
{
return this._filter;
}
}
public FileDialogFilterAttribute(string filter)
{
this._filter = filter;
}
}
[AttributeUsage(AttributeTargets.Property)]
public class SaveFileAttribute : Attribute
{
}
public enum FileDialogType
{
LoadFileDialog,
SaveFileDialog
}
}
public class UIFolderEditor : System.Drawing.Design.UITypeEditor
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
if (context != null && context.Instance != null)
{
if (!context.PropertyDescriptor.IsReadOnly)
{
return UITypeEditorEditStyle.Modal;
}
}
return UITypeEditorEditStyle.None;
}
[RefreshProperties(RefreshProperties.All)]
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
if (context == null || provider == null || context.Instance == null)
{
return base.EditValue(provider, value);
}
FolderBrowserDialog folderDlg=new FolderBrowserDialog();
folderDlg.SelectedPath = (string)value;
if (folderDlg.ShowDialog() == DialogResult.OK)
{
value = folderDlg.SelectedPath;
}
folderDlg.Dispose();
return value;
}
}
}

View File

@ -31,269 +31,86 @@ namespace DataLoader
{
this.components = new System.ComponentModel.Container();
this.sc = new System.Windows.Forms.SplitContainer();
this.tbSkip = new System.Windows.Forms.TextBox();
this.lblSkip = new System.Windows.Forms.Label();
this.cbCheckRTF = new System.Windows.Forms.CheckBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.tbxBackupFileName = new System.Windows.Forms.TextBox();
this.lblBackupName = new System.Windows.Forms.Label();
this.lblProms16BitLoc = new System.Windows.Forms.Label();
this.cbxOnlyThisSet = new System.Windows.Forms.CheckBox();
this.btnLogLoc = new System.Windows.Forms.Button();
this.txbLogFileLoc = new System.Windows.Forms.TextBox();
this.lblLogFileLoc = new System.Windows.Forms.Label();
this.btnFixTransitions = new System.Windows.Forms.Button();
this.lblCurSetFolder = new System.Windows.Forms.Label();
this.lblProcessing = new System.Windows.Forms.Label();
this.cbFormatsOnly = new System.Windows.Forms.CheckBox();
this.btnBrowseVeProms = new System.Windows.Forms.Button();
this.tbVePromsPath = new System.Windows.Forms.TextBox();
this.btnCtTok = new System.Windows.Forms.Button();
this.btnGroup = new System.Windows.Forms.Button();
this.btnVETree_CSLA = new System.Windows.Forms.Button();
this.btnBrowseVesam = new System.Windows.Forms.Button();
this.tbVesamPath = new System.Windows.Forms.TextBox();
this.btnVesam = new System.Windows.Forms.Button();
this.btnLoadTreeCSLA = new System.Windows.Forms.Button();
this.cbLazy = new System.Windows.Forms.CheckBox();
this.btnConvertSelected = new System.Windows.Forms.Button();
this.btnLoadTreeDB = new System.Windows.Forms.Button();
this.cbPurgeData = new System.Windows.Forms.CheckBox();
this.lblTime = new System.Windows.Forms.Label();
this.pbStep = new System.Windows.Forms.ProgressBar();
this.pbSect = new System.Windows.Forms.ProgressBar();
this.pbProc = new System.Windows.Forms.ProgressBar();
this.cbSaveDoc = new System.Windows.Forms.CheckBox();
this.cbSaveRTF = new System.Windows.Forms.CheckBox();
this.btnBrowse = new System.Windows.Forms.Button();
this.tbSource = new System.Windows.Forms.TextBox();
this.lblStep = new System.Windows.Forms.Label();
this.lblSection = new System.Windows.Forms.Label();
this.lblProc = new System.Windows.Forms.Label();
this.btnConvert = new System.Windows.Forms.Button();
this.tv = new System.Windows.Forms.TreeView();
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsslError = new System.Windows.Forms.ToolStripStatusLabel();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.processToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.completeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.formatOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.convertDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fixTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertToChangeManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertToApprovalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.oldToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.convertTopFoldersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadTreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadVETreeFromCSLAToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupSecurityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.countTokensToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.convertDbfSelectedInTreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sc.Panel1.SuspendLayout();
this.sc.Panel2.SuspendLayout();
this.sc.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// sc
//
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
this.sc.Location = new System.Drawing.Point(0, 0);
this.sc.Location = new System.Drawing.Point(0, 24);
this.sc.Margin = new System.Windows.Forms.Padding(2);
this.sc.Name = "sc";
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// sc.Panel1
//
this.sc.Panel1.Controls.Add(this.tbSkip);
this.sc.Panel1.Controls.Add(this.lblSkip);
this.sc.Panel1.Controls.Add(this.cbCheckRTF);
this.sc.Panel1.Controls.Add(this.checkBox1);
this.sc.Panel1.Controls.Add(this.tbxBackupFileName);
this.sc.Panel1.Controls.Add(this.lblBackupName);
this.sc.Panel1.Controls.Add(this.lblProms16BitLoc);
this.sc.Panel1.Controls.Add(this.cbxOnlyThisSet);
this.sc.Panel1.Controls.Add(this.btnLogLoc);
this.sc.Panel1.Controls.Add(this.txbLogFileLoc);
this.sc.Panel1.Controls.Add(this.lblLogFileLoc);
this.sc.Panel1.Controls.Add(this.btnFixTransitions);
this.sc.Panel1.Controls.Add(this.lblCurSetFolder);
this.sc.Panel1.Controls.Add(this.lblProcessing);
this.sc.Panel1.Controls.Add(this.cbFormatsOnly);
this.sc.Panel1.Controls.Add(this.btnBrowseVeProms);
this.sc.Panel1.Controls.Add(this.tbVePromsPath);
this.sc.Panel1.Controls.Add(this.btnCtTok);
this.sc.Panel1.Controls.Add(this.btnGroup);
this.sc.Panel1.Controls.Add(this.btnVETree_CSLA);
this.sc.Panel1.Controls.Add(this.btnBrowseVesam);
this.sc.Panel1.Controls.Add(this.tbVesamPath);
this.sc.Panel1.Controls.Add(this.btnVesam);
this.sc.Panel1.Controls.Add(this.btnLoadTreeCSLA);
this.sc.Panel1.Controls.Add(this.cbLazy);
this.sc.Panel1.Controls.Add(this.btnConvertSelected);
this.sc.Panel1.Controls.Add(this.btnLoadTreeDB);
this.sc.Panel1.Controls.Add(this.cbPurgeData);
this.sc.Panel1.Controls.Add(this.lblTime);
this.sc.Panel1.Controls.Add(this.pbStep);
this.sc.Panel1.Controls.Add(this.pbSect);
this.sc.Panel1.Controls.Add(this.pbProc);
this.sc.Panel1.Controls.Add(this.cbSaveDoc);
this.sc.Panel1.Controls.Add(this.cbSaveRTF);
this.sc.Panel1.Controls.Add(this.btnBrowse);
this.sc.Panel1.Controls.Add(this.tbSource);
this.sc.Panel1.Controls.Add(this.lblStep);
this.sc.Panel1.Controls.Add(this.lblSection);
this.sc.Panel1.Controls.Add(this.lblProc);
this.sc.Panel1.Controls.Add(this.btnConvert);
this.sc.Panel1.DoubleClick += new System.EventHandler(this.sc_Panel1_DoubleClick);
//
// sc.Panel2
//
this.sc.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.sc.Panel2.Controls.Add(this.tv);
this.sc.Size = new System.Drawing.Size(664, 486);
this.sc.SplitterDistance = 279;
this.sc.Size = new System.Drawing.Size(664, 370);
this.sc.SplitterDistance = 135;
this.sc.SplitterWidth = 3;
this.sc.TabIndex = 46;
//
// tbSkip
//
this.tbSkip.Location = new System.Drawing.Point(578, 250);
this.tbSkip.Name = "tbSkip";
this.tbSkip.Size = new System.Drawing.Size(44, 20);
this.tbSkip.TabIndex = 88;
this.tbSkip.Text = "0";
this.tbSkip.Visible = false;
//
// lblSkip
//
this.lblSkip.AutoSize = true;
this.lblSkip.Location = new System.Drawing.Point(539, 253);
this.lblSkip.Name = "lblSkip";
this.lblSkip.Size = new System.Drawing.Size(28, 13);
this.lblSkip.TabIndex = 87;
this.lblSkip.Text = "Skip";
this.lblSkip.Visible = false;
//
// cbCheckRTF
//
this.cbCheckRTF.AutoSize = true;
this.cbCheckRTF.Location = new System.Drawing.Point(6, 231);
this.cbCheckRTF.Margin = new System.Windows.Forms.Padding(2);
this.cbCheckRTF.Name = "cbCheckRTF";
this.cbCheckRTF.Size = new System.Drawing.Size(81, 17);
this.cbCheckRTF.TabIndex = 86;
this.cbCheckRTF.Text = "Check RTF";
this.toolTip1.SetToolTip(this.cbCheckRTF, "This will run through StepRTF.SaveText and will put change bars on all the steps." +
" Should only be run to validate the code that fixes the Transitions.");
this.cbCheckRTF.UseVisualStyleBackColor = true;
this.cbCheckRTF.Visible = false;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox1.Location = new System.Drawing.Point(537, 77);
this.checkBox1.Margin = new System.Windows.Forms.Padding(2);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(70, 17);
this.checkBox1.TabIndex = 85;
this.checkBox1.Text = "Red PDF";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// tbxBackupFileName
//
this.tbxBackupFileName.BackColor = System.Drawing.SystemColors.Info;
this.tbxBackupFileName.Location = new System.Drawing.Point(103, 75);
this.tbxBackupFileName.Margin = new System.Windows.Forms.Padding(2);
this.tbxBackupFileName.Name = "tbxBackupFileName";
this.tbxBackupFileName.Size = new System.Drawing.Size(202, 20);
this.tbxBackupFileName.TabIndex = 84;
this.tbxBackupFileName.Text = "VEPROMS.bak";
this.toolTip1.SetToolTip(this.tbxBackupFileName, "The file name that will be used in the backup and restore batch files\r\nthat will " +
"be created in the same folder as the conversion log files.");
//
// lblBackupName
//
this.lblBackupName.AutoSize = true;
this.lblBackupName.BackColor = System.Drawing.SystemColors.Info;
this.lblBackupName.Location = new System.Drawing.Point(4, 77);
this.lblBackupName.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblBackupName.Name = "lblBackupName";
this.lblBackupName.Size = new System.Drawing.Size(97, 13);
this.lblBackupName.TabIndex = 83;
this.lblBackupName.Text = "Backup File Name:";
//
// lblProms16BitLoc
//
this.lblProms16BitLoc.AutoSize = true;
this.lblProms16BitLoc.BackColor = System.Drawing.SystemColors.Control;
this.lblProms16BitLoc.Location = new System.Drawing.Point(4, 31);
this.lblProms16BitLoc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblProms16BitLoc.Name = "lblProms16BitLoc";
this.lblProms16BitLoc.Size = new System.Drawing.Size(110, 13);
this.lblProms16BitLoc.TabIndex = 82;
this.lblProms16BitLoc.Text = "VE-PROMS Location:";
//
// cbxOnlyThisSet
//
this.cbxOnlyThisSet.AutoSize = true;
this.cbxOnlyThisSet.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.cbxOnlyThisSet.Location = new System.Drawing.Point(23, 121);
this.cbxOnlyThisSet.Margin = new System.Windows.Forms.Padding(2);
this.cbxOnlyThisSet.Name = "cbxOnlyThisSet";
this.cbxOnlyThisSet.Size = new System.Drawing.Size(92, 17);
this.cbxOnlyThisSet.TabIndex = 81;
this.cbxOnlyThisSet.Text = "Only This Set:";
this.cbxOnlyThisSet.UseVisualStyleBackColor = false;
this.cbxOnlyThisSet.Visible = false;
//
// btnLogLoc
//
this.btnLogLoc.BackColor = System.Drawing.SystemColors.Info;
this.btnLogLoc.Location = new System.Drawing.Point(537, 50);
this.btnLogLoc.Margin = new System.Windows.Forms.Padding(2);
this.btnLogLoc.Name = "btnLogLoc";
this.btnLogLoc.Size = new System.Drawing.Size(118, 20);
this.btnLogLoc.TabIndex = 79;
this.btnLogLoc.Text = "[1] Log File Location...";
this.btnLogLoc.UseVisualStyleBackColor = false;
this.btnLogLoc.Click += new System.EventHandler(this.LogLoc_Click);
//
// txbLogFileLoc
//
this.txbLogFileLoc.BackColor = System.Drawing.SystemColors.Info;
this.txbLogFileLoc.Location = new System.Drawing.Point(98, 51);
this.txbLogFileLoc.Margin = new System.Windows.Forms.Padding(2);
this.txbLogFileLoc.Name = "txbLogFileLoc";
this.txbLogFileLoc.Size = new System.Drawing.Size(434, 20);
this.txbLogFileLoc.TabIndex = 78;
this.txbLogFileLoc.Text = "\\\\Volian-server\\04 ve-proms files\\Active Project Files\\32 Bit VE-PROMS\\Data Migra" +
"tion";
this.toolTip1.SetToolTip(this.txbLogFileLoc, "The location to place the conversion log files.\r\nCreate a folder for each plant.\r" +
"\nType in or use the Browse button at the right.");
this.txbLogFileLoc.TextChanged += new System.EventHandler(this.txbLogFileLoc_TextChanged);
//
// lblLogFileLoc
//
this.lblLogFileLoc.AutoSize = true;
this.lblLogFileLoc.BackColor = System.Drawing.SystemColors.Info;
this.lblLogFileLoc.Location = new System.Drawing.Point(4, 54);
this.lblLogFileLoc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblLogFileLoc.Name = "lblLogFileLoc";
this.lblLogFileLoc.Size = new System.Drawing.Size(91, 13);
this.lblLogFileLoc.TabIndex = 77;
this.lblLogFileLoc.Text = "Log File Location:";
//
// btnFixTransitions
//
this.btnFixTransitions.BackColor = System.Drawing.SystemColors.Info;
this.btnFixTransitions.Location = new System.Drawing.Point(6, 188);
this.btnFixTransitions.Margin = new System.Windows.Forms.Padding(2);
this.btnFixTransitions.Name = "btnFixTransitions";
this.btnFixTransitions.Size = new System.Drawing.Size(64, 36);
this.btnFixTransitions.TabIndex = 76;
this.btnFixTransitions.Text = "[3] Fix Transitions";
this.toolTip1.SetToolTip(this.btnFixTransitions, "Do this after you convert the data.\r\nThis will place the proper text in\r\nthe tran" +
"sition links.");
this.btnFixTransitions.UseVisualStyleBackColor = false;
this.btnFixTransitions.Click += new System.EventHandler(this.btnFixTransitions_Click);
//
// lblCurSetFolder
//
this.lblCurSetFolder.AutoSize = true;
this.lblCurSetFolder.ForeColor = System.Drawing.Color.Blue;
this.lblCurSetFolder.Location = new System.Drawing.Point(178, 257);
this.lblCurSetFolder.Location = new System.Drawing.Point(177, 97);
this.lblCurSetFolder.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCurSetFolder.Name = "lblCurSetFolder";
this.lblCurSetFolder.Size = new System.Drawing.Size(16, 13);
@ -304,7 +121,7 @@ namespace DataLoader
// lblProcessing
//
this.lblProcessing.AutoSize = true;
this.lblProcessing.Location = new System.Drawing.Point(8, 257);
this.lblProcessing.Location = new System.Drawing.Point(7, 97);
this.lblProcessing.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblProcessing.Name = "lblProcessing";
this.lblProcessing.Size = new System.Drawing.Size(165, 13);
@ -312,176 +129,10 @@ namespace DataLoader
this.lblProcessing.Text = "Processing Procedure Set Folder:";
this.lblProcessing.Visible = false;
//
// cbFormatsOnly
//
this.cbFormatsOnly.AutoSize = true;
this.cbFormatsOnly.Location = new System.Drawing.Point(536, 231);
this.cbFormatsOnly.Margin = new System.Windows.Forms.Padding(2);
this.cbFormatsOnly.Name = "cbFormatsOnly";
this.cbFormatsOnly.Size = new System.Drawing.Size(87, 17);
this.cbFormatsOnly.TabIndex = 73;
this.cbFormatsOnly.Text = "Formats Only";
this.cbFormatsOnly.UseVisualStyleBackColor = true;
this.cbFormatsOnly.Visible = false;
//
// btnBrowseVeProms
//
this.btnBrowseVeProms.BackColor = System.Drawing.SystemColors.Control;
this.btnBrowseVeProms.Location = new System.Drawing.Point(536, 28);
this.btnBrowseVeProms.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseVeProms.Name = "btnBrowseVeProms";
this.btnBrowseVeProms.Size = new System.Drawing.Size(119, 20);
this.btnBrowseVeProms.TabIndex = 72;
this.btnBrowseVeProms.Text = "Browse for VeProms...";
this.toolTip1.SetToolTip(this.btnBrowseVeProms, "Browser for the location of VE-PROMS (16-bit version)");
this.btnBrowseVeProms.UseVisualStyleBackColor = false;
this.btnBrowseVeProms.Click += new System.EventHandler(this.btnBrowseVeProms_Click);
//
// tbVePromsPath
//
this.tbVePromsPath.BackColor = System.Drawing.SystemColors.Window;
this.tbVePromsPath.Location = new System.Drawing.Point(114, 29);
this.tbVePromsPath.Margin = new System.Windows.Forms.Padding(2);
this.tbVePromsPath.Name = "tbVePromsPath";
this.tbVePromsPath.Size = new System.Drawing.Size(419, 20);
this.tbVePromsPath.TabIndex = 71;
this.tbVePromsPath.Text = "C:\\16bit\\VE-PROMS";
this.toolTip1.SetToolTip(this.tbVePromsPath, "Type in the location of VE-PROMS (16-bit version)\r\nOR use the Browse button at th" +
"e right.");
this.tbVePromsPath.TextChanged += new System.EventHandler(this.tbVePromsPath_TextChanged);
//
// btnCtTok
//
this.btnCtTok.Location = new System.Drawing.Point(487, 4);
this.btnCtTok.Name = "btnCtTok";
this.btnCtTok.Size = new System.Drawing.Size(96, 19);
this.btnCtTok.TabIndex = 70;
this.btnCtTok.Text = "Count Tokens";
this.btnCtTok.UseVisualStyleBackColor = true;
this.btnCtTok.Visible = false;
this.btnCtTok.Click += new System.EventHandler(this.btnCtTok_Click);
//
// btnGroup
//
this.btnGroup.Location = new System.Drawing.Point(392, 4);
this.btnGroup.Name = "btnGroup";
this.btnGroup.Size = new System.Drawing.Size(89, 19);
this.btnGroup.TabIndex = 69;
this.btnGroup.Text = "Group/Security";
this.btnGroup.UseVisualStyleBackColor = true;
this.btnGroup.Visible = false;
this.btnGroup.Click += new System.EventHandler(this.btnGroup_Click);
//
// btnVETree_CSLA
//
this.btnVETree_CSLA.Location = new System.Drawing.Point(253, 4);
this.btnVETree_CSLA.Name = "btnVETree_CSLA";
this.btnVETree_CSLA.Size = new System.Drawing.Size(133, 19);
this.btnVETree_CSLA.TabIndex = 68;
this.btnVETree_CSLA.Text = "Load VETree from CSLA";
this.btnVETree_CSLA.UseVisualStyleBackColor = true;
this.btnVETree_CSLA.Visible = false;
this.btnVETree_CSLA.Click += new System.EventHandler(this.btnVETree_CSLA_Click);
//
// btnBrowseVesam
//
this.btnBrowseVesam.Location = new System.Drawing.Point(537, 98);
this.btnBrowseVesam.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseVesam.Name = "btnBrowseVesam";
this.btnBrowseVesam.Size = new System.Drawing.Size(119, 20);
this.btnBrowseVesam.TabIndex = 67;
this.btnBrowseVesam.Text = "Browse for Vesam...";
this.btnBrowseVesam.UseVisualStyleBackColor = true;
this.btnBrowseVesam.Visible = false;
this.btnBrowseVesam.Click += new System.EventHandler(this.btnBrowseVesam_Click);
//
// tbVesamPath
//
this.tbVesamPath.Location = new System.Drawing.Point(114, 98);
this.tbVesamPath.Name = "tbVesamPath";
this.tbVesamPath.Size = new System.Drawing.Size(419, 20);
this.tbVesamPath.TabIndex = 66;
this.tbVesamPath.Text = "C:\\16bit\\Ve-proms\\vesam.opt";
this.tbVesamPath.Visible = false;
//
// btnVesam
//
this.btnVesam.Location = new System.Drawing.Point(3, 96);
this.btnVesam.Name = "btnVesam";
this.btnVesam.Size = new System.Drawing.Size(108, 21);
this.btnVesam.TabIndex = 65;
this.btnVesam.Text = "Convert Security";
this.btnVesam.UseVisualStyleBackColor = true;
this.btnVesam.Visible = false;
this.btnVesam.Click += new System.EventHandler(this.btnVesam_Click);
//
// btnLoadTreeCSLA
//
this.btnLoadTreeCSLA.Location = new System.Drawing.Point(128, 4);
this.btnLoadTreeCSLA.Name = "btnLoadTreeCSLA";
this.btnLoadTreeCSLA.Size = new System.Drawing.Size(119, 19);
this.btnLoadTreeCSLA.TabIndex = 64;
this.btnLoadTreeCSLA.Text = "Load Tree from CSLA";
this.btnLoadTreeCSLA.UseVisualStyleBackColor = true;
this.btnLoadTreeCSLA.Visible = false;
this.btnLoadTreeCSLA.Click += new System.EventHandler(this.btnLoadTreeCSLA_Click);
//
// cbLazy
//
this.cbLazy.AutoSize = true;
this.cbLazy.Checked = true;
this.cbLazy.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbLazy.Location = new System.Drawing.Point(536, 210);
this.cbLazy.Margin = new System.Windows.Forms.Padding(2);
this.cbLazy.Name = "cbLazy";
this.cbLazy.Size = new System.Drawing.Size(75, 17);
this.cbLazy.TabIndex = 63;
this.cbLazy.Text = "Lazy Load";
this.cbLazy.UseVisualStyleBackColor = true;
this.cbLazy.Visible = false;
//
// btnConvertSelected
//
this.btnConvertSelected.Location = new System.Drawing.Point(170, 209);
this.btnConvertSelected.Margin = new System.Windows.Forms.Padding(2);
this.btnConvertSelected.Name = "btnConvertSelected";
this.btnConvertSelected.Size = new System.Drawing.Size(151, 19);
this.btnConvertSelected.TabIndex = 62;
this.btnConvertSelected.Text = "Convert Dbf Selected In Tree";
this.btnConvertSelected.UseVisualStyleBackColor = true;
this.btnConvertSelected.Visible = false;
this.btnConvertSelected.Click += new System.EventHandler(this.btnConvertSelected_Click);
//
// btnLoadTreeDB
//
this.btnLoadTreeDB.Location = new System.Drawing.Point(4, 4);
this.btnLoadTreeDB.Margin = new System.Windows.Forms.Padding(2);
this.btnLoadTreeDB.Name = "btnLoadTreeDB";
this.btnLoadTreeDB.Size = new System.Drawing.Size(118, 19);
this.btnLoadTreeDB.TabIndex = 60;
this.btnLoadTreeDB.Text = "Convert Top Folders";
this.btnLoadTreeDB.UseVisualStyleBackColor = true;
this.btnLoadTreeDB.Visible = false;
this.btnLoadTreeDB.Click += new System.EventHandler(this.btnLoadTreeDB_Click);
//
// cbPurgeData
//
this.cbPurgeData.AutoSize = true;
this.cbPurgeData.Checked = true;
this.cbPurgeData.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbPurgeData.Location = new System.Drawing.Point(536, 188);
this.cbPurgeData.Margin = new System.Windows.Forms.Padding(2);
this.cbPurgeData.Name = "cbPurgeData";
this.cbPurgeData.Size = new System.Drawing.Size(119, 17);
this.cbPurgeData.TabIndex = 59;
this.cbPurgeData.Text = "Purge Existing Data";
this.cbPurgeData.UseVisualStyleBackColor = true;
this.cbPurgeData.Visible = false;
//
// lblTime
//
this.lblTime.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.lblTime.Location = new System.Drawing.Point(81, 204);
this.lblTime.Location = new System.Drawing.Point(7, 67);
this.lblTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(84, 20);
@ -489,84 +140,32 @@ namespace DataLoader
//
// pbStep
//
this.pbStep.Location = new System.Drawing.Point(170, 185);
this.pbStep.Location = new System.Drawing.Point(96, 50);
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
this.pbStep.Name = "pbStep";
this.pbStep.Size = new System.Drawing.Size(362, 15);
this.pbStep.Size = new System.Drawing.Size(557, 15);
this.pbStep.TabIndex = 57;
//
// pbSect
//
this.pbSect.Location = new System.Drawing.Point(170, 167);
this.pbSect.Location = new System.Drawing.Point(96, 30);
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
this.pbSect.Name = "pbSect";
this.pbSect.Size = new System.Drawing.Size(362, 15);
this.pbSect.Size = new System.Drawing.Size(557, 15);
this.pbSect.TabIndex = 56;
//
// pbProc
//
this.pbProc.Location = new System.Drawing.Point(170, 148);
this.pbProc.Location = new System.Drawing.Point(96, 11);
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
this.pbProc.Name = "pbProc";
this.pbProc.Size = new System.Drawing.Size(362, 15);
this.pbProc.Size = new System.Drawing.Size(557, 15);
this.pbProc.TabIndex = 55;
//
// cbSaveDoc
//
this.cbSaveDoc.AutoSize = true;
this.cbSaveDoc.Checked = true;
this.cbSaveDoc.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbSaveDoc.Location = new System.Drawing.Point(537, 148);
this.cbSaveDoc.Margin = new System.Windows.Forms.Padding(2);
this.cbSaveDoc.Name = "cbSaveDoc";
this.cbSaveDoc.Size = new System.Drawing.Size(77, 17);
this.cbSaveDoc.TabIndex = 54;
this.cbSaveDoc.Text = "Save DOC";
this.cbSaveDoc.UseVisualStyleBackColor = true;
this.cbSaveDoc.Visible = false;
this.cbSaveDoc.Click += new System.EventHandler(this.cbSaveDoc_Click);
//
// cbSaveRTF
//
this.cbSaveRTF.AutoSize = true;
this.cbSaveRTF.Location = new System.Drawing.Point(537, 168);
this.cbSaveRTF.Margin = new System.Windows.Forms.Padding(2);
this.cbSaveRTF.Name = "cbSaveRTF";
this.cbSaveRTF.Size = new System.Drawing.Size(75, 17);
this.cbSaveRTF.TabIndex = 53;
this.cbSaveRTF.Text = "Save RTF";
this.cbSaveRTF.UseVisualStyleBackColor = true;
this.cbSaveRTF.Visible = false;
this.cbSaveRTF.Click += new System.EventHandler(this.cbSaveRTF_Click);
//
// btnBrowse
//
this.btnBrowse.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.btnBrowse.Location = new System.Drawing.Point(537, 120);
this.btnBrowse.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(118, 19);
this.btnBrowse.TabIndex = 52;
this.btnBrowse.Text = "Browse For Set...";
this.btnBrowse.UseVisualStyleBackColor = false;
this.btnBrowse.Visible = false;
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
//
// tbSource
//
this.tbSource.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.tbSource.Location = new System.Drawing.Point(114, 120);
this.tbSource.Margin = new System.Windows.Forms.Padding(2);
this.tbSource.Name = "tbSource";
this.tbSource.Size = new System.Drawing.Size(419, 20);
this.tbSource.TabIndex = 51;
this.tbSource.Text = "i:\\vedata\\vewcnfp\\fp.prc";
this.tbSource.Visible = false;
//
// lblStep
//
this.lblStep.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.lblStep.Location = new System.Drawing.Point(81, 184);
this.lblStep.Location = new System.Drawing.Point(7, 47);
this.lblStep.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblStep.Name = "lblStep";
this.lblStep.Size = new System.Drawing.Size(84, 20);
@ -575,7 +174,7 @@ namespace DataLoader
// lblSection
//
this.lblSection.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.lblSection.Location = new System.Drawing.Point(81, 165);
this.lblSection.Location = new System.Drawing.Point(7, 28);
this.lblSection.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblSection.Name = "lblSection";
this.lblSection.Size = new System.Drawing.Size(84, 19);
@ -584,34 +183,20 @@ namespace DataLoader
// lblProc
//
this.lblProc.BackColor = System.Drawing.SystemColors.ButtonShadow;
this.lblProc.Location = new System.Drawing.Point(81, 145);
this.lblProc.Location = new System.Drawing.Point(7, 9);
this.lblProc.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblProc.Name = "lblProc";
this.lblProc.Size = new System.Drawing.Size(84, 19);
this.lblProc.TabIndex = 47;
//
// btnConvert
//
this.btnConvert.BackColor = System.Drawing.SystemColors.Info;
this.btnConvert.Location = new System.Drawing.Point(6, 145);
this.btnConvert.Margin = new System.Windows.Forms.Padding(2);
this.btnConvert.Name = "btnConvert";
this.btnConvert.Size = new System.Drawing.Size(64, 40);
this.btnConvert.TabIndex = 46;
this.btnConvert.Text = "[2] Convert Data";
this.toolTip1.SetToolTip(this.btnConvert, "This will convert the data found via your DataPath \r\ndefined in your cfg file \r\n(" +
"the one used with 16-bit VE-PROMS)");
this.btnConvert.UseVisualStyleBackColor = false;
this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
//
// tv
//
this.tv.CheckBoxes = true;
this.tv.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tv.Location = new System.Drawing.Point(0, 20);
this.tv.Dock = System.Windows.Forms.DockStyle.Fill;
this.tv.Location = new System.Drawing.Point(0, 0);
this.tv.Margin = new System.Windows.Forms.Padding(2);
this.tv.Name = "tv";
this.tv.Size = new System.Drawing.Size(664, 184);
this.tv.Size = new System.Drawing.Size(664, 232);
this.tv.TabIndex = 24;
this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand);
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
@ -621,7 +206,7 @@ namespace DataLoader
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.tsslError});
this.statusStrip1.Location = new System.Drawing.Point(0, 441);
this.statusStrip1.Location = new System.Drawing.Point(0, 349);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(664, 45);
this.statusStrip1.TabIndex = 47;
@ -644,24 +229,203 @@ namespace DataLoader
this.tsslError.Text = "No Errors";
this.tsslError.TextAlign = System.Drawing.ContentAlignment.TopLeft;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.processToolStripMenuItem,
this.settingsToolStripMenuItem,
this.oldToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(664, 24);
this.menuStrip1.TabIndex = 48;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// processToolStripMenuItem
//
this.processToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.completeToolStripMenuItem,
this.toolStripMenuItem1,
this.formatOnlyToolStripMenuItem,
this.toolStripMenuItem2,
this.convertDBToolStripMenuItem,
this.fixTransitionsToolStripMenuItem,
this.convertToChangeManagerToolStripMenuItem,
this.convertToApprovalToolStripMenuItem});
this.processToolStripMenuItem.Name = "processToolStripMenuItem";
this.processToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
this.processToolStripMenuItem.Text = "&Process";
//
// completeToolStripMenuItem
//
this.completeToolStripMenuItem.Name = "completeToolStripMenuItem";
this.completeToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.completeToolStripMenuItem.Text = "Complete";
this.completeToolStripMenuItem.Click += new System.EventHandler(this.completeToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(221, 6);
//
// formatOnlyToolStripMenuItem
//
this.formatOnlyToolStripMenuItem.Name = "formatOnlyToolStripMenuItem";
this.formatOnlyToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.formatOnlyToolStripMenuItem.Text = "Format Only";
this.formatOnlyToolStripMenuItem.Click += new System.EventHandler(this.formatOnlyToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(221, 6);
//
// convertDBToolStripMenuItem
//
this.convertDBToolStripMenuItem.Name = "convertDBToolStripMenuItem";
this.convertDBToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertDBToolStripMenuItem.Text = "Convert DB";
this.convertDBToolStripMenuItem.Click += new System.EventHandler(this.convertDBToolStripMenuItem_Click);
//
// fixTransitionsToolStripMenuItem
//
this.fixTransitionsToolStripMenuItem.Name = "fixTransitionsToolStripMenuItem";
this.fixTransitionsToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.fixTransitionsToolStripMenuItem.Text = "Fix Transitions";
this.fixTransitionsToolStripMenuItem.Click += new System.EventHandler(this.fixTransitionsToolStripMenuItem_Click);
//
// convertToChangeManagerToolStripMenuItem
//
this.convertToChangeManagerToolStripMenuItem.Name = "convertToChangeManagerToolStripMenuItem";
this.convertToChangeManagerToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertToChangeManagerToolStripMenuItem.Text = "Convert to Change Manager";
this.convertToChangeManagerToolStripMenuItem.Click += new System.EventHandler(this.convertToChangeManagerToolStripMenuItem_Click);
//
// convertToApprovalToolStripMenuItem
//
this.convertToApprovalToolStripMenuItem.Name = "convertToApprovalToolStripMenuItem";
this.convertToApprovalToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertToApprovalToolStripMenuItem.Text = "Convert to Approval";
this.convertToApprovalToolStripMenuItem.Click += new System.EventHandler(this.convertToApprovalToolStripMenuItem_Click);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.settingsToolStripMenuItem.Text = "&Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
// oldToolStripMenuItem
//
this.oldToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.convertSecurityToolStripMenuItem,
this.toolStripMenuItem4,
this.convertTopFoldersToolStripMenuItem,
this.loadTreeFromCSLAToolStripMenuItem,
this.loadVETreeFromCSLAToolStripMenuItem,
this.groupSecurityToolStripMenuItem,
this.countTokensToolStripMenuItem,
this.toolStripMenuItem3,
this.convertDbfSelectedInTreeToolStripMenuItem});
this.oldToolStripMenuItem.Name = "oldToolStripMenuItem";
this.oldToolStripMenuItem.Size = new System.Drawing.Size(38, 20);
this.oldToolStripMenuItem.Text = "Old";
//
// convertSecurityToolStripMenuItem
//
this.convertSecurityToolStripMenuItem.Name = "convertSecurityToolStripMenuItem";
this.convertSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertSecurityToolStripMenuItem.Text = "Convert Security";
this.convertSecurityToolStripMenuItem.Click += new System.EventHandler(this.convertSecurityToolStripMenuItem_Click);
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(221, 6);
//
// convertTopFoldersToolStripMenuItem
//
this.convertTopFoldersToolStripMenuItem.Name = "convertTopFoldersToolStripMenuItem";
this.convertTopFoldersToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertTopFoldersToolStripMenuItem.Text = "Convert Top Folders";
this.convertTopFoldersToolStripMenuItem.Click += new System.EventHandler(this.convertTopFoldersToolStripMenuItem_Click);
//
// loadTreeFromCSLAToolStripMenuItem
//
this.loadTreeFromCSLAToolStripMenuItem.Name = "loadTreeFromCSLAToolStripMenuItem";
this.loadTreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.loadTreeFromCSLAToolStripMenuItem.Text = "Load Tree From CSLA";
this.loadTreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadTreeFromCSLAToolStripMenuItem_Click);
//
// loadVETreeFromCSLAToolStripMenuItem
//
this.loadVETreeFromCSLAToolStripMenuItem.Name = "loadVETreeFromCSLAToolStripMenuItem";
this.loadVETreeFromCSLAToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.loadVETreeFromCSLAToolStripMenuItem.Text = "Load VETree From CSLA";
this.loadVETreeFromCSLAToolStripMenuItem.Click += new System.EventHandler(this.loadVETreeFromCSLAToolStripMenuItem_Click);
//
// groupSecurityToolStripMenuItem
//
this.groupSecurityToolStripMenuItem.Name = "groupSecurityToolStripMenuItem";
this.groupSecurityToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.groupSecurityToolStripMenuItem.Text = "Group/Security";
this.groupSecurityToolStripMenuItem.Click += new System.EventHandler(this.groupSecurityToolStripMenuItem_Click);
//
// countTokensToolStripMenuItem
//
this.countTokensToolStripMenuItem.Name = "countTokensToolStripMenuItem";
this.countTokensToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.countTokensToolStripMenuItem.Text = "Count Tokens";
this.countTokensToolStripMenuItem.Click += new System.EventHandler(this.countTokensToolStripMenuItem_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(221, 6);
//
// convertDbfSelectedInTreeToolStripMenuItem
//
this.convertDbfSelectedInTreeToolStripMenuItem.Name = "convertDbfSelectedInTreeToolStripMenuItem";
this.convertDbfSelectedInTreeToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.convertDbfSelectedInTreeToolStripMenuItem.Text = "Convert Dbf Selected In Tree";
this.convertDbfSelectedInTreeToolStripMenuItem.Click += new System.EventHandler(this.convertDbfSelectedInTreeToolStripMenuItem_Click);
//
// frmLoader
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(664, 486);
this.ClientSize = new System.Drawing.Size(664, 394);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.sc);
this.Controls.Add(this.menuStrip1);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmLoader";
this.Text = "PROMS-2010 Data Loader";
this.Load += new System.EventHandler(this.frmLoader_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmLoader_FormClosing);
this.sc.Panel1.ResumeLayout(false);
this.sc.Panel1.PerformLayout();
this.sc.Panel2.ResumeLayout(false);
this.sc.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -670,51 +434,43 @@ namespace DataLoader
#endregion
private System.Windows.Forms.SplitContainer sc;
private System.Windows.Forms.CheckBox cbLazy;
private System.Windows.Forms.Button btnConvertSelected;
private System.Windows.Forms.Button btnLoadTreeDB;
private System.Windows.Forms.CheckBox cbPurgeData;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.ProgressBar pbStep;
private System.Windows.Forms.ProgressBar pbSect;
private System.Windows.Forms.ProgressBar pbProc;
private System.Windows.Forms.CheckBox cbSaveDoc;
private System.Windows.Forms.CheckBox cbSaveRTF;
private System.Windows.Forms.Button btnBrowse;
private System.Windows.Forms.TextBox tbSource;
private System.Windows.Forms.Label lblStep;
private System.Windows.Forms.Label lblSection;
private System.Windows.Forms.Label lblProc;
private System.Windows.Forms.Button btnConvert;
private System.Windows.Forms.TreeView tv;
private System.Windows.Forms.FolderBrowserDialog fbd;
private System.Windows.Forms.Button btnLoadTreeCSLA;
private System.Windows.Forms.TextBox tbVesamPath;
private System.Windows.Forms.Button btnVesam;
private System.Windows.Forms.Button btnBrowseVesam;
private System.Windows.Forms.Button btnVETree_CSLA;
private System.Windows.Forms.Button btnGroup;
private System.Windows.Forms.Button btnCtTok;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.Button btnBrowseVeProms;
private System.Windows.Forms.TextBox tbVePromsPath;
private System.Windows.Forms.CheckBox cbFormatsOnly;
private System.Windows.Forms.ToolStripStatusLabel tsslError;
private System.Windows.Forms.Label lblCurSetFolder;
private System.Windows.Forms.Label lblProcessing;
private System.Windows.Forms.Button btnFixTransitions;
private System.Windows.Forms.TextBox txbLogFileLoc;
private System.Windows.Forms.Label lblLogFileLoc;
private System.Windows.Forms.Button btnLogLoc;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.CheckBox cbxOnlyThisSet;
private System.Windows.Forms.Label lblProms16BitLoc;
private System.Windows.Forms.TextBox tbxBackupFileName;
private System.Windows.Forms.Label lblBackupName;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox cbCheckRTF;
private System.Windows.Forms.TextBox tbSkip;
private System.Windows.Forms.Label lblSkip;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem processToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem completeToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem formatOnlyToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem convertDBToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fixTransitionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertToChangeManagerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertToApprovalToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem oldToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertSecurityToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertTopFoldersToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem loadTreeFromCSLAToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem loadVETreeFromCSLAToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem groupSecurityToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem countTokensToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem convertDbfSelectedInTreeToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
}
}

View File

@ -36,20 +36,21 @@ namespace DataLoader
public partial class frmLoader : Form
{
#region Log4Net
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
#region settings
private bool _FormatsOnly = false;
public bool FormatsOnly
{
get { return _FormatsOnly; }
set { _FormatsOnly = value; }
}
#endregion
private bool _Loading = true;
private FolderTreeNode _topnode;
private bool UseVeTree = false;
#region Log4Net
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
private Loader ldr;
public bool cbSaveDocChecked { get { return cbSaveDoc.Checked; } }
public bool cbSaveRTFChecked { get { return cbSaveRTF.Checked; } }
public TreeView TV { get { return tv; } }
public int pbProcMaximum { get { return pbProc.Maximum; } set { pbProc.Maximum = value; } }
public int pbSectMaximum { get { return pbSect.Maximum; } set { pbSect.Maximum = value; } }
@ -59,17 +60,7 @@ namespace DataLoader
public int pbProcValue { get { return pbProc.Value; } set { pbProc.Value = value; } }
public int SkipProcedures
{
get
{
try
{
return int.Parse(tbSkip.Text);
}
catch (Exception ex)
{
}
return 0;
}
get { return MySettings.Skip; }
}
public string Status
{
@ -104,7 +95,7 @@ namespace DataLoader
set
{
MyFrmErrors.Add(value);
log.ErrorFormat(value);
_MyLog.ErrorFormat(value);
tsslError.Text = string.Format("{0} Errors", MyFrmErrors.MyErrors.Count); }
}
public string MyWarning
@ -113,7 +104,7 @@ namespace DataLoader
set
{
MyFrmErrors.Add(value);
log.WarnFormat(value);
_MyLog.WarnFormat(value);
tsslError.Text = string.Format("{0} Errors", MyFrmErrors.MyErrors.Count);
}
}
@ -123,7 +114,7 @@ namespace DataLoader
set
{
MyFrmErrors.Add(value);
log.InfoFormat(value);
_MyLog.InfoFormat(value);
tsslError.Text = string.Format("{0} Errors", MyFrmErrors.MyErrors.Count);
}
}
@ -151,7 +142,6 @@ namespace DataLoader
}
MyError = sb.ToString();
}
public string tbSourceText { get { return tbSource.Text; } set { tbSource.Text = value; } }
public frmLoader()
{
@ -159,50 +149,6 @@ namespace DataLoader
InitializeComponent();
MSWordToPDF.FormForPlotGraphics = this;
lblTime.Tag = DateTime.Now;
switch (SystemInformation.ComputerName.ToUpper())
{
case "KATHYXP":
//tbSource.Text = "G:\\VEIP2\\PROCS"; // basic data
//tbSource.Text = "G:\\VEFNP\\AOP1.PRC"; // test subsections, checkoffs, comments & continuous action flag
//tbSource.Text = "G:\\vecal\\eops.bck"; // test link seq STP_LNK_SEQ
tbSource.Text = "G:\\vehlp\\procs";// G:\\vewcnckl\\ckl.prc - multiple change ids.
break;
case "KATHY-VISTA":
tbSource.Text = @"c:\16bit\debug\vehlp\procs";// G:\\vewcnckl\\ckl.prc - multiple change ids.
break;
case "RHMDESKTOP":
//tbSource.Text = @"I:\UNZIPPED ACTIVE BASELINE DATA\vehlp\Procs"; // Sub-sections
tbSource.Text = @"I:\veDATA\vehlp\Procs"; // Sub-sections
break;
case "RMARK-PC":
//tbSource.Text = @"I:\UNZIPPED ACTIVE BASELINE DATA\vehlp\Procs"; // Sub-sections
tbSource.Text = @"C:\VE_PROMS Data\Plant\HLP\vehlp\Procs"; // Sub-sections
break;
case "JOHN":
tbSource.Text = @"G:\PROMSDAT\vehlp\procs";// South Texas EOPS
//tbSource.Text = @"G:\PromsDat\VEHP1B\SAMGS.PRC";// South Texas STPNOC
break;
case "JOHN-VISTA":
tbSource.Text = @"C:\16bit\PROMSDAT\vehlp\procs";// South Texas EOPS
//tbSource.Text = @"G:\PromsDat\VEHP1B\SAMGS.PRC";// South Texas STPNOC
break;
default:
break;
}
if (!VlnSettings.DebugMode)
tbSource.Text = "";
// if in debug mode, pdf output is red (checkbox1 is what controls this).
checkBox1.Checked = VlnSettings.DebugMode;
if (checkBox1.Checked)
{
MSWordToPDF.DebugStatus = 1;
Loader.OverrideColor = Color.Red;
}
else
{
MSWordToPDF.DebugStatus = 0;
Loader.OverrideColor = Color.Empty;
}
}
private void btnConvertSelected_Click(object sender, EventArgs e)
{
@ -278,7 +224,7 @@ namespace DataLoader
TreeNode tn = e.Node;
object o = tn.Tag;
tn.Expand();
if (o.GetType() == typeof(DocVersion)) tbSource.Text = ((DocVersion)o).Title;
if (o.GetType() == typeof(DocVersion)) MySettings.ProcedureSetPath = ((DocVersion)o).Title;
}
@ -287,12 +233,39 @@ namespace DataLoader
// When loading folders, i.e. the tree from dBase (old 16-bit)
// always clear the data
ldr.ClearData();
bool suc = ldr.LoadFolders(tbVePromsPath.Text);
bool suc = ldr.LoadFolders(MySettings.VEPromsPath);
}
private string GetScript(string scriptName)
{
StreamReader sr = File.OpenText(Application.StartupPath + "\\" + scriptName);
string myScript = sr.ReadToEnd();
sr.Close();
return myScript;
}
private DateTime _ProcessTime;
public DateTime ProcessTime
{
get { return _ProcessTime; }
set { _ProcessTime = value; }
}
private void btnConvert_Click(object sender, System.EventArgs e)
{
if (!CheckLogPath()) return;
// Set Connection String
Database.VEPROMS_Connection = MySettings.ConnectionString.Replace("{DBName}", MySettings.DBName);
// Setup based upon RedPDF Setting
// if in debug mode, pdf output is red
VlnSettings.DebugMode = (MySettings.ExecutionMode == ExecutionMode.Debug) && MySettings.RedPDFs;
if (VlnSettings.DebugMode) // Debug Mode
{
MSWordToPDF.DebugStatus = 1;
Loader.OverrideColor = Color.Red;
}
else
{
MSWordToPDF.DebugStatus = 0;
Loader.OverrideColor = Color.Empty;
}
//if (!CheckLogPath()) return;
//#if (!DEBUG)
if (!VlnSettings.DebugMode)
{
@ -304,8 +277,8 @@ namespace DataLoader
{
//TextConvert.ResetSpecialCharacters();
System.Diagnostics.Process[] wordProcesses = WordDoc.WordProcesses;
MyFrmErrors.Clear();
if (cbFormatsOnly.Checked == false && wordProcesses.Length > 0)
//MyFrmErrors.Clear();
if (!FormatsOnly && wordProcesses.Length > 0)
{
AddError("{0} copies of MS Word are running", wordProcesses.Length);
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)
@ -318,7 +291,7 @@ namespace DataLoader
}
Database.LoggingInfo = false;
bool success = true;
if (cbFormatsOnly.Checked)
if (FormatsOnly)
{
// ASSUMES No Formats/genmacs exist in database.
MessageBox.Show(@"Format files are taken from c:\development\fmtall");
@ -328,30 +301,32 @@ namespace DataLoader
MessageBox.Show("Formats Loaded");
return;
}
// Create Database
RunScript("BuildVEPROMS.Sql", "Master");
RunScript("PROMS2010.SQL", MySettings.DBName);
// if purge data, purge it all & reload folders & security.
if (cbPurgeData.Checked)
if (MySettings.PurgeExistingData)
{
Status = "Purging Data";
ldr.ClearData();
Status = "Loading Folders";
success = ldr.LoadFolders(tbVePromsPath.Text);
success = ldr.LoadFolders(MySettings.VEPromsPath);
if (success)
{
Status = "Loading Security";
success = ldr.LoadSecurity(tbVesamPath.Text, tbVePromsPath.Text);
success = ldr.LoadSecurity(MySettings.VESamFile, MySettings.VEPromsPath);
}
}
if (success)
{
bool allSets = !_DeveloperMode || !cbxOnlyThisSet.Checked;
bool allSets = !_DeveloperMode || !MySettings.OnlyThisSet;
TimeSpan ts = new TimeSpan();
DocVersionInfoList vl = DocVersionInfoList.Get();
DocVersion v = null;
MyInfo = "Computer Name: " + SystemInformation.ComputerName.ToUpper();
foreach (DocVersionInfo vi in vl)
{
//if (!_DeveloperMode || (cbxOnlyThisSet.Checked && vi.Title.ToUpper() == tbSource.Text.ToUpper())) // is this the procedure set we want to convert?
if (allSets || (cbxOnlyThisSet.Checked && vi.Title.ToUpper() == tbSource.Text.ToUpper())) // is this the procedure set we want to convert?
if (allSets || (MySettings.OnlyThisSet && vi.Title.ToUpper() == MySettings.ProcedureSetPath.ToUpper())) // is this the procedure set we want to convert?
{
v = DocVersion.Get(vi.VersionID);
Status = "Load " + v.Title + " - " + v.Name;
@ -361,15 +336,11 @@ namespace DataLoader
MyInfo = "Data Set: " + v.Title;
ts += ldr.MigrateDocVersion(v, true);
}
//v = DocVersion.Get(vi.VersionID);
//bool convertProcedures = (vi.Title.ToUpper() == tbSource.Text.ToUpper());
//Item itm = ldr.MigrateDocVersion(v, convertProcedures);
}
string ConversionTime = string.Format("Conversion completion time: {0:D2}:{1:D2}:{2:D2}.{3}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);
MyInfo = ConversionTime;
SaveLogFiles();
MessageBox.Show(string.Format("{0}\r\n\n({1} Total Seconds)", ConversionTime, ts.TotalSeconds));
if(!ProcessComplete) MessageBox.Show(string.Format("{0}\r\n\n({1} Total Seconds)", ConversionTime, 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();
@ -384,6 +355,26 @@ namespace DataLoader
}
}
private void RunScript(string scriptName, string dbName)
{
string script = GetScript(scriptName);
script=script.Replace("{DBName}", MySettings.DBName);
script=script.Replace("{DBPath}", MySettings.DBPath);
SQLScriptRunner ssr = new SQLScriptRunner(script, MySettings.ConnectionString.Replace("{DBName}", dbName));
ssr.InfoMessage += new SQLScriptRunnerEvent(ssr_InfoMessage);
ssr.Run();
}
private void Backup(string suffix)
{
SQLScriptRunner ssrbu = new SQLScriptRunner(MySettings.DBName, MySettings.BackupFolder,
MySettings.ConnectionString.Replace("{DBName}", "Master"), ProcessTime, suffix);
ssrbu.InfoMessage += new SQLScriptRunnerEvent(ssr_InfoMessage);
ssrbu.Run();
}
void ssr_InfoMessage(object sender, System.Data.SqlClient.SqlInfoMessageEventArgs args)
{
MyInfo = args.Message;
}
public void UpdateLabels(int incPrc, int incSec, int incStp)
{
if (incPrc == 0 && incSec == 0 && incStp == 0)//Reset
@ -418,22 +409,6 @@ namespace DataLoader
lblTime.Text = string.Format("{0:D2}:{1:D2}:{2:D2} Elapsed", ts.Hours, ts.Minutes, ts.Seconds);
Application.DoEvents();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
fbd.SelectedPath = tbSource.Text;
if (fbd.ShowDialog() == DialogResult.OK)
tbSource.Text = fbd.SelectedPath;
}
private void cbSaveRTF_Click(object sender, EventArgs e)
{
if (cbSaveRTF.Checked) cbSaveDoc.Checked = false;
}
private void cbSaveDoc_Click(object sender, EventArgs e)
{
if (cbSaveDoc.Checked) cbSaveRTF.Checked = false;
}
private void btnLoadTreeCSLA_Click(object sender, EventArgs e)
{
_topnode = FolderTreeNode.BuildTreeList();
@ -441,24 +416,15 @@ namespace DataLoader
tv.Nodes[0].Expand();
UseVeTree = false;
}
private void btnBrowseVesam_Click(object sender, EventArgs e)
{
fbd.SelectedPath = tbVesamPath.Text;
if (fbd.ShowDialog() == DialogResult.OK)
tbVesamPath.Text = fbd.SelectedPath;
}
private void btnVesam_Click(object sender, EventArgs e)
{
// if purge data, purge it all & reload folders.
if (cbPurgeData.Checked)
if (MySettings.PurgeExistingData)
{
ldr.ClearData();
ldr.LoadFolders(tbVePromsPath.Text);
ldr.LoadFolders(MySettings.VEPromsPath);
}
bool sec = ldr.LoadSecurity(tbVesamPath.Text, tbVePromsPath.Text);
bool sec = ldr.LoadSecurity(MySettings.VESamFile, MySettings.VEPromsPath);
}
private void btnVETree_CSLA_Click(object sender, EventArgs e)
@ -506,63 +472,117 @@ namespace DataLoader
lblTime.Text = string.Format("{0:D2}:{1:D2}:{2:D2} Elapsed", ts.Hours, ts.Minutes, ts.Seconds);
Application.DoEvents();
}
private DataLoaderSettings _MySettings;
internal DataLoaderSettings MySettings
{
get
{
if(_MySettings==null)
_MySettings=new DataLoaderSettings();
return _MySettings;
}
set { _MySettings = value; }
}
private void LoadSettings()
{
Console.WriteLine("Start");
if (Properties.Settings.Default["VePromsFilename"].ToString() != "")
MySettings.VEPromsPath = Properties.Settings.Default.VePromsFilename;
if (Properties.Settings.Default["VeSamFilename"].ToString() != "")
MySettings.VESamFile = Properties.Settings.Default.VeSamFilename;
if (Properties.Settings.Default["DbfPathname"].ToString() != "")
MySettings.ProcedureSetPath = Properties.Settings.Default.DbfPathname;
if (Properties.Settings.Default["BackupFileName"].ToString() != "")
MySettings.BackupFileName = Properties.Settings.Default.BackupFileName;
if (Properties.Settings.Default["BackupFolder"].ToString() != "")
MySettings.BackupFolder = Properties.Settings.Default.BackupFolder;
if (Properties.Settings.Default["LogFileLoc"].ToString() != "")
MySettings.LogFilePath = Properties.Settings.Default.LogFileLoc;
if (Properties.Settings.Default["ConnectionString"].ToString() != "")
MySettings.ConnectionString = Properties.Settings.Default.ConnectionString;
if (Properties.Settings.Default["DBName"].ToString() != "")
MySettings.DBName = Properties.Settings.Default.DBName;
if (Properties.Settings.Default["DBPath"].ToString() != "")
MySettings.DBPath = Properties.Settings.Default.DBPath;
MySettings.PurgeExistingData = (Properties.Settings.Default.PurgeData == CheckState.Checked);
if (Properties.Settings.Default["PDFFolder"].ToString() != "")
MySettings.PDFFolder = Properties.Settings.Default.PDFFolder;
MySettings.OnlyThisSet = (Properties.Settings.Default.OnlyThisSet == CheckState.Checked);
MySettings.CheckRTF = (Properties.Settings.Default.CheckRTF == CheckState.Checked);
MySettings.Skip = Properties.Settings.Default.Skip;
MySettings.ConvertTo = (AccPageConversion) Properties.Settings.Default.ConvertTo;
MySettings.ExecutionMode = (ExecutionMode)Properties.Settings.Default.ExecutionMode;
MySettings.Phase1Suffix = Properties.Settings.Default.Phase1;
MySettings.Phase2Suffix = Properties.Settings.Default.Phase2;
MySettings.Phase3Suffix = Properties.Settings.Default.Phase3;
string validity = MySettings.ValidityCheck;
if (validity != "")
{
MessageBox.Show(validity, "Settings Incorrect", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
OpenSettings();
}
}
private void OpenSettings()
{
DataLoaderSettings tmpDLS = (DataLoaderSettings) MySettings.Clone();
frmPG myPG = new frmPG("Data Loader Settings", tmpDLS);
if (myPG.ShowDialog() == DialogResult.OK)
{
MySettings = tmpDLS;
SaveSettings();
}
string validity = MySettings.ValidityCheck;
if (validity != "")
{
processToolStripMenuItem.Enabled = false;
oldToolStripMenuItem.Enabled = false;
}
else
{
processToolStripMenuItem.Enabled = true;
oldToolStripMenuItem.Enabled = true;
}
}
private void SaveSettings()
{
Properties.Settings.Default.DbfPathname = MySettings.ProcedureSetPath;
Properties.Settings.Default.VePromsFilename = MySettings.VEPromsPath;
Properties.Settings.Default.VeSamFilename = MySettings.VESamFile;
Properties.Settings.Default.DbfPathname = MySettings.ProcedureSetPath;
Properties.Settings.Default.BackupFileName = MySettings.BackupFileName;
Properties.Settings.Default.BackupFolder = MySettings.BackupFolder;
Properties.Settings.Default.LogFileLoc = MySettings.LogFilePath;
Properties.Settings.Default.ConnectionString = MySettings.ConnectionString;
Properties.Settings.Default.DBName = MySettings.DBName;
Properties.Settings.Default.DBPath = MySettings.DBPath;
Properties.Settings.Default.PurgeData = MySettings.PurgeExistingData ? CheckState.Checked : CheckState.Unchecked;
Properties.Settings.Default.PDFFolder = MySettings.PDFFolder;
Properties.Settings.Default.OnlyThisSet = MySettings.OnlyThisSet ? CheckState.Checked : CheckState.Unchecked;
Properties.Settings.Default.CheckRTF = MySettings.CheckRTF ? CheckState.Checked : CheckState.Unchecked;
Properties.Settings.Default.Skip = MySettings.Skip;
Properties.Settings.Default.ConvertTo = (int)MySettings.ConvertTo;
Properties.Settings.Default.ExecutionMode = (int)MySettings.ExecutionMode;
Properties.Settings.Default.Phase1 = MySettings.Phase1Suffix;
Properties.Settings.Default.Phase2 = MySettings.Phase2Suffix;
Properties.Settings.Default.Phase3 = MySettings.Phase3Suffix;
Properties.Settings.Default.Save();
}
private void frmLoader_Load(object sender, EventArgs e)
{
if (Properties.Settings.Default["VeSamFilename"].ToString() != "")
this.tbVesamPath.Text = Properties.Settings.Default.VeSamFilename;
if (Properties.Settings.Default["DbfPathname"].ToString() != "")
this.tbSource.Text = Properties.Settings.Default.DbfPathname;
if (Properties.Settings.Default["LoadWordDoc"].ToString() != "")
this.cbSaveDoc.CheckState = Properties.Settings.Default.LoadWordDoc;
if (Properties.Settings.Default["PurgeData"].ToString() != "")
this.cbPurgeData.CheckState = Properties.Settings.Default.PurgeData;
if (Properties.Settings.Default["LoadRTFDoc"].ToString() != "")
this.cbSaveRTF.CheckState = Properties.Settings.Default.LoadRTFDoc;
if (Properties.Settings.Default["VePromsFilename"] != null)
this.tbVePromsPath.Text = Properties.Settings.Default.VePromsFilename;
if (Properties.Settings.Default["LogFileLoc"].ToString() != "")
this.txbLogFileLoc.Text = Properties.Settings.Default.LogFileLoc;
if (Properties.Settings.Default["BackupFileName"].ToString() != "")
this.tbxBackupFileName.Text = Properties.Settings.Default.BackupFileName;
LoadSettings();
_Loading = false;
MSWordToPDF.CloseWordWhenDone = false;
}
private void frmLoader_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.VeSamFilename = tbVesamPath.Text;
Properties.Settings.Default.DbfPathname = tbSource.Text;
Properties.Settings.Default.LoadWordDoc = cbSaveDoc.CheckState;
Properties.Settings.Default.LoadRTFDoc = cbSaveRTF.CheckState;
Properties.Settings.Default.PurgeData = cbPurgeData.CheckState;
Properties.Settings.Default.VePromsFilename = tbVePromsPath.Text;
Properties.Settings.Default.LogFileLoc = txbLogFileLoc.Text;
Properties.Settings.Default.BackupFileName = tbxBackupFileName.Text;
Properties.Settings.Default.Save();
}
private void btnBrowseVeProms_Click(object sender, EventArgs e)
{
fbd.SelectedPath = tbVePromsPath.Text;
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)
{
if (!CheckLogPath()) return;
//if (!CheckLogPath()) return;
StepRTB rtb = new StepRTB();
TransitionFixer myFixer = new TransitionFixer(rtb,_LogFilePath);
TransitionFixer myFixer = new TransitionFixer(rtb,MySettings.LogFilePath);
myFixer.StatusChanged += new TransitionFixerEvent(myFixer_StatusChanged);
TimeSpan howlong = myFixer.Process(cbCheckRTF.Checked);
TimeSpan howlong = myFixer.Process(MySettings.CheckRTF);
string TransFixTime = string.Format("Fix Transitions completion time: {0:D2}:{1:D2}:{2:D2}.{3}", howlong.Hours, howlong.Minutes, howlong.Seconds, howlong.Milliseconds);
MyInfo = TransFixTime;
MessageBox.Show(string.Format("{0}\r\n\n({1} Total Seconds)", TransFixTime, howlong.TotalSeconds));
if(!ProcessComplete) MessageBox.Show(string.Format("{0}\r\n\n({1} Total Seconds)", TransFixTime, howlong.TotalSeconds));
//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));
CreateBackupRestoreBatchFiles();
}
@ -578,26 +598,6 @@ namespace DataLoader
if (dr == DialogResult.Yes)
{
_DeveloperMode = !_DeveloperMode;
btnLoadTreeDB.Visible = _DeveloperMode;
btnLoadTreeCSLA.Visible = _DeveloperMode;
btnVETree_CSLA.Visible = _DeveloperMode;
btnGroup.Visible = _DeveloperMode;
btnCtTok.Visible = _DeveloperMode;
btnVesam.Visible = _DeveloperMode;
tbVesamPath.Visible = _DeveloperMode;
btnBrowseVesam.Visible = _DeveloperMode;
tbSource.Visible = _DeveloperMode;
btnBrowse.Visible = _DeveloperMode;
cbSaveDoc.Visible = _DeveloperMode;
cbSaveRTF.Visible = _DeveloperMode;
cbPurgeData.Visible = _DeveloperMode;
cbLazy.Visible = _DeveloperMode;
cbFormatsOnly.Visible = _DeveloperMode;
btnConvertSelected.Visible = _DeveloperMode;
cbxOnlyThisSet.Visible = _DeveloperMode;
cbCheckRTF.Visible = _DeveloperMode;
tbSkip.Visible = _DeveloperMode;
lblSkip.Visible = _DeveloperMode;
}
}
@ -605,47 +605,38 @@ namespace DataLoader
{
ToggleDeveloperMode();
}
private void LogLoc_Click(object sender, EventArgs e)
{
fbd.SelectedPath = txbLogFileLoc.Text;
if (fbd.ShowDialog() == DialogResult.OK)
txbLogFileLoc.Text = fbd.SelectedPath;
}
private bool _DidLogPathCheck = false;
private string _LogFilePath = "";
//private string _LogFilePath = "";
private bool CheckLogPath()
{
bool rtn = false;
if (_DidLogPathCheck) return true;
try
{
_LogFilePath = txbLogFileLoc.Text;
if (!Directory.Exists(_LogFilePath))
Directory.CreateDirectory(_LogFilePath);
if (_LogFilePath.EndsWith(@"\")) _LogFilePath = _LogFilePath.Substring(0, _LogFilePath.Length - 1);
rtn = true;
_DidLogPathCheck = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Invalid Path for Log Files", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return rtn;
}
//private bool CheckLogPath()
//{
// bool rtn = false;
// if (_DidLogPathCheck) return true;
// try
// {
// _LogFilePath = txbLogFileLoc.Text;
// if (!Directory.Exists(_LogFilePath))
// Directory.CreateDirectory(_LogFilePath);
// if (_LogFilePath.EndsWith(@"\")) _LogFilePath = _LogFilePath.Substring(0, _LogFilePath.Length - 1);
// rtn = true;
// _DidLogPathCheck = true;
// }
// catch (Exception ex)
// {
// MessageBox.Show(ex.Message, "Invalid Path for Log Files", MessageBoxButtons.OK, MessageBoxIcon.Error);
// }
// return rtn;
//}
private void SaveLogFiles()
{
if (_LogFilePath == "") return;
//if (_LogFilePath == "") return;
// Save the Glitches log
if (TextConvert.MyGlitches.Glitches.Count > 0)
TextConvert.MyGlitches.Save(_LogFilePath + @"\ConversionGlitches.xml");
TextConvert.MyGlitches.Save(MySettings.LogFilePath + @"\ConversionGlitches.xml");
// Save the Error Log
if (_MyFrmErrors.ItemCount() > 0)
_MyFrmErrors.Save(_LogFilePath + @"\ConversionErrors.txt");
_MyFrmErrors.Save(MySettings.LogFilePath + @"\ConversionErrors.txt");
}
private bool _EnteredFileLoc = false;
@ -657,36 +648,171 @@ namespace DataLoader
private void CreateBackupRestoreBatchFiles()
{
string pause = "pause";
string bckupFileName = tbxBackupFileName.Text;
string bckupFileName = MySettings.BackupFileName;
if (!bckupFileName.EndsWith(".bak")) bckupFileName += ".bak";
string backupPath = _LogFilePath + @"\" + bckupFileName;
string backupPath = MySettings.LogFilePath + @"\" + bckupFileName;
string bckupcmd = "sqlcmd -E -S.\\sqlexpress -Q \"backup database [VEPROMS] to disk = '" + backupPath + "'\"";
string rstorecmd = "sqlcmd -E -S.\\sqlexpress -Q \"restore database [VEPROMS] from disk = '" + backupPath + "'\"";
//StreamWriter fsbackup = new StreamWriter(_LogFilePath + @"\BackupVEPROMS.bat");
StreamWriter fsbackup = new StreamWriter(_LogFilePath + @"\Backup" + bckupFileName.Substring(0,bckupFileName.Length-4) + ".bat");
StreamWriter fsbackup = new StreamWriter(MySettings.LogFilePath + @"\Backup" + bckupFileName.Substring(0,bckupFileName.Length-4) + ".bat");
fsbackup.WriteLine(bckupcmd);
fsbackup.WriteLine(pause);
fsbackup.Close();
//StreamWriter fsrestore = new StreamWriter(_LogFilePath + @"\RestoreVEPROMS.bat");
StreamWriter fsrestore = new StreamWriter(_LogFilePath + @"\Restore" + bckupFileName.Substring(0,bckupFileName.Length-4) + ".bat");
StreamWriter fsrestore = new StreamWriter(MySettings.LogFilePath + @"\Restore" + bckupFileName.Substring(0,bckupFileName.Length-4) + ".bat");
fsrestore.WriteLine(rstorecmd);
fsrestore.WriteLine(pause);
fsrestore.Close();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
// Menu Items
#region File Menu Items
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
VlnSettings.DebugMode = checkBox1.Checked;
if (checkBox1.Checked)
{
MSWordToPDF.DebugStatus = 1;
Loader.OverrideColor = Color.Red;
this.Close();
}
else
#endregion
#region Process Menu Items
private bool _ProcessFailed = false;
public bool ProcessFailed
{
MSWordToPDF.DebugStatus = 0;
Loader.OverrideColor = Color.Empty;
get { return _ProcessFailed; }
set { _ProcessFailed = value; }
}
private bool _ProcessComplete = false;
public bool ProcessComplete
{
get { return _ProcessComplete; }
set { _ProcessComplete = value; }
}
private void completeToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBuilder mb = new MessageBuilder("Performing Complete Process\r\n");
ProcessFailed = false;
ProcessComplete = true;
ProcessTime = DateTime.Now;
// Phase 1 - Convert dBase to SQL
btnConvert_Click(this, new System.EventArgs());
if (ProcessFailed) return;
mb.Append("dBase Conversion Complete");
Status = "Backing up Phase 1 Data";
Backup("_" + MySettings.Phase1Suffix);
mb.Append("Phase 1 Backup Complete");
// Phase 2 - Fix Transitions
btnFixTransitions_Click(this, new System.EventArgs());
mb.Append("Fix Transtions Complete");
Status = "Backing up Phase 2 Data";
mb.Append("dBase Conversion Complete");
Backup("_" + MySettings.Phase2Suffix);
mb.Append("Phase 2 Backup Complete");
// Phase 3 - Convert to Change Manager Version
ConvertToChangeManager();
mb.Append("Conversion to Change Manager Complete");
Status = "Backing up Phase 3 Data";
//Backup("_" + MySettings.Phase3Suffix);
//mb.Append("Phase 3 Backup Complete");
// Phase 4 - Convert to Approval Version
//ConvertToApproval();
//mb.Append("Conversion to Approval Complete");
//Status = "Backing up Phase 4 Data";
Backup("");
mb.Append("Backup Complete");
Status = "Processing Complete";
ProcessComplete = false;
MessageBox.Show(mb.ToString(), "Processing Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void ConvertToChangeManager()
{
RunScript("PROMStoCM.sql", MySettings.DBName);
}
private void ConvertToApproval()
{
throw new Exception("The method or operation is not implemented.");
RunScript("PROMStoApproval.sql", MySettings.DBName);
}
private void formatOnlyToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessTime = DateTime.Now;
FormatsOnly = true;
btnConvert_Click(this, new System.EventArgs());
}
private void convertDBToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessTime = DateTime.Now;
btnConvert_Click(this, new System.EventArgs());
}
private void fixTransitionsToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessTime = DateTime.Now;
btnFixTransitions_Click(this, new System.EventArgs());
}
private void convertToChangeManagerToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessTime = DateTime.Now;
ConvertToChangeManager();
}
private void convertToApprovalToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessTime = DateTime.Now;
ConvertToApproval();
}
#endregion
#region Settings Menu Items
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenSettings();
}
#endregion
#region Old Menu Items
private void convertSecurityToolStripMenuItem_Click(object sender, EventArgs e)
{
btnVesam_Click(this, new EventArgs());
}
private void convertTopFoldersToolStripMenuItem_Click(object sender, EventArgs e)
{
btnLoadTreeDB_Click(this, new EventArgs());
}
private void loadTreeFromCSLAToolStripMenuItem_Click(object sender, EventArgs e)
{
btnLoadTreeCSLA_Click(this, new EventArgs());
}
private void loadVETreeFromCSLAToolStripMenuItem_Click(object sender, EventArgs e)
{
btnVETree_CSLA_Click(this, new EventArgs());
}
private void groupSecurityToolStripMenuItem_Click(object sender, EventArgs e)
{
btnGroup_Click(this, new EventArgs());
}
private void countTokensToolStripMenuItem_Click(object sender, EventArgs e)
{
btnCtTok_Click(this, new EventArgs());
}
private void convertDbfSelectedInTreeToolStripMenuItem_Click(object sender, EventArgs e)
{
btnConvertSelected_Click(this, new EventArgs());
}
#endregion
}
public class MessageBuilder
{
private StringBuilder _MyStringBulider=new StringBuilder();
private DateTime _LastTime=DateTime.Now;
public MessageBuilder(string heading)
{
_MyStringBulider.Append(heading);
}
public void Append(string format, params object [] args)
{
string msg = "\r\n" + string.Format(format,args);
DateTime now = DateTime.Now;
TimeSpan ts = TimeSpan.FromTicks(now.Ticks - _LastTime.Ticks);
string timestamp = string.Format("{0:D2}:{1:D2}:{2:D2}.{3:D3}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);
_LastTime = now;
_MyStringBulider.Append("\r\n" + timestamp + " " + msg);
}
public override string ToString()
{
return _MyStringBulider.ToString();
}
}
}

View File

@ -117,13 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>217, 17</value>
</metadata>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>84, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>217, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>314, 17</value>
</metadata>
</root>

109
PROMS/DataLoader/frmPG.cs Normal file
View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
namespace DataLoader
{
public partial class frmPG : Form
{
private object _SelectedObject;
public object SelectedObject
{
get { return _SelectedObject; }
set { _SelectedObject = value; }
}
public frmPG(string title, object selectedObject)
{
InitializeComponent();
this.Text = title;
_SelectedObject = selectedObject;
}
private void CheckValidity()
{
if (SelectedObject.GetType().Name == "DataLoaderSettings")
{
DataLoaderSettings myDls = (DataLoaderSettings)SelectedObject;
string validity = myDls.ValidityCheck;
pg.SelectedObject = SelectedObject;
tbError.Text = validity;
if (validity == "")
tbError.Visible = false;
else
{
using (Graphics gr = tbError.CreateGraphics())
{
SizeF sf = gr.MeasureString(validity, tbError.Font,tbError.ClientRectangle.Width-10);
tbError.Height = (int)(tbError.Font.GetHeight(gr.DpiY) + sf.Height);
}
tbError.Visible = true;
}
}
else
tbError.Visible = false;
btnOK.Enabled = !tbError.Visible;
}
private void frmPG_Load(object sender, EventArgs e)
{
pg.PropertyValueChanged += new PropertyValueChangedEventHandler(pg_PropertyValueChanged);
pg.SelectedObject = SelectedObject;
Resize += new EventHandler(frmPG_Resize);
CheckValidity();
MoveSplitterTo(pg, SplitterWidth);
}
void pg_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (e.ChangedItem.Label == "VEProms Exe Folder")
{
DataLoaderSettings dls = SelectedObject as DataLoaderSettings;
if (dls != null)
dls.VESamFile = dls.VEPromsPath + "\\vesam.opt";
}
if (e.ChangedItem.Label == "Procedure Folder")
{
DataLoaderSettings dls = SelectedObject as DataLoaderSettings;
if (dls != null)
dls.PDFFolder = "";
}
CheckValidity();
}
void frmPG_Resize(object sender, EventArgs e)
{
MoveSplitterTo(pg, SplitterWidth);
}
private int _SplitterWidth = 0;
public int SplitterWidth
{
get
{
if (_SplitterWidth == 0)
{
using (Graphics gr = this.CreateGraphics())
_SplitterWidth = 180 * ((int)gr.DpiX) / 96;
}
return _SplitterWidth;
}
}
static void MoveSplitterTo(PropertyGrid grid, int x)
{
// HEALTH WARNING: reflection can be brittle...
FieldInfo field = typeof(PropertyGrid)
.GetField("gridView",
BindingFlags.NonPublic | BindingFlags.Instance);
field.FieldType
.GetMethod("MoveSplitterTo",
BindingFlags.NonPublic | BindingFlags.Instance)
.Invoke(field.GetValue(grid), new object[] { x });
}
private void btnCancel_Click(object sender, EventArgs e)
{
PropertyDescriptor pd = pg.SelectedGridItem.PropertyDescriptor;
pd.ResetValue(pg.SelectedObject);
}
}
}

120
PROMS/DataLoader/frmPG.designer.cs generated Normal file
View File

@ -0,0 +1,120 @@
namespace DataLoader
{
partial class frmPG
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.pg = new System.Windows.Forms.PropertyGrid();
this.tbError = new System.Windows.Forms.TextBox();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Controls.Add(this.btnOK);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 540);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(453, 38);
this.panel1.TabIndex = 0;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(366, 6);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(285, 6);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
//
// pg
//
this.pg.Dock = System.Windows.Forms.DockStyle.Fill;
this.pg.Location = new System.Drawing.Point(0, 0);
this.pg.Name = "pg";
this.pg.Size = new System.Drawing.Size(453, 425);
this.pg.TabIndex = 1;
//
// tbError
//
this.tbError.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.tbError.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tbError.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tbError.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.tbError.Location = new System.Drawing.Point(0, 425);
this.tbError.Multiline = true;
this.tbError.Name = "tbError";
this.tbError.Size = new System.Drawing.Size(453, 115);
this.tbError.TabIndex = 2;
//
// frmPG
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(453, 578);
this.ControlBox = false;
this.Controls.Add(this.pg);
this.Controls.Add(this.tbError);
this.Controls.Add(this.panel1);
this.Name = "frmPG";
this.Text = "frmPG";
this.Load += new System.EventHandler(this.frmPG_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.PropertyGrid pg;
private System.Windows.Forms.TextBox tbError;
}
}