callingMainNurse_systemInfo.aspx.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. using HNWD.Pregrant.BusinessLogic;
  13. namespace HNWD.Pregrant.WebService.WDHS_I
  14. {
  15. public partial class callingMainNurse_systemInfo : PageBase
  16. {
  17. protected void Page_Load(object sender, EventArgs e)
  18. {
  19. bool bupdate = false;
  20. StringBuilder sb = new StringBuilder(" UPDATE [WD_PartInfo] SET ");
  21. string dayBright = this.GetValueByKey("dayBright");
  22. if (!string.IsNullOrEmpty(dayBright))
  23. {
  24. sb.AppendFormat(" PART_DAY_BLIGHT = {0} ,", this.ModifyVol(dayBright));//白天屏幕亮度
  25. bupdate = true;
  26. }
  27. string nightbright = this.GetValueByKey("nightbright");
  28. if (!string.IsNullOrEmpty(nightbright))
  29. {
  30. sb.AppendFormat(" PART_NIGHT_BLIGHT = {0} ,", this.ModifyVol(nightbright));//晚上屏幕亮度
  31. bupdate = true;
  32. }
  33. string dayRingVol = this.GetValueByKey("dayRingVol");
  34. if (!string.IsNullOrEmpty(dayRingVol))
  35. {
  36. sb.AppendFormat(" PART_DAY_SIPVOL = {0} ,", this.ModifyVol(dayRingVol));//白天音量大小
  37. bupdate = true;
  38. }
  39. string nightRightVol = this.GetValueByKey("nightRightVol");
  40. if (!string.IsNullOrEmpty(nightRightVol))
  41. {
  42. sb.AppendFormat(" PART_NIGHT_SIPVOL = {0} ,", this.ModifyVol(nightRightVol));//晚上音量大小
  43. bupdate = true;
  44. }
  45. string dayRingTimes = this.GetValueByKey("dayRingTimes");
  46. if (!string.IsNullOrEmpty(dayRingTimes))
  47. {
  48. sb.AppendFormat(" PART_DAY_RINGTIMES = {0} ,", this.ModifyVol(dayRingTimes));//白天响铃次数
  49. bupdate = true;
  50. }
  51. string nightRingTimes = this.GetValueByKey("nightRingTimes");
  52. if (!string.IsNullOrEmpty(nightRingTimes))
  53. {
  54. sb.AppendFormat(" PART_NIGHT_RINGTIMES = {0} ,", this.ModifyVol(nightRingTimes));//晚上响铃次数
  55. bupdate = true;
  56. }
  57. string dayNursingLed = this.GetValueByKey("dayNursingLed");
  58. if (!string.IsNullOrEmpty(dayNursingLed))
  59. {
  60. sb.AppendFormat(" PART_DAY_NURSINGLED = {0} ,", this.ModifyVol(dayNursingLed));//白天护理灯 LED亮度
  61. bupdate = true;
  62. }
  63. string nightNursingLed = this.GetValueByKey("nightNursingLed");
  64. if (!string.IsNullOrEmpty(nightNursingLed))
  65. {
  66. sb.AppendFormat(" PART_NIGHT_NURSINGLED = {0} ,", this.ModifyVol(nightNursingLed));//晚上护理灯LED亮度
  67. bupdate = true;
  68. }
  69. string sipOverTime = this.GetValueByKey("sipOverTime");
  70. if (!string.IsNullOrEmpty(sipOverTime))
  71. {
  72. sb.AppendFormat(" PART_SIP_OVERTIME = {0} ,", this.ModifyTime(sipOverTime));//语音呼叫超时时间
  73. bupdate = true;
  74. }
  75. string screenExtinguishTime = this.GetValueByKey("screenExtinguishTime");
  76. if (!string.IsNullOrEmpty(screenExtinguishTime))
  77. {
  78. sb.AppendFormat(" PART_SLEEPTIME = {0} ,", this.ModifyTime(screenExtinguishTime));//熄屏时间
  79. bupdate = true;
  80. }
  81. string dayStartTime = this.GetValueByKey("dayStartTime");
  82. if (!string.IsNullOrEmpty(dayStartTime))
  83. {
  84. sb.AppendFormat(" PART_DAY_START = '{0}' ,", dayStartTime);//白天开始时间
  85. bupdate = true;
  86. }
  87. string nightStartTime = this.GetValueByKey("nightStartTime");
  88. if (!string.IsNullOrEmpty(nightStartTime))
  89. {
  90. sb.AppendFormat(" PART_NIGHT_START = '{0}' ,", nightStartTime);//晚上开始时间
  91. bupdate = true;
  92. }
  93. string daySipVol = this.GetValueByKey("daySipVol");
  94. if (!string.IsNullOrEmpty(daySipVol))
  95. {
  96. sb.AppendFormat(" PART_DAY_RINGVOL = {0} ,", this.ModifyVol(daySipVol));//白天通话音量
  97. bupdate = true;
  98. }
  99. string nightSipVol = this.GetValueByKey("nightSipVol");
  100. if (!string.IsNullOrEmpty(nightSipVol))
  101. {
  102. sb.AppendFormat(" PART_NIGHT_RINGVOL = {0} ,", this.ModifyVol(nightSipVol));//晚上通话音量
  103. bupdate = true;
  104. }
  105. string dayDoorSipVol = this.GetValueByKey("dayDoorSipVol");
  106. if (!string.IsNullOrEmpty(dayDoorSipVol))
  107. {
  108. sb.AppendFormat(" PART_DAY_DOORSIPVOL = {0} ,", this.ModifyVol(dayDoorSipVol));//门口机白天通话音量
  109. bupdate = true;
  110. }
  111. string dayBedSipVol = this.GetValueByKey("dayBedSipVol");
  112. if (!string.IsNullOrEmpty(dayBedSipVol))
  113. {
  114. sb.AppendFormat(" PART_DAY_BEDSIPVOL = {0} ,", this.ModifyVol(dayBedSipVol));//病床分机机白天通话音量
  115. bupdate = true;
  116. }
  117. string nightDoorSipVol = this.GetValueByKey("nightDoorSipVol");
  118. if (!string.IsNullOrEmpty(nightDoorSipVol))
  119. {
  120. sb.AppendFormat(" PART_NIGHT_DOORSIPVOL = {0} ,", this.ModifyVol(nightDoorSipVol));//门口机晚上通话音量
  121. bupdate = true;
  122. }
  123. string nightBedSipVol = this.GetValueByKey("nightBedSipVol");
  124. if (!string.IsNullOrEmpty(nightBedSipVol))
  125. {
  126. sb.AppendFormat(" PART_NIGHT_BEDSIPVOL = {0} ,", this.ModifyVol(nightBedSipVol));//病床分机晚上通话音量
  127. bupdate = true;
  128. }
  129. if (!this.InitializeDataAccess())
  130. {
  131. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  132. return;
  133. }
  134. if (bupdate)
  135. {
  136. sb.Remove(sb.Length - 1, 1);
  137. sb.Append(" ; update [WD_RunProfile] SET [SysSettingsFlag]=1 ");
  138. if (!this.wd_PartInfoDataAccess.Update(sb.ToString()))
  139. {
  140. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  141. return;
  142. }
  143. }
  144. WD_PartInfoBusinessLogic wd_PartInfoBusinessLogic = new WD_PartInfoBusinessLogic();
  145. if (!wd_PartInfoBusinessLogic.Operate())
  146. {
  147. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  148. return;
  149. }
  150. Response.Write(JsonHelper.SerializeWithSuffix(wd_PartInfoBusinessLogic.wd_PartInfo));
  151. }
  152. private string ModifyVol(string vol)
  153. {
  154. string modified = "";
  155. if (Convert.ToInt16(vol) > 100)
  156. {
  157. modified = "100";
  158. }
  159. else if (Convert.ToInt16(vol) < 0)
  160. {
  161. modified = "0";
  162. }
  163. else
  164. {
  165. modified = vol;
  166. }
  167. return modified;
  168. }
  169. private string ModifyTime(string time)
  170. {
  171. string modified = "";
  172. if (Convert.ToInt16(time) > 200)
  173. {
  174. modified = "200";
  175. }
  176. else if (Convert.ToInt16(time) < 0)
  177. {
  178. modified = "0";
  179. }
  180. else
  181. {
  182. modified = time;
  183. }
  184. return modified;
  185. }
  186. }
  187. }