using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using HNWD.Pregrant.WebService; using HNWD.Pregrant.Model; using System.Text; using HNWD.Pregrant.DataAccess; using HNWD.Pregrant.Common; using HNWD.Pregrant.BusinessLogic; namespace HNWD.Pregrant.WebService.MgrCSharp { public partial class GetWD_DeviceInfo : PageBase { protected void Page_Load(object sender, EventArgs e) { string ID = this.GetValueByKey("ID"); string DEVICE_ID = this.GetValueByKey("DEVICE_ID"); string DEVICE_ETH_MAC = this.GetValueByKey("DEVICE_ETH_MAC"); string DEVICE_ROOM_ID = this.GetValueByKey("DEVICE_ROOM_ID"); string DEVICE_HUMAN_TYPE = this.GetValueByKey("DEVICE_HUMAN_TYPE"); string DEVICE_HUMAN_ID = this.GetValueByKey("DEVICE_HUMAN_ID"); 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")) { this.ResponseDefaultError(); return; } if (!this.InitializeDataAccess()) { this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized); return; } 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); if(wd_DeviceInfo == null) { this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo); return; } this.Response.Write(JsonHelper.SerializeWithSuffix(wd_DeviceInfo)); /////////////////////////////////////////// WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo(); wd_SysLogInfo.LOG_TYPE = "3"; wd_SysLogInfo.LOG_SOURCE ="MGR"; wd_SysLogInfo.LOG_CONTENT ="下载了【ID】为" + wd_DeviceInfo.DEVICE_SN + "的设备数据"; this.DataBaseLog(wd_SysLogInfo); } } }