Esempio n. 1
0
 private void butSavePassword_Click(object sender, EventArgs e)
 {
     if (tbxOldPassword.Text == "")
     {
         message = new Custom_Message_Box("Please enter old password", "Error", "Error");
         message.ShowDialog();
     }
     else if (tbxNewPassword.Text == "")
     {
         message = new Custom_Message_Box("Please enter new password", "Error", "Error");
         message.ShowDialog();
     }
     else if (tbxOldPassword.Text != Properties.Settings.Default.Password)
     {
         message = new Custom_Message_Box("The old password you entered is wrong", "Invalid Password", "Warning");
         message.ShowDialog();
         tbxOldPassword.Focus();
     }
     else
     {
         Properties.Settings.Default.Password = tbxNewPassword.Text;
         Properties.Settings.Default.Save();
         message = new Custom_Message_Box("Password updated", "Update Successful", "Information");
         message.ShowDialog();
         tbxOldPassword.Clear();
         tbxNewPassword.Clear();
     }
 }
Esempio n. 2
0
 private void butSaveUsername_Click(object sender, EventArgs e)
 {
     if (tbxOldUserName.Text == "")
     {
         message = new Custom_Message_Box("Please enter old user name", "Error", "Error");
         message.ShowDialog();
     }
     else if (tbxNewUserName.Text == "")
     {
         message = new Custom_Message_Box("Please enter new user name", "Error", "Error");
         message.ShowDialog();
     }
     else if (tbxOldUserName.Text != Properties.Settings.Default.UserName)
     {
         message = new Custom_Message_Box("The old user name you entered is wrong", "Invalid User Name", "Warning");
         message.ShowDialog();
         tbxOldUserName.Focus();
     }
     else
     {
         Properties.Settings.Default.UserName = tbxNewUserName.Text;
         Properties.Settings.Default.Save();
         message = new Custom_Message_Box("User name updated", "Update Successful", "Information");
         message.ShowDialog();
         tbxOldUserName.Clear();
         tbxNewUserName.Clear();
     }
 }
 private void butAdd_Click(object sender, EventArgs e)
 {
     if (butSave.ButtonText == "Add")
     {
         add();
         Custom_Message_Box message = new Custom_Message_Box("Record of new student is added", "Record Added", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Update")
     {
         update();
         Custom_Message_Box message = new Custom_Message_Box("Record of student is updated", "Record Updated", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Delete")
     {
         delete();
         Custom_Message_Box message = new Custom_Message_Box("Record of student is deleted", "Record Deleted", "Information");
         message.ShowDialog();
     }
     else
     {
         search();
     }
 }
 private void butSave_Click(object sender, EventArgs e)
 {
     if (butSave.ButtonText == "Add")
     {
         add();
         Custom_Message_Box message = new Custom_Message_Box("Result has added into the record", "Record Added", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Update")
     {
         update();
         Custom_Message_Box message = new Custom_Message_Box("Result has updated into the record", "Record Updated", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Delete")
     {
         delete();
         Custom_Message_Box message = new Custom_Message_Box("Result has deleted from the record", "Record Deleted", "Information");
         message.ShowDialog();
     }
     else
     {
         search();
     }
 }
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (butSave.ButtonText == "Add")
     {
         add();
         Custom_Message_Box message = new Custom_Message_Box("New member's record has added", "Record Added", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Update")
     {
         update();
         Custom_Message_Box message = new Custom_Message_Box("Member record has updated", "Record Updated", "Information");
         message.ShowDialog();
     }
     else if (butSave.ButtonText == "Delete")
     {
         delete();
         Custom_Message_Box message = new Custom_Message_Box("Member record has deleted", "Record Deleted", "Information");
         message.ShowDialog();
     }
     else
     {
         search();
     }
 }