예제 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("YES or No?", "Are you sure you want to update the current existing information  ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
     {
         if (!string.IsNullOrEmpty(newTxt.Text) && !string.IsNullOrEmpty(previousTxt.Text))
         {
             string SQL = "UPDATE " + itemCbx.Text + " SET " + fieldTxt.Text + " = '" + newTxt.Text + "' WHERE " + fieldTxt.Text + " = '" + previousTxt.Text + "'";
             DBConnect.Execute(SQL);
             MessageBox.Show("Information updated ");
         }
     }
 }
예제 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (pass2Txt.Text != passTxt.Text)
            {
                MessageBox.Show("Passwords do not match");
                passTxt.BackColor = Color.Red;
                return;
            }
            if (UserID != Helper.UserID)
            {
                MessageBox.Show("You cannot reset the users password it seems its not your profile !");
                return;
            }

            string SQL = "UPDATE users SET passwords = '" + Helper.MD5Hash(pass2Txt.Text) + "' WHERE id = '" + UserID + "'";

            DBConnect.Execute(SQL);

            MessageBox.Show("information updated password will take effect on the next log in !");
        }