DeviceStatusInfo.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using DevExpress.XtraEditors;
  3. using UAS_DeviceMonitor.DataOperate;
  4. using UAS_DeviceMonitor.Entity;
  5. using System.Data;
  6. using System.Text;
  7. using UAS_DeviceMonitor.PublicMethod;
  8. using System.Windows.Forms;
  9. using System.Drawing;
  10. namespace UAS_DeviceMonitor.Device.Infomation
  11. {
  12. public partial class DeviceStatusInfo : XtraForm
  13. {
  14. DataHelper dh = SystemInf.dh;
  15. StringBuilder sql = new StringBuilder();
  16. string de_code = "";
  17. public DeviceStatusInfo()
  18. {
  19. InitializeComponent();
  20. }
  21. public DeviceStatusInfo(string DevcieCode)
  22. {
  23. InitializeComponent();
  24. de_code = DevcieCode;
  25. Text = DevcieCode;
  26. }
  27. private void DeviceStatusInfo_Load(object sender, EventArgs e)
  28. {
  29. sql.Clear();
  30. sql.Append("select de_linecode,de_wccode,de_name,de_address from device ");
  31. sql.Append("where de_code='" + de_code + "'");
  32. DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
  33. if (dt.Rows.Count > 0)
  34. {
  35. BaseUtil.SetFormValue(Controls, dt);
  36. }
  37. dt = (DataTable)dh.ExecuteSql("select dpg_count,dpg_starttime,dpg_senddatasize,dpg_receivedatasize from DEVICEPOLLINGLOG where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + de_code + "')", "select");
  38. if (dt.Rows.Count > 0)
  39. {
  40. BaseUtil.SetFormValue(Controls, dt);
  41. }
  42. }
  43. private void DeviceStatusInfo_MouseMove(object sender, MouseEventArgs e)
  44. {
  45. Point p = ParentForm.PointToScreen(e.Location);
  46. //Console.WriteLine(e.Location + " " + Top + " " + Right + " " + " " + Bottom + " " + Right);
  47. }
  48. }
  49. }