callingMainNurse_trust.aspx.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_trust : PageBase
  18. {
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. string paHostId = this.GetValueByKey("paHostId");
  22. string HostId = this.GetValueByKey("HostId");
  23. string Action = this.GetValueByKey("Action");
  24. if(string.IsNullOrEmpty(paHostId) || string.IsNullOrEmpty(HostId) || string.IsNullOrEmpty(Action))
  25. {
  26. this.ResponseDefaultError();
  27. return;
  28. }
  29. WD_DeviceInfoDataAccess wd_deviceInfo = WD_DeviceInfoDataAccess.GetInstance();
  30. ///开始托管
  31. if(Action == "0")
  32. {
  33. wd_deviceInfo.UpdateDEVICE_SIP_HOSTING_ID_Begin(HostId , paHostId);
  34. if(!wd_deviceInfo.bSuccess)
  35. {
  36. this.ResponseDefaultError();
  37. return;
  38. }
  39. }
  40. else if(Action == "1") //取消托管
  41. {
  42. wd_deviceInfo.UpdateDEVICE_SIP_HOSTING_ID_Stop(HostId , paHostId);
  43. if(!wd_deviceInfo.bSuccess)
  44. {
  45. this.ResponseDefaultError();
  46. return;
  47. }
  48. }
  49. this.ResponseDefaultOk();
  50. }
  51. }
  52. }