...
 
Commits (2)
  • Meelad Vahdat's avatar
    Lots of changes in this one: · 3073682f
    Meelad Vahdat authored
    - General
    -- Changed logos and icons to official Listware Desktop logos and icons
    
    - AutoDetectInputs.cs
    -- Added phone and email variations
    
    - Output.cs
    -- Added a linesWritten counter as well as method numberOfLinesWritten
    
    - MainForm.cs
    -- Changed backgroundWorker1_DoWork to utilize multi-threading
    
    - MainForm.Designer.cs
    -- Added a location at the top to change number of threads
    
    - GenerateReport.cs
    -- Made it so that any result codes not found in the config do not cause an exception and are counted as "XXXX" in the report
    
    - ValidDescriptions.cfg
    -- Added "XXXX" to mean "Could not find results"
    
    - AboutForm.Designer.cs
    -- Changed pictureBox1 to new logo
    
    - InputPreviewForm.cs
    -- Added and call resizeForm() in the constructor to resize the form automatically
    
    - SetConfigurationForm.cs
    -- Changed logic to correctly show setConfigurationFormCheckedListBox
    -- Added and call resizeForm() in the constructor to resize the form automatically
    
    - SetInputsForm.cs
    -- Added and call resizeForm() in the constructor to resize the form automatically
    
    - SetOutputsForm.cs
    -- Added and call resizeForm() in the constructor to resize the form automatically
    Signed-off-by: Meelad Vahdat's avatarMeelad Vahdat <meelad@melissadata.com>
    3073682f
  • Meelad Vahdat's avatar
    Merge branch 'MeeladWorkingBranch' into 'master' · 01f4156d
    Meelad Vahdat authored
    Lots of changes in this one:
    
    See merge request !3
    01f4156d
