Beispiel #1
0
        private void editProfileButton_Click(object sender, RoutedEventArgs e)
        {
            SQLQuery mSQLQuery = new SQLQuery();

            if (checkEnteredData())
            {
                GlobalVariables.globalStaff.id        = Convert.ToInt64(ID.Text);
                GlobalVariables.globalStaff.firstName = firstName.Text;
                GlobalVariables.globalStaff.lastName  = lastName.Text;

                mSQLQuery.updateUsername(Convert.ToInt64(ID.Text), "Staff", username.Text, password.Password);

                GlobalVariables.globalStaff.email       = email.Text;
                GlobalVariables.globalStaff.phoneNumber = phoneNumber.Text;

                mSQLQuery.updateStaffData(GlobalVariables.globalStaff);
                MessageBox.Show("Data Updated sucessfuly !", "Process Finshed", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Beispiel #2
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            SQLQuery mSqlQuery = new SQLQuery();

            if (checkEnteredData(true))
            {
                GlobalVariables.globalParent.firstName   = firstName.Text;
                GlobalVariables.globalParent.lastName    = lastName.Text;
                GlobalVariables.globalParent.email       = email.Text;
                GlobalVariables.globalParent.id          = Convert.ToInt64(ID.Text);
                GlobalVariables.globalParent.phoneNumber = phoneNumber.Text;
                GlobalVariables.globalParent.address     = address.Text;

                mSqlQuery.updateParentData(GlobalVariables.globalParent);
                mSqlQuery.updateUsername(GlobalVariables.globalParent.id, "Parent", username.Text, password.Password);
                MessageBox.Show("Updated", "Successfully Updated", MessageBoxButton.OK);
            }
            else
            {
                MessageBox.Show("Check your data", "Update failed", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }