callingMainNurse_BroadcastInfo.aspx.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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_BroadcastInfo : PageBase
  18. {
  19. /// <summary>
  20. /// PartitionNo
  21. /// ID=37 ,
  22. /// IsOpen=1
  23. /// PartitionNo=""
  24. /// ID=37&IsOpen=1
  25. /// </summary>
  26. protected void Page_Load(object sender, EventArgs e)
  27. {
  28. string PartitionNo = this.GetValueByKey("PartitionNo");
  29. string ID = this.GetValueByKey("ID");
  30. string IsOpen = this.GetValueByKey("IsOpen");
  31. int Pages = Convert.ToInt32(string.IsNullOrEmpty(this.GetValueByKey("Page"))?"-1": this.GetValueByKey("Page"));
  32. int PageSize = Convert.ToInt32(string.IsNullOrEmpty(this.GetValueByKey("PageSize"))?"8" : this.GetValueByKey("PageSize"));
  33. WD_ZoneInfoDataAccess wd = new WD_ZoneInfoDataAccess(new WD_ZoneInfo() { ZONE_STATUS = IsOpen, ID = ID });
  34. if( !string.IsNullOrEmpty(ID))
  35. {
  36. if(string.IsNullOrEmpty(IsOpen))
  37. {
  38. this.ResponseDefaultError();
  39. return;
  40. }
  41. else
  42. {
  43. wd.UpdateZoneStatus();
  44. if(!wd.bSuccess)
  45. {
  46. this.ResponseDefaultError();
  47. return ;
  48. }
  49. }
  50. }
  51. wd.Query(PartitionNo);
  52. if(!wd.ext.bSuccess || wd.ext.Rows == 0)
  53. {
  54. this.ResponseDefaultError();
  55. return;
  56. }
  57. MusicFileExt musicFileext = new MusicFileExt();
  58. musicFileext.bSuccess = wd.ext.bSuccess;
  59. musicFileext.Message = wd.ext.Message;
  60. musicFileext.Code = wd.ext.Code;
  61. foreach(WD_ZoneInfo zoneInfo in wd.ext.messageDataList)
  62. {
  63. MusicFile musicInfo = new MusicFile();
  64. if (Pages == -1)
  65. {
  66. musicInfo.FileName = zoneInfo.ZONE_FILELIST;
  67. }
  68. else
  69. {
  70. foreach (string str in zoneInfo.ZONE_FILELIST.Split(new char[] { ',' }).ToList().Skip(Pages * PageSize).Take(PageSize).ToList())
  71. {
  72. musicInfo.FileName = musicInfo.FileName + "," + str ;
  73. }
  74. if(musicInfo.FileName.Length > 0)
  75. {
  76. musicInfo.FileName = musicInfo.FileName.Substring(1);
  77. }
  78. }
  79. musicInfo.PartitionNo = zoneInfo.ZONE_ZONEID;
  80. musicInfo.IsChecked = "false";
  81. musicInfo.Status = zoneInfo.ZONE_STATUS;
  82. musicInfo.Remarks = zoneInfo.ZONE_CONTENT;
  83. musicInfo.Weeks = zoneInfo.ZONE_WEEK;
  84. musicInfo.StartTime = zoneInfo.ZONE_STARTTIME;
  85. musicInfo.EndTime = zoneInfo.ZONE_ENDTIME;
  86. musicInfo.ID = zoneInfo.ID;
  87. musicFileext.FileList.Add(musicInfo);
  88. }
  89. Response.Write(JsonHelper.SerializeWithSuffix(musicFileext));
  90. }
  91. }
  92. }