Skip to content

Commit 59ee9d5

Browse files
asmeyasmey
authored andcommitted
Add project files.
1 parent 9a073fd commit 59ee9d5

17 files changed

Lines changed: 1779 additions & 0 deletions

FindMissingRows.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FindMissingRows", "FindMissingRows\FindMissingRows.csproj", "{82ED6051-4F2F-43A1-8048-73BB32D89D1A}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{82ED6051-4F2F-43A1-8048-73BB32D89D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{82ED6051-4F2F-43A1-8048-73BB32D89D1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{82ED6051-4F2F-43A1-8048-73BB32D89D1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{82ED6051-4F2F-43A1-8048-73BB32D89D1A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

FindMissingRows/App.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<configSections>
4+
</configSections>
5+
<startup>
6+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
7+
</startup>
8+
</configuration>

FindMissingRows/FilterDialog.Designer.cs

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FindMissingRows/FilterDialog.cs

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows.Forms;
10+
11+
namespace FindMissingRows
12+
{
13+
public partial class FilterDialog : Form
14+
{
15+
public string FilterString { get; set; }
16+
public Form1 MainForm { private get; set; }
17+
18+
public FilterDialog(object [] columnNames)
19+
{
20+
InitializeComponent();
21+
22+
filterColumn.Items.AddRange(columnNames);
23+
24+
filterTypeCb.Items.AddRange(new string [] {"Equals", "Begins", "Ends" });
25+
filterTypeCb.SelectedIndex = filterTypeCb.Items.IndexOf("Equals");
26+
}
27+
28+
private void apply_Click(object sender, EventArgs e)
29+
{
30+
MainForm.Filter(FilterString);
31+
}
32+
33+
private void cancel_Click(object sender, EventArgs e)
34+
{
35+
Close();
36+
}
37+
38+
private void filterColumn_SelectedIndexChanged(object sender, EventArgs e)
39+
{
40+
if (filterColumn.SelectedItem != null)
41+
columnNameBox.Text = filterColumn.SelectedItem.ToString();
42+
else
43+
columnNameBox.Text = string.Empty;
44+
UpdateFilter();
45+
}
46+
47+
private void UpdateFilter()
48+
{
49+
if (string.IsNullOrWhiteSpace(columnNameBox.Text) && string.IsNullOrWhiteSpace(filterTextBox.Text))
50+
{
51+
FilterString = string.Empty;
52+
}
53+
else
54+
{
55+
switch (filterTypeCb.Text)
56+
{
57+
case "Equals":
58+
FilterString = string.Format("[{0}] = '{1}'", columnNameBox.Text, filterTextBox.Text);
59+
break;
60+
case "Begins":
61+
FilterString = string.Format("[{0}] LIKE '{1}*'", columnNameBox.Text, filterTextBox.Text);
62+
break;
63+
case "Ends":
64+
FilterString = string.Format("[{0}] LIKE '*{1}'", columnNameBox.Text, filterTextBox.Text);
65+
break;
66+
default:
67+
return;
68+
} // end switch
69+
} // end else
70+
71+
// No column name in the filter creates an exception so clear the filter string
72+
if (string.IsNullOrEmpty(columnNameBox.Text))
73+
FilterString = string.Empty;
74+
filterExpressionBox.Text = FilterString;
75+
}
76+
77+
private void filterText_TextChanged(object sender, EventArgs e)
78+
{
79+
UpdateFilter();
80+
}
81+
82+
private void clearButton_Click(object sender, EventArgs e)
83+
{
84+
filterColumn.SelectedItem = null;
85+
filterTextBox.Text = string.Empty;
86+
UpdateFilter();
87+
MainForm.Filter(FilterString);
88+
}
89+
90+
private void filterTypeCb_SelectedIndexChanged(object sender, EventArgs e)
91+
{
92+
UpdateFilter();
93+
}
94+
}
95+
}

0 commit comments

Comments
 (0)