private void buttonDelete_Click(object sender, EventArgs e) { try { TrainingSetDbGateWay.LocalDataTable.Rows[TrainingSetDbGateWay.RowNumber].Delete(); SqlCommandBuilder commandBuilder1 = new SqlCommandBuilder(TrainingSetDbGateWay.DataAdater); MessageBox.Show("Image Record Successfully Deleted!!"); TrainingSetDbGateWay.DataAdater.Update(TrainingSetDbGateWay.LocalDataTable); TrainingSetDbGateWay.refreshDBconnection(); TrainingSetDbGateWay.RowNumber--; pictureBox1.Image = TrainingSetDbGateWay.ReadImageFromDB(); importedFaceNametextBox.Text = TrainingSetDbGateWay.LocalDataTable.Rows[TrainingSetDbGateWay.RowNumber]["PersonName"].ToString(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void goToLastImageButton_Click(object sender, EventArgs e) { int totalRows = TrainingSetDbGateWay.LocalDataTable.Rows.Count; TrainingSetDbGateWay.refreshDBconnection(); TrainingSetDbGateWay.RowNumber = totalRows - 1; pictureBox1.Image = TrainingSetDbGateWay.ReadImageFromDB(); importedFaceNametextBox.Text = TrainingSetDbGateWay.LocalDataTable.Rows[TrainingSetDbGateWay.RowNumber]["PersonName"].ToString(); PersonNamelabel.Text = (TrainingSetDbGateWay.RowNumber + 1).ToString(); MessageBox.Show("You Have Reached The First Image In List!!!"); }
private void updateFaceNameButton_Click(object sender, EventArgs e) { try { PersonNamelabel.Text = (TrainingSetDbGateWay.RowNumber + 1).ToString(); TrainingSetDbGateWay.LocalDataTable.Rows[TrainingSetDbGateWay.RowNumber]["PersonName"] = importedFaceNametextBox.Text; SqlCommandBuilder commandBuilder2 = new SqlCommandBuilder(TrainingSetDbGateWay.DataAdater); MessageBox.Show("Successfully Updated!!!"); TrainingSetDbGateWay.DataAdater.Update(TrainingSetDbGateWay.LocalDataTable); TrainingSetDbGateWay.refreshDBconnection(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }