callingMainNurse_init.aspx.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.WDHS_I
  13. {
  14. /// <summary>
  15. /// 初始化界面
  16. /// </summary>
  17. public partial class callingMainNurse_init : PageBase
  18. {
  19. /// <summary>
  20. /// 测试用例
  21. /// deviceMAC=3C:01:01:01:01:57
  22. /// </summary>
  23. /// <param name="sender"></param>
  24. /// <param name="e"></param>
  25. protected void Page_Load(object sender, EventArgs e)
  26. {
  27. string userDEVICE_ETH_MAC = this.GetValueByKey("deviceMAC");
  28. if(string.IsNullOrEmpty(userDEVICE_ETH_MAC))
  29. {
  30. this.ResponseDefaultError();
  31. return;
  32. }
  33. if (!this.InitializeDataAccess())
  34. {
  35. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  36. return;
  37. }
  38. if (this.wd_PartInfoDataAccess.ext.messageDataList.Count < 0)
  39. {
  40. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  41. return;
  42. }
  43. WD_DeviceInfo wd_DeviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.DEVICE_ETH_MAC == userDEVICE_ETH_MAC);
  44. if(wd_DeviceInfo == null)
  45. {
  46. this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
  47. return;
  48. }
  49. wd_DeviceInfo.id = wd_DeviceInfo.ID;
  50. wd_DeviceInfo.deviceName = wd_DeviceInfo.DEVICE_NAME;
  51. wd_DeviceInfo.deviceStatus = wd_DeviceInfo.DEVICE_STATUS;
  52. wd_DeviceInfo.deviceSipIp = wd_DeviceInfo.DEVICE_SIP_IP;
  53. wd_DeviceInfo.deviceSipId = wd_DeviceInfo.DEVICE_SIP_ID;
  54. wd_DeviceInfo.deviceSipPassWord = wd_DeviceInfo.DEVICE_SIP_PASSWORD;
  55. //wd_DeviceInfo.deviceHostingID = wd_DeviceInfo.DEVICE_SIP_HOSTING_ID;
  56. wd_DeviceInfo.deviceCallTimeOut = wd_PartInfoDataAccess.ext.messageDataList[0].PART_SIP_OVERTIME;
  57. wd_DeviceInfo.deviceNurse_Level0 = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL0;
  58. wd_DeviceInfo.deviceNurse_Level1 = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL1;
  59. wd_DeviceInfo.deviceNurse_Level2 = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL2;
  60. wd_DeviceInfo.deviceNurse_Level3 = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL3;
  61. wd_DeviceInfo.deviceNurse_Level4 = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL4;
  62. wd_DeviceInfo.hospital = wd_PartInfoDataAccess.ext.messageDataList[0].PART_HOSPITALNAME;
  63. wd_DeviceInfo.department = wd_PartInfoDataAccess.ext.messageDataList[0].PART_NAME;
  64. Response.Write(JsonHelper.SerializeWithSuffix(wd_DeviceInfo));
  65. ////////////////////////////////////////////////////////////////////
  66. SIPAccountService sipService = new SIPAccountService(userDEVICE_ETH_MAC, this.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()));
  67. sipService.RegisterByuserDEVICE_ETH_MAC();
  68. ////////////////////////////////////////////////////////////////////
  69. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  70. wd_SysLogInfo.LOG_TYPE = "3";
  71. wd_SysLogInfo.LOG_SOURCE ="主机";
  72. wd_SysLogInfo.LOG_CONTENT = "下载了【ID】为" + wd_DeviceInfo.ID + "的设备数据";
  73. this.DataBaseLog(wd_SysLogInfo);
  74. }
  75. }
  76. }