private void btnFAVDelete_Click(object sender, RoutedEventArgs e) { // Aktuellen Eintrag entfernen if (FavGrid.GetFocusedRowCellValue("gcmscrmid") != null) { String _mscrmid = FavGrid.GetFocusedRowCellValue("gcmscrmid").ToString().Trim(); String _entitytype = FavGrid.GetFocusedRowCellValue("gctype").ToString().Trim(); DataRow _dr = null; if ((_dr = GetCacheItemByMSCRMID("FAVORITE_" + UserName, _mscrmid)) != null) { TimeEntryCache.Rows.Remove(_dr); TimeEntryCache.AcceptChanges(); FillDataGrid(); } } }
private void btnFAVAccept_Click(object sender, RoutedEventArgs e) { try { String _desc = FavGrid.GetFocusedRowCellValue("gcdescription").ToString().Trim(); String _entitytype = FavGrid.GetFocusedRowCellValue("gctype").ToString().Trim(); if (_desc != "" && _entitytype != "") { Selected_EntityType = _entitytype; Selected_ID = _desc; this.Close(); } } catch (Exception ex) { MessageBox.Show("btnFAVAccept_Click: " + ex.Message, rm.GetString("ErrorNotification"), MessageBoxButton.OK, MessageBoxImage.Error); } }