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.

46 lines
1.3KB

  1. using CnasLocalIDAL;
  2. using CnasSynchrousModel;
  3. using SyncLocalDAL;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. namespace CNAS_SerialPort
  9. {
  10. public class SericalPortConfigBLL
  11. {
  12. public ISerialPortConfigInfo IserialPortConfig { get { return new SerialPortConfigInfoDAL(); } }
  13. /// <summary>
  14. /// 读取串口配置信息
  15. /// </summary>
  16. /// <returns></returns>
  17. public SerialPortConfigInfo GetSerialPortConfigInfo()
  18. {
  19. return IserialPortConfig.GetSerialPortConfigInfo();
  20. }
  21. /// <summary>
  22. /// 保存串口配置信息
  23. /// </summary>
  24. /// <param name="serialPortItem"></param>
  25. /// <returns></returns>
  26. public int SaveSerialPortConfigInfo(SerialPortConfigInfo serialPortItem)
  27. {
  28. int iReturn = 0;
  29. SerialPortConfigInfo serialPortConfig = GetSerialPortConfigInfo();
  30. if (serialPortConfig == null)
  31. {
  32. //执行插入
  33. iReturn = IserialPortConfig.InsertSerialPortConfigInfo(serialPortItem);
  34. }
  35. else
  36. {
  37. //执行更新
  38. iReturn = IserialPortConfig.UpdateSerialPortConfigInfo(serialPortItem);
  39. }
  40. return iReturn;
  41. }
  42. }
  43. }