MyfrmStation.cs
1.71 KB
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MyClassLib;
namespace MyControlLib
{
public partial class MyfrmMessage : Form
{
public MyfrmMessage()
{
InitializeComponent();
}
private string stationcode = "";
private string strProduct = "";
public Timer tm;
public int SpInterval = 4000;
public MyfrmMessage(string stationCode,int product,Point p1)
{
InitializeComponent();
stationcode = stationCode;
strProduct = product.ToString();
StationInit();
tm = new Timer();
tm.Tick += new EventHandler(tm_Tick);
tm.Interval = SpInterval;
tm.Start();
//this.Location =p1;
//textBox7.Text = string.Format("X:{0}+Y:{1}", this.Location.X, this.Location.Y);
}
void tm_Tick(object sender, EventArgs e)
{
this.Close();
}
private void StationInit()
{
DataSet ds = CSqlHelper.ExecuteDataset(string.Format("select * from T_StationInfo where stationCode='{0}'",stationcode));
if (ds.Tables[0].Rows.Count >= 1)
{
textBox1.Text = stationcode;
textBox2.Text = ds.Tables[0].Rows[0]["stationName"].ToString();
textBox4.Text = strProduct;
textBox8.Text = ds.Tables[0].Rows[0]["lineName"].ToString();
}
}
private void MyfrmMessage_Leave(object sender, EventArgs e)
{
this.Close();
}
}
}