...@@ -33,6 +33,10 @@ namespace ListwareDesktop.Framework ...@@ -33,6 +33,10 @@ namespace ListwareDesktop.Framework
static string[] recordIDVariations = { "recordid", "recnum", "recno", "recid", "id", "rec" }; static string[] recordIDVariations = { "recordid", "recnum", "recno", "recid", "id", "rec" };
static string[] phoneVariations = { "phone", "phonenumber", "fone", "fonenumber", "phonenum", "fonenum" };
static string[] emailVariations = { "email", "emailaddress", "emailaddr", "e-mail" };
//This relates input column names to the variation lists //This relates input column names to the variation lists
//Add input columns from services here in all lower case as the key, then the variation list as the value //Add input columns from services here in all lower case as the key, then the variation list as the value
internal static Dictionary<string, string[]> variationDictionary = new Dictionary<string, string[]>() internal static Dictionary<string, string[]> variationDictionary = new Dictionary<string, string[]>()
...@@ -52,7 +56,9 @@ namespace ListwareDesktop.Framework ...@@ -52,7 +56,9 @@ namespace ListwareDesktop.Framework
{"lastname", lastNameVariations}, {"lastname", lastNameVariations},
{"fullname", fullNameVariations}, {"fullname", fullNameVariations},
{"companyname", companyVariations}, {"companyname", companyVariations},
{"recordid", recordIDVariations} {"recordid", recordIDVariations},
{"emailaddress", emailVariations},
{"phonenumber", phoneVariations}
}; };
} }
} }
...@@ -14,10 +14,12 @@ namespace ListwareDesktop.Framework ...@@ -14,10 +14,12 @@ namespace ListwareDesktop.Framework
private string filePath { get; set; } private string filePath { get; set; }
private string delimiter; private string delimiter;
private string qualifier; private string qualifier;
private int linesWritten;
//Constructor that sets all the settings for the writer //Constructor that sets all the settings for the writer
internal Output(string filePath, string delimiter, string qualifier) internal Output(string filePath, string delimiter, string qualifier)
{ {
this.linesWritten = 0;
this.filePath = filePath; this.filePath = filePath;
this.delimiter = delimiter; this.delimiter = delimiter;
this.qualifier = qualifier; this.qualifier = qualifier;
...@@ -36,17 +38,23 @@ namespace ListwareDesktop.Framework ...@@ -36,17 +38,23 @@ namespace ListwareDesktop.Framework
{ {
if ((qualifier == null) && (tempRecord.fieldAndData[currentHeader].Contains(delimiter))) if ((qualifier == null) && (tempRecord.fieldAndData[currentHeader].Contains(delimiter)))
{ {
tempString += "\"" + tempRecord.fieldAndData[currentHeader] + "\"" + delimiter; tempString += "\"" + tempRecord.fieldAndData[currentHeader].Trim() + "\"" + delimiter;
} }
else else
{ {
tempString += qualifier + tempRecord.fieldAndData[currentHeader] + qualifier + delimiter; tempString += qualifier + tempRecord.fieldAndData[currentHeader].Trim() + qualifier + delimiter;
} }
} }
streamWriter.WriteLine(tempString); streamWriter.WriteLine(tempString.TrimEnd(new char[]{delimiter[0]}));
linesWritten++;
} }
} }
internal int numberOfLinesWritten()
{
return this.linesWritten;
}
//Writes header line //Writes header line
internal void writeHeaders(Record sampleRecord) internal void writeHeaders(Record sampleRecord)
{ {
...@@ -59,7 +67,7 @@ namespace ListwareDesktop.Framework ...@@ -59,7 +67,7 @@ namespace ListwareDesktop.Framework
tempString += qualifier + header + qualifier + delimiter; tempString += qualifier + header + qualifier + delimiter;
} }
streamWriter.WriteLine(tempString); streamWriter.WriteLine(tempString.TrimEnd(new char[]{delimiter[0]}));
} }
internal void checkIfEmpty(Record sampleRecord) internal void checkIfEmpty(Record sampleRecord)
......
...@@ -160,11 +160,11 @@ ...@@ -160,11 +160,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Images\ListwareDesktop.PNG" /> <Content Include="Images\ListwareDesktop.PNG" />
<Content Include="Images\Melissa-favicon-32x32.png" /> <Content Include="Images\LWDT.ico" />
<Content Include="Images\Melissa-new-logo-no-tag-200px.png" /> <Content Include="Images\LWDT.png" />
<Content Include="Images\Melissa.ico" />
<Content Include="Reporting\ReportTemplate.html" /> <Content Include="Reporting\ReportTemplate.html" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory>https://www.melissa.com/company/support</SupportUrlHistory>
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory>http://wiki.melissadata.com/</ErrorReportUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
...@@ -96,6 +96,9 @@ ...@@ -96,6 +96,9 @@
this.aboutCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.purchaseCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.purchaseCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.numberOfThreadsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.numberOfThreadsMenuStripTextBox = new System.Windows.Forms.ToolStripTextBox();
this.pauseButton = new System.Windows.Forms.Button(); this.pauseButton = new System.Windows.Forms.Button();
this.inputFileGroupBox.SuspendLayout(); this.inputFileGroupBox.SuspendLayout();
this.inputFileQualifierGroupBox.SuspendLayout(); this.inputFileQualifierGroupBox.SuspendLayout();
...@@ -184,7 +187,6 @@ ...@@ -184,7 +187,6 @@
this.backgroundWorker1.WorkerReportsProgress = true; this.backgroundWorker1.WorkerReportsProgress = true;
this.backgroundWorker1.WorkerSupportsCancellation = true; this.backgroundWorker1.WorkerSupportsCancellation = true;
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
// //
// inputFileGroupBox // inputFileGroupBox
...@@ -778,7 +780,8 @@ ...@@ -778,7 +780,8 @@
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.licenseToolStripMenuItem, this.licenseToolStripMenuItem,
this.creditsToolStripMenuItem, this.creditsToolStripMenuItem,
this.aboutToolStripMenuItem}); this.aboutToolStripMenuItem,
this.optionsToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip"; this.menuStrip.Name = "menuStrip";
this.menuStrip.Size = new System.Drawing.Size(841, 24); this.menuStrip.Size = new System.Drawing.Size(841, 24);
...@@ -833,6 +836,33 @@ ...@@ -833,6 +836,33 @@
this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
// //
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.numberOfThreadsToolStripMenuItem});
this.optionsToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsToolStripMenuItem.Text = "Options";
//
// numberOfThreadsToolStripMenuItem
//
this.numberOfThreadsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.numberOfThreadsMenuStripTextBox});
this.numberOfThreadsToolStripMenuItem.Name = "numberOfThreadsToolStripMenuItem";
this.numberOfThreadsToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.numberOfThreadsToolStripMenuItem.Text = "Number of Threads";
this.numberOfThreadsToolStripMenuItem.MouseEnter += new System.EventHandler(this.numberOfThreadsToolStripMenuItem_MouseEnter);
//
// numberOfThreadsMenuStripTextBox
//
this.numberOfThreadsMenuStripTextBox.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.numberOfThreadsMenuStripTextBox.MaxLength = 2;
this.numberOfThreadsMenuStripTextBox.Name = "numberOfThreadsMenuStripTextBox";
this.numberOfThreadsMenuStripTextBox.Size = new System.Drawing.Size(100, 22);
this.numberOfThreadsMenuStripTextBox.Text = "5";
this.numberOfThreadsMenuStripTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.numberOfThreadsMenuStripTextBox_KeyPress);
//
// pauseButton // pauseButton
// //
this.pauseButton.Enabled = false; this.pauseButton.Enabled = false;
...@@ -964,6 +994,9 @@ ...@@ -964,6 +994,9 @@
private System.Windows.Forms.TextBox reportingClientNameTextBox; private System.Windows.Forms.TextBox reportingClientNameTextBox;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.Button pauseButton; private System.Windows.Forms.Button pauseButton;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem numberOfThreadsToolStripMenuItem;
private System.Windows.Forms.ToolStripTextBox numberOfThreadsMenuStripTextBox;
} }
} }
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -59,15 +59,5 @@ namespace ListwareDesktop.Properties { ...@@ -59,15 +59,5 @@ namespace ListwareDesktop.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Melissa_new_logo_no_tag_200px {
get {
object obj = ResourceManager.GetObject("Melissa-new-logo-no-tag-200px", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }
...@@ -118,7 +118,4 @@ ...@@ -118,7 +118,4 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Melissa-new-logo-no-tag-200px" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\Melissa-new-logo-no-tag-200px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
\ No newline at end of file
...@@ -162,21 +162,42 @@ namespace ListwareDesktop.Reporting ...@@ -162,21 +162,42 @@ namespace ListwareDesktop.Reporting
foreach (int x in rcFields) foreach (int x in rcFields)
{ {
string mdresults = Fields[x]; string mdresults = "";
try
{
mdresults = Fields[x];
}
catch (IndexOutOfRangeException)
{
mdresults = "XXXX";
}
string[] rowcodes = mdresults.Split(','); string[] rowcodes = mdresults.Split(',');
foreach (string rcode in rowcodes) foreach (string rcode in rowcodes)
{ {
if (!this.openWith.ContainsKey(rcode)) if ((rcode.Length != 4) || ((rcode.Length == 4) && ((!char.IsLetter(rcode[0])) || (!char.IsLetter(rcode[1])) || (!char.IsDigit(rcode[2])) || (!char.IsDigit(rcode[3])))))
{ {
this.openWith.Add(rcode, 1); if (!this.openWith.ContainsKey("XXXX"))
{
this.openWith.Add("XXXX", 1);
}
else
{
this.openWith["XXXX"] = openWith["XXXX"] + 1;
}
} }
else else
{ {
this.openWith[rcode] = openWith[rcode] + 1; if (!this.openWith.ContainsKey(rcode))
{
this.openWith.Add(rcode, 1);
}
else
{
this.openWith[rcode] = openWith[rcode] + 1;
}
} }
} }
} }
TTotal++; TTotal++;
......
...@@ -334,3 +334,4 @@ FS08 MEK Match ...@@ -334,3 +334,4 @@ FS08 MEK Match
FE01 No Match FE01 No Match
FE02 Minimum Input Not Met FE02 Minimum Input Not Met
FE03 Multiple Matches FE03 Multiple Matches
XXXX Could not find results in row. Please check input delimiters and qualifiers.
\ No newline at end of file
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
// companyLabel // companyLabel
// //
this.companyLabel.AutoSize = true; this.companyLabel.AutoSize = true;
this.companyLabel.Location = new System.Drawing.Point(12, 116); this.companyLabel.Location = new System.Drawing.Point(12, 101);
this.companyLabel.Name = "companyLabel"; this.companyLabel.Name = "companyLabel";
this.companyLabel.Size = new System.Drawing.Size(176, 39); this.companyLabel.Size = new System.Drawing.Size(176, 39);
this.companyLabel.TabIndex = 0; this.companyLabel.TabIndex = 0;
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
// label5 // label5
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 184); this.label5.Location = new System.Drawing.Point(12, 169);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(246, 39); this.label5.Size = new System.Drawing.Size(246, 39);
this.label5.TabIndex = 4; this.label5.TabIndex = 4;
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
// techSupportEmailLinkLabel // techSupportEmailLinkLabel
// //
this.techSupportEmailLinkLabel.AutoSize = true; this.techSupportEmailLinkLabel.AutoSize = true;
this.techSupportEmailLinkLabel.Location = new System.Drawing.Point(53, 210); this.techSupportEmailLinkLabel.Location = new System.Drawing.Point(53, 195);
this.techSupportEmailLinkLabel.Name = "techSupportEmailLinkLabel"; this.techSupportEmailLinkLabel.Name = "techSupportEmailLinkLabel";
this.techSupportEmailLinkLabel.Size = new System.Drawing.Size(117, 13); this.techSupportEmailLinkLabel.Size = new System.Drawing.Size(117, 13);
this.techSupportEmailLinkLabel.TabIndex = 5; this.techSupportEmailLinkLabel.TabIndex = 5;
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
// wikiLabel // wikiLabel
// //
this.wikiLabel.AutoSize = true; this.wikiLabel.AutoSize = true;
this.wikiLabel.Location = new System.Drawing.Point(12, 162); this.wikiLabel.Location = new System.Drawing.Point(12, 147);
this.wikiLabel.Name = "wikiLabel"; this.wikiLabel.Name = "wikiLabel";
this.wikiLabel.Size = new System.Drawing.Size(205, 13); this.wikiLabel.Size = new System.Drawing.Size(205, 13);
this.wikiLabel.TabIndex = 6; this.wikiLabel.TabIndex = 6;
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
// websiteLinkLabel // websiteLinkLabel
// //
this.websiteLinkLabel.AutoSize = true; this.websiteLinkLabel.AutoSize = true;
this.websiteLinkLabel.Location = new System.Drawing.Point(12, 103); this.websiteLinkLabel.Location = new System.Drawing.Point(12, 88);
this.websiteLinkLabel.Name = "websiteLinkLabel"; this.websiteLinkLabel.Name = "websiteLinkLabel";
this.websiteLinkLabel.Size = new System.Drawing.Size(91, 13); this.websiteLinkLabel.Size = new System.Drawing.Size(91, 13);
this.websiteLinkLabel.TabIndex = 8; this.websiteLinkLabel.TabIndex = 8;
...@@ -104,7 +104,9 @@ ...@@ -104,7 +104,9 @@
// //
// pictureBox1 // pictureBox1
// //
this.pictureBox1.Image = global::ListwareDesktop.Properties.Resources.Melissa_new_logo_no_tag_200px; this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(26, 2); this.pictureBox1.Location = new System.Drawing.Point(26, 2);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(213, 70); this.pictureBox1.Size = new System.Drawing.Size(213, 70);
...@@ -114,7 +116,7 @@ ...@@ -114,7 +116,7 @@
// versionLabel // versionLabel
// //
this.versionLabel.AutoSize = true; this.versionLabel.AutoSize = true;
this.versionLabel.Location = new System.Drawing.Point(12, 90); this.versionLabel.Location = new System.Drawing.Point(12, 75);
this.versionLabel.Name = "versionLabel"; this.versionLabel.Name = "versionLabel";
this.versionLabel.Size = new System.Drawing.Size(127, 13); this.versionLabel.Size = new System.Drawing.Size(127, 13);
this.versionLabel.TabIndex = 10; this.versionLabel.TabIndex = 10;
...@@ -124,7 +126,7 @@ ...@@ -124,7 +126,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(261, 228); this.ClientSize = new System.Drawing.Size(261, 216);
this.Controls.Add(this.versionLabel); this.Controls.Add(this.versionLabel);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.websiteLinkLabel); this.Controls.Add(this.websiteLinkLabel);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -37,11 +37,15 @@ ...@@ -37,11 +37,15 @@
// //
this.previewDataGridView.AllowUserToAddRows = false; this.previewDataGridView.AllowUserToAddRows = false;
this.previewDataGridView.AllowUserToDeleteRows = false; this.previewDataGridView.AllowUserToDeleteRows = false;
this.previewDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; this.previewDataGridView.AllowUserToResizeRows = false;
this.previewDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.previewDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.previewDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.previewDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.previewDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.previewDataGridView.Location = new System.Drawing.Point(0, 0); this.previewDataGridView.Location = new System.Drawing.Point(0, 0);
this.previewDataGridView.Name = "previewDataGridView"; this.previewDataGridView.Name = "previewDataGridView";
this.previewDataGridView.ReadOnly = true;
this.previewDataGridView.RowHeadersVisible = false;
this.previewDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.previewDataGridView.Size = new System.Drawing.Size(551, 261); this.previewDataGridView.Size = new System.Drawing.Size(551, 261);
this.previewDataGridView.TabIndex = 0; this.previewDataGridView.TabIndex = 0;
// //
......
...@@ -26,10 +26,44 @@ namespace ListwareDesktop.Windows ...@@ -26,10 +26,44 @@ namespace ListwareDesktop.Windows
InitializeComponent(); InitializeComponent();
this.fillDGV(); this.fillDGV();
this.resizeForm();
ClientSize = new Size(previewDataGridView.Width,previewDataGridView.Height); ClientSize = new Size(previewDataGridView.Width,previewDataGridView.Height);
} }
private void resizeForm()
{
int originalHeight = this.previewDataGridView.Height;
int originalWidth = this.previewDataGridView.Width;
int sumHeight = this.previewDataGridView.ColumnHeadersHeight;
int sumWidth = 0;
foreach (DataGridViewRow row in this.previewDataGridView.Rows)
{
sumHeight += row.Height;
}
foreach (DataGridViewColumn column in this.previewDataGridView.Columns)
{
sumWidth += column.Width;
}
int heightDiff = originalHeight - sumHeight;
int widthDiff = originalWidth - sumWidth;
if (heightDiff > 0)
{
this.previewDataGridView.Height = sumHeight + 1;
this.Height = this.Height - heightDiff;
}
if (widthDiff > 0)
{
this.previewDataGridView.Width = sumWidth + 1;
this.Width = this.Width - widthDiff;
}
}
private void fillDGV() private void fillDGV()
{ {
Input inputPreview = new Input(inputFilePath, delimiter, qualifier); Input inputPreview = new Input(inputFilePath, delimiter, qualifier);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
// //
this.setConfigurationFormDataGridView.AllowUserToAddRows = false; this.setConfigurationFormDataGridView.AllowUserToAddRows = false;
this.setConfigurationFormDataGridView.AllowUserToDeleteRows = false; this.setConfigurationFormDataGridView.AllowUserToDeleteRows = false;
this.setConfigurationFormDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.setConfigurationFormDataGridView.AllowUserToResizeRows = false;
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.setConfigurationFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; this.setConfigurationFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
this.setConfigurationFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setConfigurationFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.setConfigurationFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.setConfigurationFormDGVOptionName, this.setConfigurationFormDGVOptionName,
this.setConfigurationFormDGVOptionValues}); this.setConfigurationFormDGVOptionValues});
this.setConfigurationFormDataGridView.Dock = System.Windows.Forms.DockStyle.Top;
this.setConfigurationFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.setConfigurationFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setConfigurationFormDataGridView.Location = new System.Drawing.Point(0, -2); this.setConfigurationFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setConfigurationFormDataGridView.Name = "setConfigurationFormDataGridView"; this.setConfigurationFormDataGridView.Name = "setConfigurationFormDataGridView";
this.setConfigurationFormDataGridView.RowHeadersVisible = false; this.setConfigurationFormDataGridView.RowHeadersVisible = false;
this.setConfigurationFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; this.setConfigurationFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
...@@ -104,7 +104,6 @@ ...@@ -104,7 +104,6 @@
this.setConfigurationFormCheckedListBox.Size = new System.Drawing.Size(120, 94); this.setConfigurationFormCheckedListBox.Size = new System.Drawing.Size(120, 94);
this.setConfigurationFormCheckedListBox.TabIndex = 3; this.setConfigurationFormCheckedListBox.TabIndex = 3;
this.setConfigurationFormCheckedListBox.Visible = false; this.setConfigurationFormCheckedListBox.Visible = false;
this.setConfigurationFormCheckedListBox.Leave += new System.EventHandler(this.setConfigurationFormCheckedListBox_Leave);
// //
// SetConfigurationForm // SetConfigurationForm
// //
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetInputsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetInputsForm));
this.setInputsFormDataGridView = new System.Windows.Forms.DataGridView(); this.setInputsFormDataGridView = new System.Windows.Forms.DataGridView();
this.Inputs = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.setInputsFormSaveButton = new System.Windows.Forms.Button(); this.setInputsFormSaveButton = new System.Windows.Forms.Button();
this.setInputsFormCancelButton = new System.Windows.Forms.Button(); this.setInputsFormCancelButton = new System.Windows.Forms.Button();
this.Inputs = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.setInputsFormDataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.setInputsFormDataGridView)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
// //
this.setInputsFormDataGridView.AllowUserToAddRows = false; this.setInputsFormDataGridView.AllowUserToAddRows = false;
this.setInputsFormDataGridView.AllowUserToDeleteRows = false; this.setInputsFormDataGridView.AllowUserToDeleteRows = false;
this.setInputsFormDataGridView.AllowUserToResizeRows = false;
this.setInputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.setInputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.setInputsFormDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.setInputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.setInputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setInputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.setInputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Inputs}); this.Inputs});
...@@ -49,15 +49,11 @@ ...@@ -49,15 +49,11 @@
this.setInputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.setInputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setInputsFormDataGridView.Location = new System.Drawing.Point(0, 0); this.setInputsFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setInputsFormDataGridView.Name = "setInputsFormDataGridView"; this.setInputsFormDataGridView.Name = "setInputsFormDataGridView";
this.setInputsFormDataGridView.RowHeadersVisible = false;
this.setInputsFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.setInputsFormDataGridView.Size = new System.Drawing.Size(284, 436); this.setInputsFormDataGridView.Size = new System.Drawing.Size(284, 436);
this.setInputsFormDataGridView.TabIndex = 0; this.setInputsFormDataGridView.TabIndex = 0;
// //
// Inputs
//
this.Inputs.HeaderText = "Inputs";
this.Inputs.Name = "Inputs";
this.Inputs.ReadOnly = true;
//
// setInputsFormSaveButton // setInputsFormSaveButton
// //
this.setInputsFormSaveButton.Location = new System.Drawing.Point(36, 442); this.setInputsFormSaveButton.Location = new System.Drawing.Point(36, 442);
...@@ -78,15 +74,24 @@ ...@@ -78,15 +74,24 @@
this.setInputsFormCancelButton.UseVisualStyleBackColor = true; this.setInputsFormCancelButton.UseVisualStyleBackColor = true;
this.setInputsFormCancelButton.Click += new System.EventHandler(this.setInputsFormCancelButton_Click); this.setInputsFormCancelButton.Click += new System.EventHandler(this.setInputsFormCancelButton_Click);
// //
// Inputs
//
this.Inputs.HeaderText = "Inputs";
this.Inputs.Name = "Inputs";
this.Inputs.ReadOnly = true;
this.Inputs.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// SetInputsForm // SetInputsForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true; this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(284, 477); this.ClientSize = new System.Drawing.Size(284, 477);
this.Controls.Add(this.setInputsFormCancelButton); this.Controls.Add(this.setInputsFormCancelButton);
this.Controls.Add(this.setInputsFormSaveButton); this.Controls.Add(this.setInputsFormSaveButton);
this.Controls.Add(this.setInputsFormDataGridView); this.Controls.Add(this.setInputsFormDataGridView);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SetInputsForm"; this.Name = "SetInputsForm";
this.Text = "Set Inputs"; this.Text = "Set Inputs";
...@@ -98,8 +103,8 @@ ...@@ -98,8 +103,8 @@
#endregion #endregion
private System.Windows.Forms.DataGridView setInputsFormDataGridView; private System.Windows.Forms.DataGridView setInputsFormDataGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn Inputs;
private System.Windows.Forms.Button setInputsFormSaveButton; private System.Windows.Forms.Button setInputsFormSaveButton;
private System.Windows.Forms.Button setInputsFormCancelButton; private System.Windows.Forms.Button setInputsFormCancelButton;
private System.Windows.Forms.DataGridViewTextBoxColumn Inputs;
} }
} }
\ No newline at end of file
...@@ -21,9 +21,9 @@ namespace ListwareDesktop.Windows ...@@ -21,9 +21,9 @@ namespace ListwareDesktop.Windows
private CheckBox inputColumnsSetCheckBox; private CheckBox inputColumnsSetCheckBox;
//Pass in IWS interface, so that any service that extends the interface can be passed in //Pass in IWS interface, so that any service that extends the interface can be passed in
internal SetInputsForm(IWS inputService, string inputFilePath, string delimiter, string qualifier, CheckBox inputColumnsSetCheckBox) internal SetInputsForm(string inputFilePath, string delimiter, string qualifier, CheckBox inputColumnsSetCheckBox)
{ {
this.inputService = inputService; this.inputService = Activator.CreateInstance(MainForm.serviceType) as IWS;
this.inputFilePath = inputFilePath; this.inputFilePath = inputFilePath;
this.delimiter = delimiter; this.delimiter = delimiter;
this.qualifier = qualifier; this.qualifier = qualifier;
...@@ -33,9 +33,28 @@ namespace ListwareDesktop.Windows ...@@ -33,9 +33,28 @@ namespace ListwareDesktop.Windows
InitializeComponent(); InitializeComponent();
this.fillDGV(); this.fillDGV();
this.resizeForm();
this.setDefaultValuesForInputs(); this.setDefaultValuesForInputs();
} }
//Auto size the form to the options
private void resizeForm()
{
int originalHeight = this.setInputsFormDataGridView.Height;
int sum = this.setInputsFormDataGridView.ColumnHeadersHeight;
foreach (DataGridViewRow row in this.setInputsFormDataGridView.Rows)
{
sum += row.Height;
}
this.setInputsFormDataGridView.Height = sum + 1;
int heightDiff = originalHeight - sum;
this.Height = this.Height - heightDiff;
this.setInputsFormSaveButton.Location = new Point(this.setInputsFormSaveButton.Location.X, this.setInputsFormSaveButton.Location.Y - heightDiff);
this.setInputsFormCancelButton.Location = new Point(this.setInputsFormCancelButton.Location.X, this.setInputsFormCancelButton.Location.Y - heightDiff);
}
//Datagridviewer filled with service inputs and columns from input file //Datagridviewer filled with service inputs and columns from input file
private void fillDGV() private void fillDGV()
{ {
...@@ -143,7 +162,7 @@ namespace ListwareDesktop.Windows ...@@ -143,7 +162,7 @@ namespace ListwareDesktop.Windows
} }
} }
} }
MainForm.inputAliases = inputAliases; MainForm.inputAliases = new Dictionary<string,string>(inputAliases);
inputColumnsSetCheckBox.Checked = true; inputColumnsSetCheckBox.Checked = true;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetOutputsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetOutputsForm));
this.setOutputsFormDataGridView = new System.Windows.Forms.DataGridView(); this.setOutputsFormDataGridView = new System.Windows.Forms.DataGridView();
this.FieldName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.FieldName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Select = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.SelectColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.setOutputsFormSaveButton = new System.Windows.Forms.Button(); this.setOutputsFormSaveButton = new System.Windows.Forms.Button();
this.saveOutputsFormCancelButton = new System.Windows.Forms.Button(); this.setOutputsFormCancelButton = new System.Windows.Forms.Button();
this.setOutputsFormSelectAllButton = new System.Windows.Forms.Button(); this.setOutputsFormSelectAllButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.setOutputsFormDataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.setOutputsFormDataGridView)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
...@@ -42,18 +42,19 @@ ...@@ -42,18 +42,19 @@
// //
this.setOutputsFormDataGridView.AllowUserToAddRows = false; this.setOutputsFormDataGridView.AllowUserToAddRows = false;
this.setOutputsFormDataGridView.AllowUserToDeleteRows = false; this.setOutputsFormDataGridView.AllowUserToDeleteRows = false;
this.setOutputsFormDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.setOutputsFormDataGridView.AllowUserToResizeRows = false;
| System.Windows.Forms.AnchorStyles.Right)));
this.setOutputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.setOutputsFormDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.setOutputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.setOutputsFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.setOutputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.setOutputsFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.FieldName, this.FieldName,
this.Select}); this.SelectColumn});
this.setOutputsFormDataGridView.Dock = System.Windows.Forms.DockStyle.Top;
this.setOutputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.setOutputsFormDataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.setOutputsFormDataGridView.Location = new System.Drawing.Point(1, 1); this.setOutputsFormDataGridView.Location = new System.Drawing.Point(0, 0);
this.setOutputsFormDataGridView.Name = "setOutputsFormDataGridView"; this.setOutputsFormDataGridView.Name = "setOutputsFormDataGridView";
this.setOutputsFormDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; this.setOutputsFormDataGridView.RowHeadersVisible = false;
this.setOutputsFormDataGridView.Size = new System.Drawing.Size(395, 448); this.setOutputsFormDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.setOutputsFormDataGridView.Size = new System.Drawing.Size(398, 448);
this.setOutputsFormDataGridView.TabIndex = 0; this.setOutputsFormDataGridView.TabIndex = 0;
// //
// FieldName // FieldName
...@@ -62,12 +63,12 @@ ...@@ -62,12 +63,12 @@
this.FieldName.Name = "FieldName"; this.FieldName.Name = "FieldName";
this.FieldName.ReadOnly = true; this.FieldName.ReadOnly = true;
// //
// Select // SelectColumn
// //
this.Select.FalseValue = "false"; this.SelectColumn.FalseValue = "false";
this.Select.HeaderText = "Select"; this.SelectColumn.HeaderText = "Select";
this.Select.Name = "Select"; this.SelectColumn.Name = "SelectColumn";
this.Select.TrueValue = "true"; this.SelectColumn.TrueValue = "true";
// //
// setOutputsFormSaveButton // setOutputsFormSaveButton
// //
...@@ -79,15 +80,15 @@ ...@@ -79,15 +80,15 @@
this.setOutputsFormSaveButton.UseVisualStyleBackColor = true; this.setOutputsFormSaveButton.UseVisualStyleBackColor = true;
this.setOutputsFormSaveButton.Click += new System.EventHandler(this.setOutputsFormSaveButton_Click); this.setOutputsFormSaveButton.Click += new System.EventHandler(this.setOutputsFormSaveButton_Click);
// //
// saveOutputsFormCancelButton // setOutputsFormCancelButton
// //
this.saveOutputsFormCancelButton.Location = new System.Drawing.Point(263, 455); this.setOutputsFormCancelButton.Location = new System.Drawing.Point(263, 455);
this.saveOutputsFormCancelButton.Name = "saveOutputsFormCancelButton"; this.setOutputsFormCancelButton.Name = "setOutputsFormCancelButton";
this.saveOutputsFormCancelButton.Size = new System.Drawing.Size(75, 23); this.setOutputsFormCancelButton.Size = new System.Drawing.Size(75, 23);
this.saveOutputsFormCancelButton.TabIndex = 2; this.setOutputsFormCancelButton.TabIndex = 2;
this.saveOutputsFormCancelButton.Text = "Cancel"; this.setOutputsFormCancelButton.Text = "Cancel";
this.saveOutputsFormCancelButton.UseVisualStyleBackColor = true; this.setOutputsFormCancelButton.UseVisualStyleBackColor = true;
this.saveOutputsFormCancelButton.Click += new System.EventHandler(this.saveOutputsFormCancelButton_Click); this.setOutputsFormCancelButton.Click += new System.EventHandler(this.setOutputsFormCancelButton_Click);
// //
// setOutputsFormSelectAllButton // setOutputsFormSelectAllButton
// //
...@@ -103,11 +104,13 @@ ...@@ -103,11 +104,13 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(398, 490); this.ClientSize = new System.Drawing.Size(398, 490);
this.Controls.Add(this.setOutputsFormSelectAllButton); this.Controls.Add(this.setOutputsFormSelectAllButton);
this.Controls.Add(this.saveOutputsFormCancelButton); this.Controls.Add(this.setOutputsFormCancelButton);
this.Controls.Add(this.setOutputsFormSaveButton); this.Controls.Add(this.setOutputsFormSaveButton);
this.Controls.Add(this.setOutputsFormDataGridView); this.Controls.Add(this.setOutputsFormDataGridView);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SetOutputsForm"; this.Name = "SetOutputsForm";
this.Text = "Set Outputs"; this.Text = "Set Outputs";
...@@ -120,9 +123,9 @@ ...@@ -120,9 +123,9 @@
private System.Windows.Forms.DataGridView setOutputsFormDataGridView; private System.Windows.Forms.DataGridView setOutputsFormDataGridView;
private System.Windows.Forms.Button setOutputsFormSaveButton; private System.Windows.Forms.Button setOutputsFormSaveButton;
private System.Windows.Forms.Button saveOutputsFormCancelButton; private System.Windows.Forms.Button setOutputsFormCancelButton;
private System.Windows.Forms.Button setOutputsFormSelectAllButton; private System.Windows.Forms.Button setOutputsFormSelectAllButton;
private System.Windows.Forms.DataGridViewTextBoxColumn FieldName; private System.Windows.Forms.DataGridViewTextBoxColumn FieldName;
private System.Windows.Forms.DataGridViewCheckBoxColumn Select; private System.Windows.Forms.DataGridViewCheckBoxColumn SelectColumn;
} }
} }
\ No newline at end of file
...@@ -14,29 +14,41 @@ namespace ListwareDesktop.Windows ...@@ -14,29 +14,41 @@ namespace ListwareDesktop.Windows
public partial class SetOutputsForm : Form public partial class SetOutputsForm : Form
{ {
private string[] outputs; private string[] outputs;
private IWS currentService; private IWS inputService;
CheckBox setOutputsFormCheckBox; CheckBox setOutputsFormCheckBox;
//Set the service and get all current outputs from a sample request //Set the service and get all current outputs from a sample request
public SetOutputsForm(IWS inputService, CheckBox setOutputsFormCheckBox) public SetOutputsForm(CheckBox setOutputsFormCheckBox)
{ {
InitializeComponent(); InitializeComponent();
this.currentService = inputService; this.inputService = Activator.CreateInstance(MainForm.serviceType) as IWS;
this.setOutputsFormCheckBox = setOutputsFormCheckBox; this.setOutputsFormCheckBox = setOutputsFormCheckBox;
//outputs = getOutputsFromService(); outputs = inputService.outputColumns;
outputs = currentService.outputColumns; this.fillDGV();
fillDGV(); this.resizeForm();
} }
//Get outputs from the service using a sample request, uses the columns requested in the config form //Auto size the form to the options
//private string[] getOutputsFromService() private void resizeForm()
//{ {
// currentService.userLicense = MainForm.userLicense; int originalHeight = this.setOutputsFormDataGridView.Height;
int sum = this.setOutputsFormDataGridView.ColumnHeadersHeight;
// Record[] outputRecord = currentService.sendToService(new Record[] { new Record(new string[]{currentService.inputColumns[0]},new string[]{"Melissa"}) }); foreach (DataGridViewRow row in this.setOutputsFormDataGridView.Rows)
{
sum += row.Height;
}
// return outputRecord[0].fieldAndData.Keys.ToArray<string>(); int heightDiff = originalHeight - sum;
//} if (heightDiff > 0)
{
this.setOutputsFormDataGridView.Height = sum + 1;
this.Height = this.Height - heightDiff;
this.setOutputsFormSaveButton.Location = new Point(this.setOutputsFormSaveButton.Location.X, this.setOutputsFormSaveButton.Location.Y - heightDiff);
this.setOutputsFormSelectAllButton.Location = new Point(this.setOutputsFormSelectAllButton.Location.X, this.setOutputsFormSelectAllButton.Location.Y - heightDiff);
this.setOutputsFormCancelButton.Location = new Point(this.setOutputsFormCancelButton.Location.X, this.setOutputsFormCancelButton.Location.Y - heightDiff);
}
}
private void fillDGV() private void fillDGV()
{ {
...@@ -49,7 +61,7 @@ namespace ListwareDesktop.Windows ...@@ -49,7 +61,7 @@ namespace ListwareDesktop.Windows
{ {
foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows) foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows)
{ {
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["Select"]; DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["SelectColumn"];
if (MainForm.selectedOutputs.Contains(row.Cells["FieldName"].Value)) if (MainForm.selectedOutputs.Contains(row.Cells["FieldName"].Value))
{ {
...@@ -64,18 +76,12 @@ namespace ListwareDesktop.Windows ...@@ -64,18 +76,12 @@ namespace ListwareDesktop.Windows
} }
} }
private void saveOutputsFormCancelButton_Click(object sender, EventArgs e)
{
this.Close();
this.Dispose();
}
private void setOutputsFormSaveButton_Click(object sender, EventArgs e) private void setOutputsFormSaveButton_Click(object sender, EventArgs e)
{ {
List<string> selectedOutputs = new List<string>(); List<string> selectedOutputs = new List<string>();
foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows) foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows)
{ {
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["Select"]; DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["SelectColumn"];
if (chk.Value == chk.TrueValue) if (chk.Value == chk.TrueValue)
{ {
...@@ -94,7 +100,7 @@ namespace ListwareDesktop.Windows ...@@ -94,7 +100,7 @@ namespace ListwareDesktop.Windows
bool checkedAlready = new bool(); bool checkedAlready = new bool();
foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows) foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows)
{ {
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["Select"]; DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["SelectColumn"];
if (chk.Value == chk.FalseValue) if (chk.Value == chk.FalseValue)
{ {
...@@ -109,7 +115,7 @@ namespace ListwareDesktop.Windows ...@@ -109,7 +115,7 @@ namespace ListwareDesktop.Windows
foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows) foreach (DataGridViewRow row in setOutputsFormDataGridView.Rows)
{ {
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["Select"]; DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["SelectColumn"];
if (!checkedAlready) if (!checkedAlready)
{ {
...@@ -121,5 +127,11 @@ namespace ListwareDesktop.Windows ...@@ -121,5 +127,11 @@ namespace ListwareDesktop.Windows
} }
} }
} }
private void setOutputsFormCancelButton_Click(object sender, EventArgs e)
{
this.Close();
this.Dispose();
}
} }
} }
This diff is collapsed.