Exemplo n.º 1
0
        protected void ctlRemove_OnClick(object sender, ImageClickEventArgs e)
        {
            #region Old Code Comment By AO 5-Mar-2009
            //IList<DocumentAttachment> documentAttachmentList = new List<DocumentAttachment>();
            //foreach (GridViewRow row in ctlAttachmentGrid.Rows)
            //{
            //    if ((row.RowType == DataControlRowType.DataRow) && (((CheckBox)row.FindControl("ctlSelect")).Checked))
            //    {
            //        long attachmentID = UIHelper.ParseLong(ctlAttachmentGrid.DataKeys[row.RowIndex].Values["AttachmentID"].ToString());

            //        // Remove from transaction service.
            //    }
            //}
            #endregion

            foreach (GridViewRow row in ctlAttachmentGrid.Rows)
            {
                if ((row.RowType == DataControlRowType.DataRow) && (((CheckBox)row.FindControl("ctlSelect")).Checked))
                {
                    long attachmentID = UIHelper.ParseLong(ctlAttachmentGrid.DataKeys[row.RowIndex].Values["AttachmentID"].ToString());

                    // Remove from transaction.
                    DocumentAttachment documentAttachment = new DocumentAttachment(attachmentID);
                    DocumentAttachmentService.DeleteAttachmentFromTransaction(this.TransactionID, documentAttachment);
                }
            }

            this.BindControl();
            ctlUpdateAttachmentGrid.Update();
        }
Exemplo n.º 2
0
        public bool RequireDocumentAttachment()
        {
            try
            {
                DocumentAttachmentService.ValidateDocumentAttachment(this.TransactionID, CADocumentID);
            }
            catch (ServiceValidationException ex)
            {
                ShowWarningRequireAttachmentPopup(GetMessage("CAattachmentIsRequired"));
                return(true);
            }

            return(false);
        }