GetWD_DeviceInfo.aspx.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.WebService;
  8. using HNWD.Pregrant.Model;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.Common;
  12. using HNWD.Pregrant.BusinessLogic;
  13. namespace HNWD.Pregrant.WebService.MgrCSharp
  14. {
  15. public partial class GetWD_DeviceInfo : PageBase
  16. {
  17. protected void Page_Load(object sender, EventArgs e)
  18. {
  19. string ID = this.GetValueByKey("ID");
  20. string DEVICE_ID = this.GetValueByKey("DEVICE_ID");
  21. string DEVICE_ETH_MAC = this.GetValueByKey("DEVICE_ETH_MAC");
  22. string DEVICE_ROOM_ID = this.GetValueByKey("DEVICE_ROOM_ID");
  23. string DEVICE_HUMAN_TYPE = this.GetValueByKey("DEVICE_HUMAN_TYPE");
  24. string DEVICE_HUMAN_ID = this.GetValueByKey("DEVICE_HUMAN_ID");
  25. if(string.IsNullOrEmpty("ID") || string.IsNullOrEmpty("DEVICE_ID") || string.IsNullOrEmpty("DEVICE_ETH_MAC") ||string.IsNullOrEmpty("DEVICE_ROOM_ID") ||string.IsNullOrEmpty("DEVICE_HUMAN_TYPE")||string.IsNullOrEmpty("DEVICE_HUMAN_ID"))
  26. {
  27. this.ResponseDefaultError();
  28. return;
  29. }
  30. if (!this.InitializeDataAccess())
  31. {
  32. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  33. return;
  34. }
  35. WD_DeviceInfo wd_DeviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.ID == ID && f.DEVICE_SN == DEVICE_ID && f.DEVICE_ETH_MAC == DEVICE_ETH_MAC && f.DEVICE_ROOM_ID == DEVICE_ROOM_ID && f.DEVICE_HUMAN_TYPE == DEVICE_HUMAN_TYPE && f.DEVICE_HUMAN_ID == DEVICE_HUMAN_ID);
  36. if(wd_DeviceInfo == null)
  37. {
  38. this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
  39. return;
  40. }
  41. this.Response.Write(JsonHelper.SerializeWithSuffix(wd_DeviceInfo));
  42. ///////////////////////////////////////////
  43. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  44. wd_SysLogInfo.LOG_TYPE = "3";
  45. wd_SysLogInfo.LOG_SOURCE ="MGR";
  46. wd_SysLogInfo.LOG_CONTENT ="下载了【ID】为" + wd_DeviceInfo.DEVICE_SN + "的设备数据";
  47. this.DataBaseLog(wd_SysLogInfo);
  48. }
  49. }
  50. }