Exemple #1
0
        private void ReplaceImage()
        {
            string imgName      = this.brandModel.BrandId + "1" + Path.GetExtension(this.tbImage.Text);
            var    contentBytes = File.ReadAllBytes(this.tbImage.Text);
            string imgContent   = Convert.ToBase64String(contentBytes);
            var    replaceRes   = WebRequestUtil.ReplaceBrandImg(this.previousImg, imgName, imgContent);

            if (replaceRes != null)
            {
                LogUtil.Info("AddUpdateBrandFrm.ReplaceImage successfully!");
            }
            else
            {
                LogUtil.Error("AddUpdateBrandFrm.ReplaceImage failed!replaceRes is null!");
            }
        }