private void Reset() { txbEmail.IsEnabled = txbPassword.IsEnabled = btnLogin.IsEnabled = true; btnStart.IsEnabled = false; btnFinish.IsEnabled = false; lvwMessages.Items.Clear(); //lblLatitude.Content = "0"; //lblLongitude.Content = "0"; lblTotalPayload.Content = "0"; lblTitle.Content = "0"; lblFuelWeight.Content = "0"; lblPressure.Content = "0"; lblWind.Content = "0"; lblTemperature.Content = "0"; lblVisibility.Content = "0"; jobListDataGrid.IsEnabled = true; jobListDataGrid.ItemsSource = null; _startJobResponseInfo = null; _finishPopUpShown = false; _startPopUpShown = false; imgStart.Visibility = Visibility.Hidden; imgFinish.Visibility = Visibility.Hidden; Disconnect(); }
private async void btnStart_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; btnStart.IsEnabled = false; btnFinish.IsEnabled = false; LoadConnect(); Thread.Sleep(500); try { if (_simVarsModel != null) { _simVarsModel.UserId = _userId; _startJobResponseInfo = await _flightJobsConnectorClientAPI.StartJob(_simVarsModel); var arrivalInfo = AirportDatabaseFile.FindAirportInfo(_startJobResponseInfo.ArrivalICAO); _startJobResponseInfo.ArrivalLAT = arrivalInfo.Latitude; _startJobResponseInfo.ArrivalLON = arrivalInfo.Longitude; AddLogMessage(_startJobResponseInfo.ResultMessage, LogMessageTypeEnum.Success); btnFinish.IsEnabled = true; jobListDataGrid.IsEnabled = false; imgStart.Visibility = Visibility.Visible; imgFinish.Visibility = Visibility.Hidden; } else { btnStart.IsEnabled = true; btnFinish.IsEnabled = false; } } catch (Exception ex) { btnStart.IsEnabled = true; btnFinish.IsEnabled = false; AddLogMessage(ex.Message, LogMessageTypeEnum.Warnning); } finally { Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow; } }
private async void btnFinish_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; btnStart.IsEnabled = false; btnFinish.IsEnabled = false; RefreshSimVars(); Thread.Sleep(500); try { if (_simVarsModel != null) { _simVarsModel.UserId = _userId; _startJobResponseInfo = await _flightJobsConnectorClientAPI.FinishJob(_simVarsModel); AddLogMessage(_startJobResponseInfo.ResultMessage, LogMessageTypeEnum.Success); await LoadJobListDataGrid(); imgStart.Visibility = Visibility.Hidden; imgFinish.Visibility = Visibility.Hidden; } else { btnStart.IsEnabled = false; btnFinish.IsEnabled = true; } } catch (Exception ex) { btnFinish.IsEnabled = true; AddLogMessage(ex.Message, LogMessageTypeEnum.Warnning); } finally { Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow; } }