private void btnLogin_Click(object sender, EventArgs e) { bool valid = false; MainBranch MainBranch = new MainBranch(); //get input from text field and pass it to login validation valid = branchIDcheck(txtBranchID.Text); if (valid == true) { MainBranch.Show(); this.Hide(); } else { MessageBox.Show("Invalid branch ID - please try again"); } }
public bool branchIDcheck(string inBranchID) { bool validID = false; //Branch branch = new Branch(); MainBranch main = new MainBranch(); if (inBranchID != "") { MessageBox.Show("branches: " + main.mainArgus.Count); do { foreach (Branch b in main.mainArgus) { if (inBranchID == b.getBranchID()) validID = true; } } while (validID == false); } MessageBox.Show("valid" + Convert.ToString(validID)); return validID; }
private void BtnBack_Click(object sender, EventArgs e) { MainBranch MainBranch = new MainBranch(); MainBranch.Show(); this.Hide(); }