callingDoor_init.aspx.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.WebService;
  8. using HNWD.Pregrant.Model;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.Common;
  12. namespace HNWD.Pregrant.WebService.WDMK_I
  13. {
  14. /// <summary>
  15. /// 初始化界面
  16. /// </summary>
  17. public partial class callingDoor_init : PageBase
  18. {
  19. /// <summary>
  20. /// 测试用例列表:
  21. /// 3C:01:01:01:01:03
  22. /// 3C:01:01:01:01:4E
  23. /// 3C:01:01:01:01:3F
  24. /// 3C:01:01:01:01:43
  25. /// </summary>
  26. protected void Page_Load(object sender, EventArgs e)
  27. {
  28. string userDEVICE_ETH_MAC = this.GetValueByKey("deviceMAC");
  29. if (string.IsNullOrEmpty(userDEVICE_ETH_MAC))
  30. {
  31. this.ResponseDefaultError();
  32. return;
  33. }
  34. ////////////////////////////////////////
  35. ///////////////////////////////////////
  36. if (!this.InitializeDataAccess())
  37. {
  38. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  39. return;
  40. }
  41. WD_DeviceInfo wd_Device = this.wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.DEVICE_ETH_MAC == userDEVICE_ETH_MAC);
  42. if (wd_Device == null)
  43. {
  44. this.ResponseDefaultError(PromptingMessage.Error_MAC);
  45. return;
  46. }
  47. if (this.wd_PartInfoDataAccess.ext.messageDataList.Count > 0)
  48. {
  49. wd_Device.deviceCallTimeOut = this.wd_PartInfoDataAccess.ext.messageDataList[0].deviceCallTimeOut;
  50. }
  51. wd_Device.roomByname = wd_Device.DEVICE_NAME;
  52. ///////////////////////////////////////////////////////////////////
  53. ///////////////////////////////////////////////////////////////////
  54. SIPAccountService sipService = new SIPAccountService(userDEVICE_ETH_MAC, this.MapPath(HttpContext.Current.Request.ApplicationPath.ToString()));
  55. sipService.RegisterByuserDEVICE_ETH_MAC();
  56. ///////////////////////////////////////////////////////////////////
  57. ///////////////////////////////////////////////////////////////////
  58. Response.Write(JsonHelper.SerializeWithSuffix(wd_Device));
  59. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  60. wd_SysLogInfo.LOG_TYPE = "3";
  61. wd_SysLogInfo.LOG_SOURCE ="设备MAC地址【" + userDEVICE_ETH_MAC + "】";
  62. wd_SysLogInfo.LOG_CONTENT ="请求【设备配置】数据!";
  63. this.DataBaseLog(wd_SysLogInfo);
  64. ///////////////////////////////////////////////////////////////////
  65. ///////////////////////////////////////////////////////////////////
  66. }
  67. }
  68. }