/// <summary> /// Handles the Click event of the DeleteFile control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.ImageClickEventArgs"/> instance containing the event data.</param> protected void DeleteFile_Click(object sender, EventArgs e) { if ((txtSelRowIndx.Value != String.Empty) && (txtDeleteConfirmed.Value.Equals("T"))) { string aID = grdAttachments.DataKeys[Convert.ToInt32(txtSelRowIndx.Value) - 2].Value.ToString(); IAttachment attachment = EntityFactory.GetById <IAttachment>(aID); if (attachment != null) { attachment.Delete(); txtSelRowIndx.Value = String.Empty; txtDeleteConfirmed.Value = "F"; DeletePhysicalFile(attachment); LoadAttachments(); hideAdds(); } } else { log.Warn(GetLocalResourceObject("Error_UnableToLoad_lz").ToString()); } }