private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { AnalysisProgressRing.Visibility = Windows.UI.Xaml.Visibility.Visible; AnalysisProgressRing.IsActive = true; var sample = await AnalysisPageDataSoure.GetItemsAsync(); AnalysisProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed; AnalysisProgressRing.IsActive = false; AnalysisResetFields.IsEnabled = true; AnalysisExportFields.IsEnabled = true; AnalysisSearch.IsEnabled = true; gridViewSource.Source = sample; mainItemList = RecordGrid.Items.OfType <AnalysisSampleDataItem>().ToList(); resultList = mainItemList; fillAllLists(); fillAllComboBox(); this.AnalysisResetBox(); this.AnalysisResetFlag(); this.AnalysisResetDateBox(); this.disableCommandBarButtons(); this.DataContext = new TestPageViewModel(); (this.DataContext as TestPageViewModel).UpdateGraphView(); RecordGrid.SelectedItem = null; AnalysisResultsFound.Text = "\"Found " + resultList.Count() + " results.\""; }
private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { ShowProgress(); var sample = await AnalysisPageDataSoure.GetItemsAsync(); HideProgress(); gridViewSource.Source = sample; mainItemList = RecordGrid.Items.OfType <AnalysisSampleDataItem>().ToList(); RecordGrid.SelectedItem = null; }
private async void ProfileDeleteButClicked(object sender, RoutedEventArgs e) { //if (itemGridView.SelectedItems != null && this.PID > 0) if (itemGridView.SelectedItems != null) { try { string deleteQuery = "DELETE FROM MedicalDetailsVaccine WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MedicalDetailsVaccine" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MedicalDetailsMedicine WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MedicalDetailsMedicine" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MedicalDetails WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MedicalDetails" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM Address WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---Address" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MutableDetailsOperation WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MutableDetailsOperation" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MutableDetailsAddiction WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MutableDetailsAddiction" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MutableDetailsAllergy WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MutableDetailsAllergy" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM MutableDetails WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---MutableDetails" + "\n" + ex.Message + "\n" + result.ToString()); } try { statement.Reset(); string deleteQuery = "DELETE FROM Patient WHERE PID = @pid"; statement = await this.database.PrepareStatementAsync(deleteQuery); statement.BindTextParameterWithName("@pid", this.PID); await statement.StepAsync(); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); Debug.WriteLine("DETAILED_LOCATION_PAGE---PROFILE_DELETE_BUT_CLICKED---Patient" + "\n" + ex.Message + "\n" + result.ToString()); } await HomePageDataSoure.DelItemAsync(PID.ToString()); await AnalysisPageDataSoure.DelItemAsync(PID.ToString()); } }