public Form1() { controllerCM = new ControllerCommitteeMembers(); controllerL = new ControllerListeners(); controllerS = new ControllerSpeakers(); InitializeComponent(); }
public void testCtr() { ControllerSpeakers ctrs = new ControllerSpeakers(); Debug.Assert(ctrs.getOneSpeaker("SaraT").Username == "SaraT"); ControllerReviews ctrr = new ControllerReviews(); Debug.Assert(ctrr.GetOne(1).Qualifier == "accept"); ControllerBiddings ctrcm = new ControllerBiddings(); Debug.Assert(ctrcm.getOneBidding("AndiP", 5).Accepted == true); ControllerListeners ctrl = new ControllerListeners(); Debug.Assert(ctrl.getOneListener("TedG").Username == "TedG"); }
private void button1_Click(object sender, EventArgs e) { string comboSel = ComboBoxParticipants.SelectedItem.ToString(); string iban = textBox5.Text; if (iban.Length != 24) { MessageBox.Show("IBAN length is wrong!", "IBAN check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!(Regex.IsMatch(iban.Substring(0, 2), @"^[A-Z]+$"))) { MessageBox.Show("First 2 letters of IBAN must be uppercase letters!", "IBAN check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!(Regex.IsMatch(iban.Substring(2, 2), @"^[0-9]+$"))) { MessageBox.Show("Letters 3 and 4 of IBAN must be numbers!", "IBAN check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!(Regex.IsMatch(iban.Substring(4, 4), @"^[A-Z]+$"))) { MessageBox.Show("Letters 5 to 8 of IBAN must be uppercase letters!", "IBAN check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!(Regex.IsMatch(iban.Substring(8, 16), @"^[A-Z0-9]+$"))) { MessageBox.Show("Letters 9 to 24 of IBAN must be uppercase letters or numbers!", "IBAN check", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (comboSel == "Listener") { ControllerListeners ctrListners = new ControllerListeners(); ctrListners.Register(new Listener(textBox3.Text, TextBoxPassword.Text, textBox1.Text, textBox2.Text, textBox4.Text)); } else if (comboSel == "Speaker") { ControllerSpeakers ctrSpeakers = new ControllerSpeakers(); ctrSpeakers.Register(new Speaker(textBox3.Text, TextBoxPassword.Text, textBox1.Text, textBox2.Text, textBox4.Text)); } MessageBox.Show("Register was successful!\nRedirecting to login..."); Form1 login = new Form1(); this.Hide(); login.Show(); }