protected async override void OnNavigatedTo(NavigationEventArgs e) { navigationHelper.OnNavigatedTo(e); var group = await HomePageDataSoure.GetGroupAsync((String)e.Parameter); //this.DefaultViewModel["Group"] = group; //this.DefaultViewModel["Items"] = group.Items; gridViewSource.Source = group.Items; pageTitle.Text = group.Title; this.disableAppButtons(); this.InitializeDB(); this.updateListOfAllItem(); itemGridView.SelectedItem = null; }
protected override async void OnNavigatedTo(NavigationEventArgs e) { navigationHelper.OnNavigatedTo(e); RecordProgressRing.Visibility = Windows.UI.Xaml.Visibility.Visible; RecordProgressRing.IsActive = true; var sample = await HomePageDataSoure.GetLimitedGroupsAsync(); RecordProgressRing.Visibility = Windows.UI.Xaml.Visibility.Collapsed; RecordProgressRing.IsActive = false; //this.DefaultViewModel["Groups"] = sample; groupedItemsViewSource.Source = sample; RecordGrid.SelectedItem = null; this.disableAppButtons(); (SemanticZoomGrid.ZoomedOutView as ListViewBase).ItemsSource = groupedItemsViewSource.View.CollectionGroups; pageTitle.Text = await SettingsFlyout1.getOrganisationName(); }
private async void recordGridHeader(object sender, RoutedEventArgs e) { TextBlock clickedItem = ((e.OriginalSource as Button).Content as StackPanel).Children[0] as TextBlock; if (clickedItem.Text.ToString() != "") { IEnumerable <SampleDataGroup> samples = await HomePageDataSoure.GetGroupsAsync(); foreach (SampleDataGroup sample in samples) { if (sample.Title.Equals(clickedItem.Text.ToString())) { if (this.Frame != null) { this.Frame.Navigate(typeof(DetailedLocationPage), sample.UniqueId); } } } } }
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()); } }