LeakCheckDataRecorder.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Aitex.Core.RT.DBCore;
  5. using Aitex.Core.RT.Log;
  6. using Aitex.Core.UI.ControlDataContext;
  7. using Aitex.Sorter.Common;
  8. using MECF.Framework.Common.Equipment;
  9. namespace MECF.Framework.Common.DBCore
  10. {
  11. public class LeakCheckDataRecorder
  12. {
  13. public static void Add(int leakCheckTime, int beginPressure, int endPressure, double leakRate, string status, string mode, string module_name = "System", string gaslineSelection = "")
  14. {
  15. string sql = string.Format(
  16. "INSERT INTO \"leak_check_data\"(\"guid\", \"operate_time\", \"status\" , \"leak_rate\", \"start_pressure\", \"stop_pressure\", \"mode\", \"leak_check_time\", \"module_name\", \"gasline_selection\" )VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}' , '{8}', '{9}' );",
  17. Guid.NewGuid(),
  18. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  19. status,
  20. leakRate,
  21. beginPressure,
  22. endPressure,
  23. mode,
  24. leakCheckTime,
  25. module_name,
  26. gaslineSelection);
  27. DB.Insert(sql);
  28. }
  29. public static void Add(int leakCheckTime, double beginPressure, double endPressure, double leakRate, string status, string mode, string module_name="System", string gaslineSelection="")
  30. {
  31. string sql = string.Format(
  32. "INSERT INTO \"leak_check_data\"(\"guid\", \"operate_time\", \"status\" , \"leak_rate\", \"start_pressure\", \"stop_pressure\", \"mode\", \"leak_check_time\", \"module_name\", \"gasline_selection\" )VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}' , '{8}', '{9}' );",
  33. Guid.NewGuid(),
  34. DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"),
  35. status,
  36. leakRate,
  37. beginPressure,
  38. endPressure,
  39. mode,
  40. leakCheckTime,
  41. module_name,
  42. gaslineSelection);
  43. DB.Insert(sql);
  44. }
  45. }
  46. }