コード例 #1
0
        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");
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 /// <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();
 }
コード例 #4
0
 private void button6_Click(object sender, EventArgs e)
 {
     currentDisasterType = disasterType.Tornado;
     parent.nextForm();
 }
コード例 #5
0
 private void sendTestAlertBtn_Click(object sender, EventArgs e)
 {
     realAlert = false;
     parent.nextForm();
 }