CNAS取数仪器端升级
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.5KB

  1. using CnasSynchronusClient;
  2. using CnasSynchrousModel;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace WF_ChangeGUID
  12. {
  13. public partial class frmMain : Form
  14. {
  15. List<SyncInstrumentItemInfo> lstSyncInstrument = new List<SyncInstrumentItemInfo>();
  16. public frmMain()
  17. {
  18. InitializeComponent();
  19. }
  20. /// <summary>
  21. /// 保存
  22. /// </summary>
  23. /// <param name="sender"></param>
  24. /// <param name="e"></param>
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. if (FileOperation.SaveLocalSyncInStrumentData(lstSyncInstrument))
  28. MessageBox.Show("保存成功");
  29. else
  30. MessageBox.Show("保存失败");
  31. }
  32. /// <summary>
  33. /// 非加密方式打开
  34. /// </summary>
  35. /// <param name="sender"></param>
  36. /// <param name="e"></param>
  37. private void button3_Click(object sender, EventArgs e)
  38. {
  39. listBox1.Items.Clear();
  40. lstSyncInstrument = FileOperation.GetLocalSyncInStrumentData_NoDecrypt();
  41. if (lstSyncInstrument.Count > 0)
  42. {
  43. foreach (SyncInstrumentItemInfo item in lstSyncInstrument)
  44. {
  45. listBox1.Items.Add(item.Code);
  46. listBox1.Items.Add(item.GUID);
  47. }
  48. }
  49. }
  50. private void button2_Click(object sender, EventArgs e)
  51. {
  52. if (lstSyncInstrument.Count <= 0)
  53. {
  54. MessageBox.Show("没有读取到配置数据!");
  55. return;
  56. }
  57. foreach (SyncInstrumentItemInfo item in lstSyncInstrument)
  58. {
  59. item.GUID = Guid.NewGuid().ToString();
  60. listBox2.Items.Add(item.Code);
  61. listBox2.Items.Add(item.GUID);
  62. }
  63. }
  64. private void btnOpenJiaMi_Click(object sender, EventArgs e)
  65. {
  66. lstSyncInstrument = FileOperation.GetLocalSyncInStrumentData();
  67. if (lstSyncInstrument.Count > 0)
  68. {
  69. foreach (SyncInstrumentItemInfo item in lstSyncInstrument)
  70. {
  71. //item.GUID = Guid.NewGuid().ToString();
  72. listBox1.Items.Add(item.Code);
  73. listBox1.Items.Add(item.GUID);
  74. }
  75. }
  76. }
  77. }
  78. }