admin
2020-06-19 84616e6d524a7df88ebcca4b74aca42461f34605
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
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(DateTime expire)
        {
            InitializeComponent();
            Init(expire);
        }
 
        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));
        }
    }
}