private void button1_Click(object sender, EventArgs e) { userDataBase1.ReadXml("userDataBase.xml"); //[TODO] Validate Response With Login Form1 parent = (Form1)this.Parent; var l = (from DataRow dr in userDataBase1.Tables["users"].Rows where (string)dr["username"] == usernameTxtBox.Text && (string)dr["password"] == passwordTxtBox.Text select(Int64) dr["userID"]); if (l.ToArray <Int64>().Length > 0) //Success { currentUserID = l.ToArray <Int64>()[0]; logLogin(currentUserID); parent.nextForm(); } else //Fail { //Ideally Remove for security in real application DataRow newUser = userDataBase1.Tables["users"].NewRow(); newUser["username"] = usernameTxtBox.Text; newUser["password"] = passwordTxtBox.Text; newUser["userID"] = (Int64)(new Random().NextDouble()); userDataBase1.Tables["users"].Rows.Add(newUser); logRegister(currentUserID); logLogin(currentUserID); parent.nextForm(); } userDataBase1.WriteXml("userDataBase.xml"); }
private void nextButton_Click(object sender, EventArgs e) { islandsToContact = new List <String>(); if (hawaiiCheckBox.Checked) { islandsToContact.Add("Hawaii"); } if (mauiCheckBox.Checked) { islandsToContact.Add("Maui"); } if (molokaiCheckBox.Checked) { islandsToContact.Add("Molokai"); } if (kahoolaweCheckBox.Checked) { islandsToContact.Add("Kahoolawe"); } if (oahuCheckBox.Checked) { islandsToContact.Add("Oahu"); } if (lanaiCheckBox.Checked) { islandsToContact.Add("Oahu"); } if (kauaiCheckBox.Checked) { islandsToContact.Add("kauai"); } parent.contentSummary1.UpdateResultsScreen(); parent.nextForm(); }
/// <summary> /// Next button, will move to the next page and set the booleans based on checkboxes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void nextButton_Click(object sender, EventArgs e) { email = emailCheckBox.Checked; siren = sirenCheckBox.Checked; text = textCheckBox.Checked; television = televisionCheckBox.Checked; parent.nextForm(); }
private void button6_Click(object sender, EventArgs e) { currentDisasterType = disasterType.Tornado; parent.nextForm(); }
private void sendTestAlertBtn_Click(object sender, EventArgs e) { realAlert = false; parent.nextForm(); }