private void DeleteFile_Click(object sender, RoutedEventArgs e) { if (UserData.CurrentUser.ManagingPaymentDraft == false) { return; } if (CurrentContract.PermanentRecord == true) { ErrorHandler.NotifyUser("سند به ثبت نهایی رسیده است"); return; } if (!UserData.CurrentAccessRight.ContractDelete) { ErrorHandler.ShowErrorMessage(Errors.OperationNotAllowed); return; } var o = Grid1.SelectedItem as ContractFilesGridItem; FilingManager.DeleteContractFile(CurrentContract.Contractid, (ContractIndex)o.DocumentIndex, o.FileId, this.layoutRoot); UpdateGridList(); }