using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using UAS_MES.CustomControl.DataGrid_View; using UAS_MES.DataOperate; using UAS_MES.PublicForm; using UAS_MES.PublicMethod; namespace UAS_MES { public partial class Form1 : Form { DataHelper dh; DataTable dt; LogStringBuilder sql = new LogStringBuilder(); //经过的步骤 string PastStep = ""; //拆分后的经过的步骤 Dictionary Step; //屏幕高度 int ScreenWidth; //屏幕宽度 int ScreenHeight; public Form1() { InitializeComponent(); } [DllImport("kernel32.dll")] public static extern bool d(int freq, int duration); private void button3_Click(object sender, EventArgs e) { d(800, 600); } private void Form1_Load(object sender, EventArgs e) { DataGridViewCheckBoxColumn checkboxCol = new DataGridViewCheckBoxColumn(); checkboxCol.Name = "全选"; //创建复选框列头单元格 DataGridViewCheckBoxHeaderCell ch = new DataGridViewCheckBoxHeaderCell(TestDGV, checkboxCol); //设置复选框那列的单元格为复选框 checkboxCol.HeaderCell = ch; this.TestDGV.Columns.Add(checkboxCol); blurSearch1.TableName = "Make"; blurSearch1.Field = "ma_code"; DataHelper dh = new DataHelper(); ViewChart((DataTable)dh.ExecuteSql("select nvl(ms_nextstepcode ,'已完工')ms_nextstepcode ,count(*) from makeserial left join makecraftdetail on ms_makecode=mcd_macode and ms_nextstepcode =mcd_nextstepcode where ms_makecode='MB17050022' group by ms_nextstepcode", "select"), "TExt"); dt = (DataTable)dh.ExecuteSql("select ma_salecode,MA_STATUS from make where MA_SALECODE = 'TB17040014'", "select"); Step = new Dictionary(); for (int i = 0; i < dt.Rows.Count + 2; i++) { if (i == 0) { Step.Add(i, "开始"); } else if (i == dt.Rows.Count + 1) { Step.Add(i, "结束"); } else { Step.Add(i, dt.Rows[i - 1]["MA_STATUS"].ToString()); } } } private void ViewChart(DataTable _dt, string _title) { List xData = new List(); List yData = new List(); for (int i = 0; i < _dt.Rows.Count; i++) { xData.Add(_dt.Rows[i]["ms_nextstepcode"].ToString()); yData.Add(int.Parse(_dt.Rows[i]["count(*)"].ToString())); } ct_coll.Series[0]["PieLineColor"] = "Red";//绘制黑色的连线。 this.ct_coll.Series[0].ToolTip = "#VAL{D}件";//鼠标移动到上面显示的文字 this.ct_coll.Series[0].BackSecondaryColor = Color.DarkCyan; this.ct_coll.Series[0].BorderColor = Color.DarkOliveGreen; this.ct_coll.Series[0].LabelBackColor = Color.Transparent; ct_coll.ChartAreas[0].Area3DStyle.Enable3D = true; ct_coll.Series[0].Points.DataBindXY(xData, yData); } private void normalButton2_Click(object sender, EventArgs e) { DataHelper dh = new DataHelper(); string ErrorMessage = ""; string makecode = ""; string IMEI1 = ""; string IMEI2 = ""; string IMEI3 = ""; string IMEID = ""; string NetCode = ""; string PSN = ""; string MAC = ""; string BT = ""; string Code1 = ""; string Code2 = ""; string Code3 = ""; string ID1 = ""; string ID2 = ""; string ID3 = ""; LogicHandler.GetSNAllInfo("123133",out IMEI1,out IMEI2,out IMEI3,out IMEID,out NetCode,out PSN,out MAC,out BT,out Code1,out Code2,out Code3,out ID1,out ID2,out ID3,out ErrorMessage); Console.WriteLine(IMEI1); Console.WriteLine(IMEI2); Console.WriteLine(IMEI3); Console.WriteLine(IMEID); Console.WriteLine(NetCode); Console.WriteLine(PSN); Console.WriteLine(MAC); Console.WriteLine(BT); Console.WriteLine(Code1); Console.WriteLine(Code2); Console.WriteLine(Code3); Console.WriteLine(ID1); Console.WriteLine(ID2); Console.WriteLine(ID3); Console.WriteLine(ErrorMessage); } private void normalButton3_Click(object sender, EventArgs e) { DataHelper dh = new DataHelper(); string ErrorMessage = ""; string makecode = ""; string IMEI1 = ""; string IMEI2 = ""; string IMEI3 = ""; string IMEID = ""; string NetCode = ""; string PSN = ""; string MAC = ""; string BT = ""; string ID1 = ""; string ID2 = ""; string ID3 = ""; LogicHandler.GetIMEIOrNetCodeRange("123133", "MAKED800", "IME1", "NETCODE", out IMEI1, out IMEI2, out IMEI3, out IMEID, out NetCode, out PSN, out ID1, out ID2, out ID3, out ErrorMessage); Console.WriteLine(IMEI1); Console.WriteLine(IMEI2); Console.WriteLine(IMEI3); Console.WriteLine(IMEID); Console.WriteLine(NetCode); Console.WriteLine(PSN); Console.WriteLine(MAC); Console.WriteLine(BT); Console.WriteLine(ID1); Console.WriteLine(ID2); Console.WriteLine(ID3); Console.WriteLine(ErrorMessage); } private void normalButton2_Click_1(object sender, EventArgs e) { DataHelper dh = new DataHelper(); string ErrorMessage = ""; string makecode = ""; string MAC = ""; string BT = ""; string Code1 = ""; string Code2 = ""; string Code3 = ""; LogicHandler.GetAddressRangeByMakeCode("123133", "MAKED800", out MAC,out BT, out Code1, out Code2, out Code3, out ErrorMessage); Console.WriteLine(MAC); Console.WriteLine(BT); Console.WriteLine(Code1); Console.WriteLine(Code2); Console.WriteLine(Code3); Console.WriteLine(ErrorMessage); } private void panel1_Paint(object sender, PaintEventArgs e) { int rowspaint = 5; //画板工具 Graphics g = e.Graphics; //矩形 Rectangle r = new Rectangle(0,0,40,40); r.Width = paintpanel.Width / 10; r.Height = paintpanel.Height / 8; int x = 40; int y = paintpanel.Height / 8; Pen p = new Pen(Color.Green, 15); p.StartCap = LineCap.Triangle; p.EndCap = LineCap.ArrowAnchor; for (int i = 0; i < 2; i++) { r.Location = new Point(x, y); g.FillRectangle(Brushes.Green, r); x += r.Width*2; } g.DrawLine(p, x + 10, y+r.Height/2 , x + this.Width / 5, y + r.Height / 2 ); } private void enterTextBox2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { valueLabel1.Text = enterTextBox2.Text.ToString(); } } private void valueLabel1_TextChanged(object sender, EventArgs e) { } } }