private void OKButton_Click(object sender, RoutedEventArgs e) { SQLQuery mSqlQuery = new SQLQuery(); if (checkSalary() && roomID.SelectedIndex > -1) { int numOFRoom = int.Parse(roomID.Text.ToString()); mSqlQuery.updateRoomData(new Room(getRoomID[numOFRoom], numOFRoom, Int64.Parse(ID.Text))); mSqlQuery.updateStaffData(GlobalVariables.globalStaff); } else { MessageBox.Show("Please Enter the Room number", "Invaild Data", MessageBoxButton.OK, MessageBoxImage.Error); } }
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); } }
private void acceptButton_Click(object sender, RoutedEventArgs e) { //set pending to 0 ---> accepted SQLQuery mSQLQuery = new SQLQuery(); if (idx == 0) { mChild.pending = 0; mSQLQuery.updateChildData(mChild); } else if (idx == 1) { mParent.pending = 0; mSQLQuery.updateParentData(mParent); } else if (idx == 2) { mStaff.pending = 0; mSQLQuery.updateStaffData(mStaff); } removeFromParent(); }