Form1.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Drawing;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading;
  8. using System.Windows.Forms;
  9. using UAS_MES_NEW.DataOperate;
  10. using UAS_MES_NEW.PublicForm;
  11. using UAS_MES_NEW.PublicMethod;
  12. namespace UAS_MES_NEW
  13. {
  14. public partial class Form1 : Form
  15. {
  16. DataHelper dh;
  17. DataTable dt = new DataTable();
  18. DataTable dbfind;
  19. private void Pr_code_DbChange(object sender, EventArgs e)
  20. {
  21. dbfind = pr_code.ReturnData;
  22. BaseUtil.SetFormValue(this.Controls, dbfind);
  23. }
  24. private void Form1_Load(object sender, EventArgs e)
  25. {
  26. //Com.PortName = "COM4";
  27. //Com.ReadTimeout = 5000;
  28. //Com.WriteTimeout = 5000;
  29. //Com.BaudRate = 9600;
  30. //Com.StopBits = StopBits.One;
  31. //Com.Parity = Parity.None;
  32. dh = new DataHelper();
  33. pr_code.FormName = Name;
  34. pr_code.SetValueField = new string[] { "pr_code" };
  35. pr_code.TableName = "product";
  36. pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格";
  37. pr_code.DbChange += Pr_code_DbChange;
  38. }
  39. private void button3_Click_1(object sender, EventArgs e)
  40. {
  41. //md = new ModeBusTCPServer();
  42. //md.Open();
  43. //txtMsg.AppendText("SUCCESS");
  44. //int a = GetHashCode();
  45. //MessageBox.Show(a.ToString());
  46. //string password = Encryption.EncryptStr("hcsy");
  47. //MessageBox.Show(password);
  48. //string really = Encryption.DecryptStr(password);
  49. //MessageBox.Show(really);
  50. //byte[] date = new byte[] { 1, 2, 3, 4, 5 };
  51. //string aaa = Encoding.ASCII.GetString(date);
  52. //Console.WriteLine(aaa);
  53. SetCheck st = new SetCheck("OK", Color.Green);
  54. BaseUtil.SetFormCenter(st);
  55. st.ShowDialog();
  56. }
  57. private void button4_Click(object sender, EventArgs e)
  58. {
  59. //md.SendOrder(enterTextBox2.Text);
  60. }
  61. private void timer1_Tick(object sender, EventArgs e)
  62. {
  63. //char[] s = new char[] { };
  64. //IntPtr st = GetForegroundWindow();
  65. //StringBuilder sb = new StringBuilder(512);
  66. //GetWindowText(st, sb, sb.Capacity);
  67. //if (sb.ToString() != this.FindForm().Name) {
  68. // //SendKeys.Send("~");
  69. // Console.WriteLine(sb.ToString());
  70. //}
  71. }
  72. private void tabNavigationPage2_Paint(object sender, PaintEventArgs e)
  73. {
  74. }
  75. private void dataNavigator1_Click(object sender, EventArgs e)
  76. {
  77. }
  78. private void dataNavigator1_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
  79. {
  80. //下一页
  81. if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.NextPage)
  82. {
  83. Console.WriteLine("A");
  84. }
  85. //上一页
  86. if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.PrevPage)
  87. {
  88. Console.WriteLine("B");
  89. }
  90. //首页
  91. if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Next)
  92. {
  93. Console.WriteLine("C");
  94. }
  95. //尾页
  96. if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Prev)
  97. {
  98. Console.WriteLine("D");
  99. }
  100. }
  101. }
  102. }