| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- 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<int, string> 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();
- DataTable _dt = (DataTable)dh.ExecuteSql("select count(ms_code) as ms_code_sum,(to_char (ms_indate,'yyyy-mm-dd')) ms_date from MAKESERIAL GROUP BY (to_char (ms_indate,'yyyy-mm-dd')) order by (to_char (ms_indate,'yyyy-mm-dd')) asc", "select");
- BaseUtil.ViewChart(chart1, _dt,SeriesChartType.Line, "datetitle", "ms_date", "ms_code_sum","生产日期","生产数");
- dt = (DataTable)dh.ExecuteSql("select ma_salecode,MA_STATUS from make where MA_SALECODE = 'TB17040014'", "select");
- Step = new Dictionary<int, string>();
- 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 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)
- {
- }
- }
- }
|