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; using HNWD.Pregrant.BusinessLogic; namespace HNWD.Pregrant.WebService.WDHS_I { public partial class callingMainNurse_systemInfo : PageBase { protected void Page_Load(object sender, EventArgs e) { bool bupdate = false; StringBuilder sb = new StringBuilder(" UPDATE [WD_PartInfo] SET "); string dayBright = this.GetValueByKey("dayBright"); if (!string.IsNullOrEmpty(dayBright)) { sb.AppendFormat(" PART_DAY_BLIGHT = {0} ,", this.ModifyVol(dayBright));//白天屏幕亮度 bupdate = true; } string nightbright = this.GetValueByKey("nightbright"); if (!string.IsNullOrEmpty(nightbright)) { sb.AppendFormat(" PART_NIGHT_BLIGHT = {0} ,", this.ModifyVol(nightbright));//晚上屏幕亮度 bupdate = true; } string dayRingVol = this.GetValueByKey("dayRingVol"); if (!string.IsNullOrEmpty(dayRingVol)) { sb.AppendFormat(" PART_DAY_SIPVOL = {0} ,", this.ModifyVol(dayRingVol));//白天音量大小 bupdate = true; } string nightRightVol = this.GetValueByKey("nightRightVol"); if (!string.IsNullOrEmpty(nightRightVol)) { sb.AppendFormat(" PART_NIGHT_SIPVOL = {0} ,", this.ModifyVol(nightRightVol));//晚上音量大小 bupdate = true; } string dayRingTimes = this.GetValueByKey("dayRingTimes"); if (!string.IsNullOrEmpty(dayRingTimes)) { sb.AppendFormat(" PART_DAY_RINGTIMES = {0} ,", this.ModifyVol(dayRingTimes));//白天响铃次数 bupdate = true; } string nightRingTimes = this.GetValueByKey("nightRingTimes"); if (!string.IsNullOrEmpty(nightRingTimes)) { sb.AppendFormat(" PART_NIGHT_RINGTIMES = {0} ,", this.ModifyVol(nightRingTimes));//晚上响铃次数 bupdate = true; } string dayNursingLed = this.GetValueByKey("dayNursingLed"); if (!string.IsNullOrEmpty(dayNursingLed)) { sb.AppendFormat(" PART_DAY_NURSINGLED = {0} ,", this.ModifyVol(dayNursingLed));//白天护理灯 LED亮度 bupdate = true; } string nightNursingLed = this.GetValueByKey("nightNursingLed"); if (!string.IsNullOrEmpty(nightNursingLed)) { sb.AppendFormat(" PART_NIGHT_NURSINGLED = {0} ,", this.ModifyVol(nightNursingLed));//晚上护理灯LED亮度 bupdate = true; } string sipOverTime = this.GetValueByKey("sipOverTime"); if (!string.IsNullOrEmpty(sipOverTime)) { sb.AppendFormat(" PART_SIP_OVERTIME = {0} ,", this.ModifyTime(sipOverTime));//语音呼叫超时时间 bupdate = true; } string screenExtinguishTime = this.GetValueByKey("screenExtinguishTime"); if (!string.IsNullOrEmpty(screenExtinguishTime)) { sb.AppendFormat(" PART_SLEEPTIME = {0} ,", this.ModifyTime(screenExtinguishTime));//熄屏时间 bupdate = true; } string dayStartTime = this.GetValueByKey("dayStartTime"); if (!string.IsNullOrEmpty(dayStartTime)) { sb.AppendFormat(" PART_DAY_START = '{0}' ,", dayStartTime);//白天开始时间 bupdate = true; } string nightStartTime = this.GetValueByKey("nightStartTime"); if (!string.IsNullOrEmpty(nightStartTime)) { sb.AppendFormat(" PART_NIGHT_START = '{0}' ,", nightStartTime);//晚上开始时间 bupdate = true; } string daySipVol = this.GetValueByKey("daySipVol"); if (!string.IsNullOrEmpty(daySipVol)) { sb.AppendFormat(" PART_DAY_RINGVOL = {0} ,", this.ModifyVol(daySipVol));//白天通话音量 bupdate = true; } string nightSipVol = this.GetValueByKey("nightSipVol"); if (!string.IsNullOrEmpty(nightSipVol)) { sb.AppendFormat(" PART_NIGHT_RINGVOL = {0} ,", this.ModifyVol(nightSipVol));//晚上通话音量 bupdate = true; } string dayDoorSipVol = this.GetValueByKey("dayDoorSipVol"); if (!string.IsNullOrEmpty(dayDoorSipVol)) { sb.AppendFormat(" PART_DAY_DOORSIPVOL = {0} ,", this.ModifyVol(dayDoorSipVol));//门口机白天通话音量 bupdate = true; } string dayBedSipVol = this.GetValueByKey("dayBedSipVol"); if (!string.IsNullOrEmpty(dayBedSipVol)) { sb.AppendFormat(" PART_DAY_BEDSIPVOL = {0} ,", this.ModifyVol(dayBedSipVol));//病床分机机白天通话音量 bupdate = true; } string nightDoorSipVol = this.GetValueByKey("nightDoorSipVol"); if (!string.IsNullOrEmpty(nightDoorSipVol)) { sb.AppendFormat(" PART_NIGHT_DOORSIPVOL = {0} ,", this.ModifyVol(nightDoorSipVol));//门口机晚上通话音量 bupdate = true; } string nightBedSipVol = this.GetValueByKey("nightBedSipVol"); if (!string.IsNullOrEmpty(nightBedSipVol)) { sb.AppendFormat(" PART_NIGHT_BEDSIPVOL = {0} ,", this.ModifyVol(nightBedSipVol));//病床分机晚上通话音量 bupdate = true; } if (!this.InitializeDataAccess()) { this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized); return; } if (bupdate) { sb.Remove(sb.Length - 1, 1); sb.Append(" ; update [WD_RunProfile] SET [SysSettingsFlag]=1 "); if (!this.wd_PartInfoDataAccess.Update(sb.ToString())) { this.ResponseDefaultError(PromptingMessage.Error_PartInfo); return; } } WD_PartInfoBusinessLogic wd_PartInfoBusinessLogic = new WD_PartInfoBusinessLogic(); if (!wd_PartInfoBusinessLogic.Operate()) { this.ResponseDefaultError(PromptingMessage.Error_PartInfo); return; } Response.Write(JsonHelper.SerializeWithSuffix(wd_PartInfoBusinessLogic.wd_PartInfo)); } private string ModifyVol(string vol) { string modified = ""; if (Convert.ToInt16(vol) > 100) { modified = "100"; } else if (Convert.ToInt16(vol) < 0) { modified = "0"; } else { modified = vol; } return modified; } private string ModifyTime(string time) { string modified = ""; if (Convert.ToInt16(time) > 200) { modified = "200"; } else if (Convert.ToInt16(time) < 0) { modified = "0"; } else { modified = time; } return modified; } } }