Form1.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Runtime.InteropServices;
  7. using System.Text;
  8. using System.Text.RegularExpressions;
  9. using System.Windows.Forms;
  10. using System.Windows.Forms.DataVisualization.Charting;
  11. using UAS_MES.CustomControl.DataGrid_View;
  12. using UAS_MES.DataOperate;
  13. using UAS_MES.PublicForm;
  14. using UAS_MES.PublicMethod;
  15. namespace UAS_MES
  16. {
  17. public partial class Form1 : Form
  18. {
  19. public Form1()
  20. {
  21. InitializeComponent();
  22. }
  23. [DllImport("kernel32.dll")]
  24. public static extern bool d(int freq, int duration);
  25. private void button3_Click(object sender, EventArgs e)
  26. {
  27. d(800, 600);
  28. }
  29. private void Form1_Load(object sender, EventArgs e)
  30. {
  31. DataGridViewCheckBoxColumn checkboxCol = new DataGridViewCheckBoxColumn();
  32. checkboxCol.Name = "全选";
  33. //创建复选框列头单元格
  34. DataGridViewCheckBoxHeaderCell ch = new DataGridViewCheckBoxHeaderCell(TestDGV, checkboxCol);
  35. //设置复选框那列的单元格为复选框
  36. checkboxCol.HeaderCell = ch;
  37. this.TestDGV.Columns.Add(checkboxCol);
  38. blurSearch1.TableName = "Make";
  39. blurSearch1.Field = "ma_code";
  40. DataHelper dh = new DataHelper();
  41. 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");
  42. }
  43. private void ViewChart(DataTable _dt, string _title)
  44. {
  45. List<string> xData = new List<string>();
  46. List<int> yData = new List<int>();
  47. for (int i = 0; i < _dt.Rows.Count; i++)
  48. {
  49. xData.Add(_dt.Rows[i]["ms_nextstepcode"].ToString());
  50. yData.Add(int.Parse(_dt.Rows[i]["count(*)"].ToString()));
  51. }
  52. ct_coll.Series[0]["PieLineColor"] = "Red";//绘制黑色的连线。
  53. this.ct_coll.Series[0].ToolTip = "#VAL{D}件";//鼠标移动到上面显示的文字
  54. this.ct_coll.Series[0].BackSecondaryColor = Color.DarkCyan;
  55. this.ct_coll.Series[0].BorderColor = Color.DarkOliveGreen;
  56. this.ct_coll.Series[0].LabelBackColor = Color.Transparent;
  57. ct_coll.ChartAreas[0].Area3DStyle.Enable3D = true;
  58. ct_coll.Series[0].Points.DataBindXY(xData, yData);
  59. }
  60. private void normalButton2_Click(object sender, EventArgs e)
  61. {
  62. DataHelper dh = new DataHelper();
  63. string ErrorMessage = "";
  64. string makecode = "";
  65. string IMEI1 = "";
  66. string IMEI2 = "";
  67. string IMEI3 = "";
  68. string IMEID = "";
  69. string NetCode = "";
  70. string PSN = "";
  71. string MAC = "";
  72. string BT = "";
  73. string Code1 = "";
  74. string Code2 = "";
  75. string Code3 = "";
  76. string ID1 = "";
  77. string ID2 = "";
  78. string ID3 = "";
  79. 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);
  80. Console.WriteLine(IMEI1);
  81. Console.WriteLine(IMEI2);
  82. Console.WriteLine(IMEI3);
  83. Console.WriteLine(IMEID);
  84. Console.WriteLine(NetCode);
  85. Console.WriteLine(PSN);
  86. Console.WriteLine(MAC);
  87. Console.WriteLine(BT);
  88. Console.WriteLine(Code1);
  89. Console.WriteLine(Code2);
  90. Console.WriteLine(Code3);
  91. Console.WriteLine(ID1);
  92. Console.WriteLine(ID2);
  93. Console.WriteLine(ID3);
  94. Console.WriteLine(ErrorMessage);
  95. }
  96. private void normalButton3_Click(object sender, EventArgs e)
  97. {
  98. DataHelper dh = new DataHelper();
  99. string ErrorMessage = "";
  100. string makecode = "";
  101. string IMEI1 = "";
  102. string IMEI2 = "";
  103. string IMEI3 = "";
  104. string IMEID = "";
  105. string NetCode = "";
  106. string PSN = "";
  107. string MAC = "";
  108. string BT = "";
  109. string ID1 = "";
  110. string ID2 = "";
  111. string ID3 = "";
  112. 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);
  113. Console.WriteLine(IMEI1);
  114. Console.WriteLine(IMEI2);
  115. Console.WriteLine(IMEI3);
  116. Console.WriteLine(IMEID);
  117. Console.WriteLine(NetCode);
  118. Console.WriteLine(PSN);
  119. Console.WriteLine(MAC);
  120. Console.WriteLine(BT);
  121. Console.WriteLine(ID1);
  122. Console.WriteLine(ID2);
  123. Console.WriteLine(ID3);
  124. Console.WriteLine(ErrorMessage);
  125. }
  126. private void normalButton2_Click_1(object sender, EventArgs e)
  127. {
  128. DataHelper dh = new DataHelper();
  129. string ErrorMessage = "";
  130. string makecode = "";
  131. string MAC = "";
  132. string BT = "";
  133. string Code1 = "";
  134. string Code2 = "";
  135. string Code3 = "";
  136. LogicHandler.GetAddressRangeByMakeCode("123133", "MAKED800", out MAC,out BT, out Code1, out Code2, out Code3, out ErrorMessage);
  137. Console.WriteLine(MAC);
  138. Console.WriteLine(BT);
  139. Console.WriteLine(Code1);
  140. Console.WriteLine(Code2);
  141. Console.WriteLine(Code3);
  142. Console.WriteLine(ErrorMessage);
  143. }
  144. }
  145. }