using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using HNWD.Pregrant.Model; using HNWD.Pregrant.Common; using System.Text; using HNWD.Pregrant.DataAccess; using HNWD.Pregrant.WebService; namespace HNWD.Pregrant.WebService.WDHS_I { public partial class callingMainNurse_DoctorHostList : PageBase { protected void Page_Load(object sender, EventArgs e) { string deviceId = this.GetValueByKey("deviceId"); if (!this.InitializeDataAccess()) { this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized); return; } List list_wd_DeviceInfo = this.wd_DeviceInfoDataAccess.ext.messageDataList.FindAll(f => f.DEVICE_TYPE == "2" ); if(list_wd_DeviceInfo == null || list_wd_DeviceInfo.Count ==0) { this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo); return; } if (this.wd_PartInfoDataAccess.ext.messageDataList.Count == 0 ) { this.ResponseDefaultError(PromptingMessage.Error_PartInfo); return; } WD_DeviceInfoExt wd_ext = new WD_DeviceInfoExt(); foreach (WD_DeviceInfo wd_device in list_wd_DeviceInfo) { if (wd_device.ID != deviceId) { wd_device.id = wd_device.ID; wd_device.deviceName = wd_device.DEVICE_NAME; wd_device.deviceStatus = wd_device.DEVICE_STATUS; wd_device.deviceSipIp = wd_device.DEVICE_SIP_IP; wd_device.deviceSipId = wd_device.DEVICE_SIP_ID; wd_device.deviceSipPassWord = wd_device.DEVICE_SIP_PASSWORD; wd_device.deviceCallTimeOut = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_SIP_OVERTIME; wd_device.deviceNurse_Level0 = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL0; wd_device.deviceNurse_Level1 = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL1; wd_device.deviceNurse_Level2 = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL2; wd_device.deviceNurse_Level3 = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL3; wd_device.deviceNurse_Level4 = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NURSE_LEVEL4; wd_device.hospital = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_HOSPITALNAME; wd_device.department = this.wd_PartInfoDataAccess.ext.messageDataList[0].PART_NAME; wd_ext.hostList.Add(wd_device); } } this.Response.Write(JsonHelper.SerializeWithSuffix(wd_ext)); } } }