-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
129 lines (111 loc) · 3.98 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ConnectToCEMSDatabase
{
public partial class FormConnectToCEMSDatabase : Form
{
private string p;
public FormConnectToCEMSDatabase()
{
InitializeComponent();
}
public FormConnectToCEMSDatabase(string p)
{
// TODO: Complete member initialization
this.p = p;
}
#region ClickEvents
private void mnuUpdateElectionInfo_Click(object sender, EventArgs e)
{
try
{
this.report_ElectionCardTableAdapter.Fill(this.electionCardDataSet.Report_ElectionCard, new System.Nullable<int>(((int)(System.Convert.ChangeType(txtElectionID.Text, typeof(int))))));
}
catch (System.Exception ex)
{
if (txtElectionID.Text == null || txtElectionID.Text == "" )
{
MessageBox.Show("You must enter an ElectionID e.g. 118");
}
else
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
}
private void mnuFileScanEquipmentiVotronic_Click(object sender, EventArgs e)
{
DialogResult iResult = MessageBox.Show("Are you Ready to scan iVotronic?","Are You Ready",MessageBoxButtons.YesNo);
switch (iResult)
{
case DialogResult.Yes:
break;
case DialogResult.No:
MessageBox.Show("Why Not?");
break;
}
}
private void mnuFileScanEquipmentMediaBag_Click(object sender, EventArgs e)
{
DialogResult dResult = MessageBox.Show("Are you Ready to scan Media Bags?","Are you ready to Scan?",MessageBoxButtons.YesNo);
switch (dResult)
{
case DialogResult.Yes:
MediaBagScan form2 = new MediaBagScan();
form2.ShowDialog();
break;
case DialogResult.No:
MessageBox.Show("Why Not?");
break;
}
}
private void mnuFileExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void txtElectionID_TextChanged(object sender, EventArgs e)
{
if (txtElectionID.Text == null || txtElectionID.Text == "")
{
MessageBox.Show("ElectionID cannot be blank, Please enter valid ElectionID");
}
else
{
this.report_ElectionCardTableAdapter.Fill(this.electionCardDataSet.Report_ElectionCard, new System.Nullable<int>(((int)(System.Convert.ChangeType(txtElectionID.Text, typeof(int))))));
}
}
private void mnuFileOpen_Click(object sender, EventArgs e)
{
MessageBox.Show("Your Form is already open! \n\nPlease enter valid ElectionID");
}
#endregion ClickEvents
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void mnuFileScanEquipmentMediaBagAdd_Click(object sender, EventArgs e)
{
DialogResult dResult = MessageBox.Show("Are you Ready to Add Media Bags?", "Are you ready to Add?", MessageBoxButtons.YesNo);
switch (dResult)
{
case DialogResult.Yes:
MediaBagAdd form2 = new MediaBagAdd();
form2.ShowDialog();
break;
case DialogResult.No:
MessageBox.Show("Why Not?");
break;
}
}
internal IEnumerable<MediaBagAdd> ExecuteQuery<T1>(string p)
{
throw new NotImplementedException();
}
}
}