private async void BtnUpdateData_Click(object sender, RoutedEventArgs e) { Competency sComp = App.tempComp; string studentID = Student.UserID; string qualID = sQual.QualCode; string compID = sComp.TafeCode; string status; if (comboStatus.SelectedIndex != -1) { status = ((ComboBoxItem)comboStatus.SelectedItem).Content.ToString(); } else { status = sComp.CompletionStatus; } string comment = txbComment.Text; if (sComp.UpdateToDB(studentID, qualID, compID, status, comment)) { var message = new MessageDialog("Update successful."); await message.ShowAsync(); } else { var message = new MessageDialog("Update failed. Please contact admin staff"); await message.ShowAsync(); } }