callingBed_init.aspx.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HNWD.Pregrant.Model;
  8. using HNWD.Pregrant.Common;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.WebService;
  12. namespace HNWD.Pregrant.WebService.WDFJ_I
  13. {
  14. /// <summary>
  15. /// 初始化界面
  16. /// </summary>
  17. public partial class callingBed_init : PageBase
  18. {
  19. /// <summary>
  20. /// 测试用例:
  21. /// deviceMAC=4C:01:01:01:02:26
  22. /// 4C:01:01:01:02:27
  23. ////////////4C:01:01:01:02:26
  24. ////////////4C:01:01:01:01:BC
  25. ////////////4C:01:01:01:01:C2
  26. ////////////4C:01:01:01:01:BE
  27. ////////////4C:01:01:01:01:C6
  28. ////////////4C:01:01:01:01:CA
  29. ////////////4C:01:01:01:01:CF
  30. ////////////4C:01:01:01:01:DD
  31. ////////////4C:01:01:01:01:C5
  32. ////////////4C:01:01:01:01:DC
  33. ////////////4C:01:01:01:01:D0
  34. ////////////4C:01:01:01:01:C9
  35. ////////////4C:01:01:01:01:C7
  36. ////////////4C:01:01:01:01:CC
  37. ////////////4C:01:01:01:01:D1
  38. ///
  39. ///
  40. ///
  41. /// </summary>
  42. /// <param name="sender"></param>
  43. /// <param name="e"></param>
  44. protected void Page_Load(object sender, EventArgs e)
  45. {
  46. string userDEVICE_ETH_MAC = this.GetValueByKey("deviceMAC");
  47. if (string.IsNullOrEmpty(userDEVICE_ETH_MAC))
  48. {
  49. this.ResponseDefaultError();
  50. return;
  51. }
  52. if (!this.InitializeDataAccess())
  53. {
  54. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  55. return;
  56. }
  57. if (wd_PartInfoDataAccess.ext.messageDataList.Count <= 0)
  58. {
  59. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  60. return;
  61. }
  62. WD_DeviceInfo wd_deviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.DEVICE_ETH_MAC == userDEVICE_ETH_MAC);
  63. if(wd_deviceInfo==null)
  64. {
  65. this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
  66. return;
  67. }
  68. //wd_deviceInfo.deviceRoomNum = wd_deviceInfo.DEVICE_BED_NUM;
  69. //wd_deviceInfo.deviceBedName = wd_deviceInfo.DEVICE_BED_NAME;
  70. //wd_deviceInfo.deviceBedNum = wd_deviceInfo.DEVICE_BED_NUM;
  71. //'==================================================
  72. //'判断SIP服务器是否存在账号信息
  73. SIPAccountService sipService = new SIPAccountService(userDEVICE_ETH_MAC, this.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()));
  74. sipService.RegisterByuserDEVICE_ETH_MAC();
  75. ////////////////////////////////
  76. /////////////////////////////////
  77. ////////////////////////////////
  78. wd_deviceInfo.deviceScreamSleep = wd_PartInfoDataAccess.ext.messageDataList[0].deviceScreamSleep;
  79. wd_deviceInfo.deviceCallTimeOut = wd_PartInfoDataAccess.ext.messageDataList[0].deviceCallTimeOut;
  80. Response.Write(JsonHelper.SerializeWithSuffix(wd_deviceInfo));
  81. //'==================================================
  82. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  83. wd_SysLogInfo.LOG_TYPE = "3";
  84. wd_SysLogInfo.LOG_SOURCE = "设备MAC地址【" + userDEVICE_ETH_MAC + "】";
  85. wd_SysLogInfo.LOG_CONTENT = "请求【设备配置】数据!";
  86. this.DataBaseLog(wd_SysLogInfo);
  87. }
  88. }
  89. }