Пример #1
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            decimal attachmentId;
            string  id = Request.QueryString["id"];

            if (decimal.TryParse(id, out attachmentId))
            {
                try
                {
                    string filePath = FileService.Upload(fileAttachment, "RefundApplyformView", "(jpg)|(bmp)|(png)", 600 * 1024);
                    List <ApplyAttachmentView> list = new List <ApplyAttachmentView>();
                    var       bytes     = ChinaPay.B3B.Service.FileService.GetFileBytes(filePath);
                    Thumbnail thumbnail = new Thumbnail();
                    list.Add(new ApplyAttachmentView
                    {
                        Id          = Guid.NewGuid(),
                        ApplyformId = attachmentId,
                        FilePath    = filePath,
                        Thumbnail   = thumbnail.MakeThumb(100, bytes),
                        Time        = DateTime.Now
                    });
                    ApplyformQueryService.AddApplyAttachmentView(list, CurrentUser.UserName);
                    bindAttachment(attachmentId);
                    ShowMessage("上传成功");
                }
                catch (Exception ex)
                {
                    ShowExceptionMessage(ex, "上传");
                }
            }
        }
Пример #2
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            decimal attachmentId;
            string  id = Request.QueryString["AttachmentId"];

            if (decimal.TryParse(id, out attachmentId))
            {
                try
                {
                    string filePath = FileService.Upload(fileAttachment, "RefundApplyformView");
                    List <ApplyAttachmentView> list = new List <ApplyAttachmentView>();
                    var       bytes     = ChinaPay.B3B.Service.FileService.GetFileBytes(filePath);
                    Thumbnail thumbnail = new Thumbnail();
                    list.Add(new ApplyAttachmentView
                    {
                        Id          = Guid.NewGuid(),
                        ApplyformId = attachmentId,
                        FilePath    = filePath,
                        Thumbnail   = thumbnail.MakeThumb(100, bytes),
                        Time        = DateTime.Now
                    });
                    ApplyformQueryService.AddApplyAttachmentView(list, CurrentUser.UserName);
                    Response.Redirect("ProcessRefund.aspx?id=" + id);
                }
                catch (Exception ex)
                {
                    BasePage.ShowExceptionMessage(this, ex, "上传");
                }
            }
        }