protected void ProcessorLogoImage_UploadSubmit_Click(object sender, EventArgs e) { var fileName = HashingManager.GenerateMD5(DateTime.Now + "paymentLogoImg"); const string filePath = "~/Images/RepPaymentsLogos/"; ErrorMessagePanel.Visible = false; try { if (!Page.IsValid) { return; } Banner logoImage; var inputStream = ProcessorLogoImage_Upload.PostedFile.InputStream; if (!Banner.TryFromStream(inputStream, out logoImage) || logoImage.Width > ImagesHelper.RepresentativesPaymentsLogo.LogoImageMaxWidth || logoImage.Height > ImagesHelper.RepresentativesPaymentsLogo.LogoImageMaxHeight) { throw new MsgException(string.Format(U6003.INVALIDIMAGEORDIMENSION, ImagesHelper.RepresentativesPaymentsLogo.LogoImageMaxWidth, ImagesHelper.RepresentativesPaymentsLogo.LogoImageMaxHeight)); } logoImage.Save(filePath, fileName); ProcessorLogoImage.ImageUrl = Banner.GetTemporaryBannerPath(logoImage); ProcessorLogoImage.DescriptionUrl = logoImage.Path; ProcessorLogoImage.Dispose(); } catch (Exception ex) { ErrorMessagePanel.Visible = true; ErrorMessage.Text = ex.Message; } }
public void ClearFields() { WithdrawalInfo = string.Empty; DepositInfo = string.Empty; LogoImagePath = string.Empty; ProcessorName = string.Empty; ProcessorLogoImage_Upload.Dispose(); ProcessorLogoImage.ImageUrl = string.Empty; ProcessorLogoImage.DescriptionUrl = string.Empty; ProcessorLogoImage.Dispose(); }