public void DeleteMainRow() { var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { if (SelectedMainRow.Iserial != 0) { if (AllowDelete != true) { MessageBox.Show(strings.AllowDeleteMsg); return; } Loading = true; Glclient.DeleteTblAssetGroupAsync( (TblAssetGroup) new TblAssetGroup().InjectFrom(SelectedMainRow), 0, LoggedUserInfo.DatabasEname); } else { SelectedMainRow = new TblAssetGroupViewModel(); } } }