/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void dgvPersonGroups_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (DataGridViews.ValidateRowSelected(ref sender, e)) { //TODO: Create Process to handle buttons within grid view. //if (e.RowIndex < 0 || e.ColumnIndex != dgvFaceAPIFaceLists.Columns[dgvFaceAPIFaceLists.Columns.Count - 1].Index) return; if (e.RowIndex < 0) { return; } if (e.ColumnIndex == dgvPersonGroups?.Columns[dgvbtnDeletePersonGroup.Name]?.Index) { int?PersonGroupIdColumnIndex = dgvPersonGroups?.Columns[personGroupIdDataGridViewTextBoxColumn.Name]?.Index; if (PersonGroupIdColumnIndex.HasValue) { string strPersonGroupID = (string)dgvPersonGroups[PersonGroupIdColumnIndex.Value, e.RowIndex].Value; var status = await Facial_Recognition_Library.Data.fnc.PersonGroup.DeletePersonGroup(strPersonGroupID); if (status.CompletedAPIOperation && status.CompletedDatabaseOperation) { await LoadDatabasePersonGroups(); await LoadAPIPersonGroup(); } else { MessageBox.Show(status.ReasonForFailure); } } } else { System.Diagnostics.Debug.WriteLine($@"No Row Selected."); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void dgvImagesInDb_CellClick(object sender, DataGridViewCellEventArgs e) { toolStripStatusLabel1.Text = $@"Current Status: Starting Images Within Database Update."; await Task.Run(() => { if (DataGridViews.ValidateRowSelected(ref sender, e)) { //Take the Column for the event and pass the column to the processor if (e.ColumnIndex > -1) { DataGridViewColumn dgvc = ((DataGridView)sender).Columns[e.ColumnIndex]; //Facial_Recognition_Library.Controls.DataGridViews.dgvImagesInDb(ref sender, e, dgvc); var result = DataGridViews.DgvImagesInDb(ref sender, e, dgvc); if (result != null) { ProcessDataGridViewResult(result); } } } else { System.Diagnostics.Debug.WriteLine($@"No Row Selected."); } }); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void dgvFaceAPIFaceLists_CellClick(object sender, DataGridViewCellEventArgs e) { //Take the Column for the event and pass the column to the processor DataGridViewColumn dgvc = ((DataGridView)sender).Columns[e.ColumnIndex]; //Process Data Grid View await Task.Run(() => { var result = DataGridViews.DgvFaceApiFaceLists(ref sender, e, dgvc); if (result != null) { ProcessDataGridViewResult(result); } }); //this.DataGridViewsHandler.dgvFaceAPIFaceLists(ref sender, e, dgvc); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void dgvFaceListInDB_CellClick(object sender, DataGridViewCellEventArgs e) { //Take the Column for the event and pass the column to the processor DataGridViewColumn dgvc = ((DataGridView)sender).Columns[e.ColumnIndex]; toolStripStatusLabel1.Text = $@"Current Status: Starting Face Data Update."; await Task.Run(() => { //Process Data Grid View var result = DataGridViews.DgvFaceApiFaceLists(ref sender, e, dgvc); if (result != null) { ProcessDataGridViewResult(result); } }); }