private void btn_deployContract_Click(object sender, EventArgs e) { if (txt_contractBytecode.TextLength < 1) { MessageBox.Show("Please enter a bytecode value!", "Enter Bytecode", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txt_contractName.TextLength < 1) { MessageBox.Show("Please enter the contract name!", "Enter Contract Name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { DialogResult dr = MessageBox.Show("Contract will be deployed. Click OK to continue.", "Confirm Contract Deployment", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (dr.Equals(DialogResult.OK)) { pt = new ProcessingTransaction(); pt.TopLevel = false; pt.TopMost = true; pt.FormClosed += ptClosed; mainAdmin.panel_main.Controls.Add(pt); this.Hide(); pt.Show(); backgroundWorker1.RunWorkerAsync(); } } }
private void btn_submit_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Click OK to confirm.", "Confirm Vote", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (dr.Equals(DialogResult.OK)) { pt = new ProcessingTransaction(); pt.FormClosed += ptClosed; this.Hide(); pt.Show(); sendVotesWorker.RunWorkerAsync(); } }
private void btn_addCandidate(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Candidate will be added to both database and the blockchain. Clik OK to proceed.", "Confirm Add Candidate", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (dr.Equals(DialogResult.OK)) { pt = new ProcessingTransaction(); pt.TopLevel = false; pt.TopMost = true; pt.FormClosed += ptClosed; mainAdmin.panel_main.Controls.Add(pt); this.Hide(); pt.Show(); addCanidateWorker.RunWorkerAsync(); } }
private void btn_setAddress_Click(object sender, EventArgs e) { if (txt_districtKey.Text.Length < 1) { MessageBox.Show("Please enter the pravate key for this district's account"); } else { DialogResult dr = MessageBox.Show("A ballot that will gather all the votes from this district will be deployed. Continue?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr.Equals(DialogResult.Yes)) { pt = new ProcessingTransaction(); pt.TopLevel = false; pt.TopMost = true; pt.FormClosed += ptClosed; mainAdmin.panel_main.Controls.Add(pt); this.Hide(); pt.Show(); deployDistrict.RunWorkerAsync(); } } }
private void btn_registerVoter_Click(object sender, EventArgs e) { if (cmb_districts.SelectedIndex < 0 || cmb_precinct.SelectedIndex < 0) { MessageBox.Show("Please input a precinct/district", "Input a district/precinct", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult dr = MessageBox.Show("Voter will be added to both database and the blockchain. Clik OK to proceed.", "Confirm Register Voter", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (dr.Equals(DialogResult.OK)) { pt = new ProcessingTransaction(); pt.TopLevel = false; pt.TopMost = true; pt.FormClosed += ptClosed; mainAdmin.panel_main.Controls.Add(pt); this.Hide(); pt.Show(); registerVoterWorker.RunWorkerAsync(); } } }