using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Net; using System.Text; using System.Windows.Forms; namespace dccdc.Selfhelp { public partial class frm_zzjf_ym : Form { private dccdc.Models.DTO.YMJFXX _ymxx; public frm_zzjf_ym() { InitializeComponent(); } public frm_zzjf_ym(dccdc.Models.DTO.YMJFXX ym) : this() { _ymxx = ym; } private void frm_zzjf_ym_Load(object sender, EventArgs e) { label1.Text = _ymxx.xingming; label2.Text = _ymxx.zfbm; label3.Text = _ymxx.jfrq; label4.Text = "¥" + _ymxx.money; label5.Text = _ymxx.zfzt; label4.ForeColor = Color.Red; ZXing.QrCode.QRCodeWriter qw = new ZXing.QrCode.QRCodeWriter(); var m = qw.encode(_ymxx.zfurl, ZXing.BarcodeFormat.QR_CODE, 216, 216); ZXing.BarcodeWriter br = new ZXing.BarcodeWriter(); Bitmap bm = br.Write(m); pb_wx.Image = bm; //ZXing.QrCode.QRCodeWriter qw = new ZXing.QrCode.QRCodeWriter(); var m1 = qw.encode(_ymxx.zfurl_alipay, ZXing.BarcodeFormat.QR_CODE, 216, 216); ZXing.BarcodeWriter br1 = new ZXing.BarcodeWriter(); Bitmap bm1 = br1.Write(m1); pb_zfb.Image = bm1; } private void frm_zzjf_ym_MouseClick(object sender, MouseEventArgs e) { Rectangle rect = new Rectangle(30, 30, 170, 56); if (rect.Contains(e.Location)) { this.Close(); } } private void frm_zzjf_ym_MouseMove(object sender, MouseEventArgs e) { Rectangle rect = new Rectangle(30, 30, 170, 56); if (rect.Contains(e.Location)) { Cursor = Cursors.Hand; } else { Cursor = Cursors.Default; } } int t1 = 60; private void timer1_Tick(object sender, EventArgs e) { t1--; label6.Text = t1.ToString("00"); if (t1 == 0) { this.Close(); } } private void timer2_Tick(object sender, EventArgs e) { timer2.Enabled = false; WebClient wc = new WebClient(); wc.Encoding = Encoding.UTF8; string jsonData = wc.DownloadString(extend.URL + "zzj/getzfstate?id=" + _ymxx.id); Models.OperationResult or = Newtonsoft.Json.JsonConvert.DeserializeObject(jsonData); if (or.State == 1) { Status s = new Status("支付成功!"); s.ShowDialog(); s.Close(); this.Close(); } else { timer2.Enabled = true; } } } }