wzp
2021-07-28 1cd1fbd9b88e3a4c0a9f6b76947c7523c1fa2979
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
namespace AsiaINFO.SMS.APPCMPP2
{
    using AsiaINFO.SMS.CMPP2;
    using AsiaINFO.SMS.Entity;
    using MyControls;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
 
    public class SmsForm : Form
    {
        private SyncEvents _submitEvents;
        private Queue<SubmitInfo> _submitQueue;
        private IContainer components;
        private GroupBox DebugBox;
        private Label label1;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private TextBoxExNumOnly LONG_SERV_NO;
        private TextBoxExNumOnly MOBILE_NO;
        private Button SendSms;
        private TextBox SERVCODE;
        private TextBox SMS_CONTENT;
        private TextBox WAPURL;
 
        public SmsForm(Queue<SubmitInfo> submitQueue, SyncEvents submitEvents)
        {
            if ((submitQueue == null) || (submitEvents == null))
            {
                throw new Exception("SmsForm参数不能为空");
            }
            this.InitializeComponent();
            this._submitQueue = submitQueue;
            this._submitEvents = submitEvents;
        }
 
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }
 
        private void InitializeComponent()
        {
            this.DebugBox = new GroupBox();
            this.WAPURL = new TextBox();
            this.label4 = new Label();
            this.LONG_SERV_NO = new TextBoxExNumOnly();
            this.MOBILE_NO = new TextBoxExNumOnly();
            this.SMS_CONTENT = new TextBox();
            this.label3 = new Label();
            this.SendSms = new Button();
            this.label2 = new Label();
            this.label1 = new Label();
            this.label5 = new Label();
            this.SERVCODE = new TextBox();
            this.DebugBox.SuspendLayout();
            base.SuspendLayout();
            this.DebugBox.Controls.Add(this.SERVCODE);
            this.DebugBox.Controls.Add(this.label5);
            this.DebugBox.Controls.Add(this.WAPURL);
            this.DebugBox.Controls.Add(this.label4);
            this.DebugBox.Controls.Add(this.LONG_SERV_NO);
            this.DebugBox.Controls.Add(this.MOBILE_NO);
            this.DebugBox.Controls.Add(this.SMS_CONTENT);
            this.DebugBox.Controls.Add(this.label3);
            this.DebugBox.Controls.Add(this.SendSms);
            this.DebugBox.Controls.Add(this.label2);
            this.DebugBox.Controls.Add(this.label1);
            this.DebugBox.Location = new Point(12, 12);
            this.DebugBox.Name = "DebugBox";
            this.DebugBox.Size = new Size(0x16f, 220);
            this.DebugBox.TabIndex = 0x21;
            this.DebugBox.TabStop = false;
            this.WAPURL.Location = new Point(0x41, 0x7a);
            this.WAPURL.Multiline = true;
            this.WAPURL.Name = "WAPURL";
            this.WAPURL.Size = new Size(0x120, 0x25);
            this.WAPURL.TabIndex = 40;
            this.label4.AutoSize = true;
            this.label4.Location = new Point(6, 0x7d);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x29, 12);
            this.label4.TabIndex = 0x27;
            this.label4.Text = "WAPURL";
            this.LONG_SERV_NO.Location = new Point(0xf1, 0x1a);
            this.LONG_SERV_NO.Name = "LONG_SERV_NO";
            this.LONG_SERV_NO.Size = new Size(100, 0x15);
            this.LONG_SERV_NO.TabIndex = 0;
            this.MOBILE_NO.Location = new Point(0x41, 0x1a);
            this.MOBILE_NO.Name = "MOBILE_NO";
            this.MOBILE_NO.Size = new Size(100, 0x15);
            this.MOBILE_NO.TabIndex = 0x22;
            this.SMS_CONTENT.Location = new Point(0x41, 0x40);
            this.SMS_CONTENT.Multiline = true;
            this.SMS_CONTENT.Name = "SMS_CONTENT";
            this.SMS_CONTENT.Size = new Size(0x120, 0x34);
            this.SMS_CONTENT.TabIndex = 2;
            this.SMS_CONTENT.Text = "测试test";
            this.label3.AutoSize = true;
            this.label3.Location = new Point(6, 0x40);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x1d, 12);
            this.label3.TabIndex = 0x24;
            this.label3.Text = "内容";
            this.SendSms.AutoSize = true;
            this.SendSms.Location = new Point(290, 0xab);
            this.SendSms.Name = "SendSms";
            this.SendSms.Size = new Size(0x3f, 0x17);
            this.SendSms.TabIndex = 3;
            this.SendSms.Text = "发送短信";
            this.SendSms.UseVisualStyleBackColor = true;
            this.SendSms.Click += new EventHandler(this.SendSms_Click);
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0xc2, 0x1d);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x29, 12);
            this.label2.TabIndex = 0x22;
            this.label2.Text = "长号码";
            this.label1.AutoSize = true;
            this.label1.Location = new Point(6, 0x1d);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x35, 12);
            this.label1.TabIndex = 0x20;
            this.label1.Text = "手机号码";
            this.label5.AutoSize = true;
            this.label5.Location = new Point(6, 0xb0);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x35, 12);
            this.label5.TabIndex = 0x29;
            this.label5.Text = "业务代码";
            this.SERVCODE.Location = new Point(0x41, 0xab);
            this.SERVCODE.Name = "SERVCODE";
            this.SERVCODE.Size = new Size(100, 0x15);
            this.SERVCODE.TabIndex = 0x2a;
            this.SERVCODE.Text = "HELP";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            //base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x189, 0xf4);
            base.Controls.Add(this.DebugBox);
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "SmsForm";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "测试";
            this.DebugBox.ResumeLayout(false);
            this.DebugBox.PerformLayout();
            base.ResumeLayout(false);
        }
 
        private void SendSms_Click(object sender, EventArgs e)
        {
            try
            {
                if (((this.MOBILE_NO.Text.Length <= 0) || (this.SMS_CONTENT.Text.Length <= 0)) || (this.LONG_SERV_NO.Text.Length <= 0))
                {
                    MessageBox.Show("参数不能为空");
                }
                else
                {
                    MTWaitInfo mtwait = new MTWaitInfo("0", this.LONG_SERV_NO.Text, this.SERVCODE.Text, this.MOBILE_NO.Text, 1, "01", "0", this.SMS_CONTENT.Text, "", this.WAPURL.Text, 1, 1);
 
                    SubmitInfo info2 = new SubmitInfo(mtwait, ShareData.SeqID, 1);
                    this._submitData = info2;
                    this._submitEvents.NewItemEvent.Set();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("错误:" + exception.Message);
            }
        }
 
        private int _submitCount
        {
            get
            {
                lock (((ICollection) this._submitQueue).SyncRoot)
                {
                    return this._submitQueue.Count;
                }
            }
        }
 
        private SubmitInfo _submitData
        {
            get
            {
                lock (((ICollection) this._submitQueue).SyncRoot)
                {
                    if (this._submitQueue.Count > 0)
                    {
                        return this._submitQueue.Dequeue();
                    }
                }
                return null;
            }
            set
            {
                lock (((ICollection) this._submitQueue).SyncRoot)
                {
                    this._submitQueue.Enqueue(value);
                }
            }
        }
    }
}