From 84616e6d524a7df88ebcca4b74aca42461f34605 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 19 六月 2020 20:25:09 +0800 Subject: [PATCH] '商品信息完善' --- WindowsFormsApp1/CardPwd.cs | 82 +++++++++++++++++++++++++++++++++++++++-- 1 files changed, 78 insertions(+), 4 deletions(-) diff --git a/WindowsFormsApp1/CardPwd.cs b/WindowsFormsApp1/CardPwd.cs index 667b33d..7199c1b 100644 --- a/WindowsFormsApp1/CardPwd.cs +++ b/WindowsFormsApp1/CardPwd.cs @@ -1,4 +1,6 @@ -锘縰sing System; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -7,24 +9,96 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using WindowsFormsApp1.entity; +using WindowsFormsApp1.utils; namespace WindowsFormsApp1 { public partial class CardPwd : Form { - public CardPwd() + public CardPwd(DateTime expire) { InitializeComponent(); + Init(expire); } - private void label4_Click(object sender, EventArgs e) - { + private void Init(DateTime expire) { + this.label29.Visible = false; + if (expire == null||TimeUtil.convertToTimeStamp(expire) <=0) + { + this.label5.Text = "浣犲綋鍓嶄娇鐢ㄧ殑鏄厤璐圭増-姘镐箙鍏嶈垂锛屼粎鑳芥煡鐪嬪皯閲忔暟鎹�"; + } + else { // + this.label5.Text = "鎮ㄧ殑鍏变韩鐗堝埌鏈熸椂闂翠负锛�"+ TimeUtil.GetGeneralTime(expire,"yyyy.MM.dd HH:mm"); + } + } + + private void label3_Click(object sender, EventArgs e) + { + Config config = SQLiteDataBaseUtil.getInstance().GetConfig("admin_wx_ercode"); + WXGroup pt = new WXGroup("绠$悊鍛樺井淇�", config != null ? config.Value : ""); + WindowsFormsApp1.utils.ui.FormUtil.ShowDialog(pt); + } + + //浠锋牸 + private void price_Click(object sender, EventArgs e) + { + Config config = SQLiteDataBaseUtil.getInstance().GetConfig("price_introduction"); + String target = config == null ? "" : config.Value; + try + { + System.Diagnostics.Process.Start(target); + } + catch (System.ComponentModel.Win32Exception noBrowser) + { + if (noBrowser.ErrorCode == -2147467259) + MessageBox.Show(noBrowser.Message); + } } private void textBox1_TextChanged(object sender, EventArgs e) { } + + + private void onSuccess(String result) { + + this.BeginInvoke(new OnSuccess((String result1) => + { + JObject obj = JObject.Parse(result); + if (Convert.ToInt32(obj["code"]) == 0) + { + UserInfo user = JsonConvert.DeserializeObject<UserInfo>(obj["data"].ToString()); + Init(user.SdljShareExpireTime); + MessageBox.Show("缁垂鎴愬姛"); + } + else + { + this.label29.Text = obj["msg"].ToString(); + this.label29.Visible = true; + } + }), result); + + + + + + } + + //楠岃瘉鍗″瘑 + private void button2_Click(object sender, EventArgs e) + { + if (StringUtil.isEmpty(this.textBox1.Text) || StringUtil.isEmpty(this.textBox2.Text)) { + MessageBox.Show("璇疯緭鍏ュ崱鍙峰拰瀵嗙爜"); + return; + } + + String card = this.textBox1.Text; + String pwd = this.textBox2.Text; + + ApiUtil.RenewShare(card, pwd, new OnSuccess(onSuccess)); + } } } -- Gitblit v1.8.0