private void deleteBtn_Click(object sender, RoutedEventArgs e) { UserMaster usrMasterRef = new UserMaster(); UserMasterDAO usrMasterDAORef = new UserMasterDAOImpl(); DataRowView row = (DataRowView)dataGridUser.SelectedItems[0]; usrMasterRef.userid = Convert.ToInt32(row["user Id"]); usrMasterDAORef.deleteUser(usrMasterRef); }
private void deleteBtn_Click(object sender, EventArgs e) { UserMaster usermasterRef = new UserMaster(); int rowIndex = dataGridVieweditUsr.CurrentCell.RowIndex; var row = dataGridVieweditUsr.Rows[rowIndex]; var changedValue = (string)row.Cells[rowIndex].Value; Console.WriteLine("$$$$$$$$$$$$$$$$$ values:{0}", (string)row.Cells[rowIndex].Value); usermasterRef.userid = Convert.ToInt32(row.Cells["user Id"].Value); UserMasterDao userMasterDaoRef = new UserMasterDAOImpl(); userMasterDaoRef.deleteUser(usermasterRef); dataGridVieweditUsr.Update(); dataGridVieweditUsr.Refresh(); }