Exemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the lbSaveImage control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void lbSaveImage_Click(object sender, EventArgs e)
        {
            var rockContext = new RockContext();
            var service     = new FinancialTransactionImageService(rockContext);
            var financialTransactionImage = new FinancialTransactionImage();
            var transactionId             = hfIdTransValue.ValueAsInt();

            financialTransactionImage.BinaryFileId  = imgupTransactionImages.BinaryFileId.Value;
            financialTransactionImage.TransactionId = transactionId;
            financialTransactionImage.TransactionImageTypeValueId = ddlTransactionImageType.SelectedValueAsInt();
            service.Add(financialTransactionImage);
            rockContext.SaveChanges();
            imgupTransactionImages.BinaryFileId = 0;
            LoadRelatedImages(transactionId);
        }