void btnDelete_Click(object sender, RoutedEventArgs e) { string Result = ""; ObservableCollection <string> ids = new ObservableCollection <string>(); if (DtGrid.SelectedItems.Count > 0) { for (int i = 0; i < DtGrid.SelectedItems.Count; i++) { T_HR_EMPLOYEESALARYPOSTASIGN tmpEnt = DtGrid.SelectedItems[i] as T_HR_EMPLOYEESALARYPOSTASIGN; ids.Add(tmpEnt.EMPLOYEESALARYPOSTASIGNID); if (!(tmpEnt.CHECKSTATE == Convert.ToInt32(CheckStates.UnSubmit).ToString() || tmpEnt.CHECKSTATE == Convert.ToInt32(CheckStates.UnApproved).ToString())) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTDELETE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); return; } } ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { //client.EmployeeAddSumDeleteAsync(ids); client.EmployeeBalancePostDeleteAsync(ids); }; com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "DELETE")); return; } }