private void InitDevInfo(uint devID) { Session["CUR_DEV"] = null; REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL; DEVREQ vrGet = new DEVREQ(); UNIDEVICE[] vtResult; vrGet.dwDevID = devID; uResponse = m_Request.Device.Get(vrGet, out vtResult); if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtResult.Length > 0) { UNIDEVICE dev = vtResult[0]; Session["CUR_DEV"] = vtResult[0]; CurDevId = dev.dwDevID.ToString(); pagePosition = "<strong style='color:#333;'>" + dev.szCampusName + " | " + dev.szDevName + "</strong>"; CurDevName = dev.szDevName; if (dev.dwPurchaseDate != null && dev.dwPurchaseDate > 10000000) { string str = dev.dwPurchaseDate.ToString(); string devDate = str.Substring(0, 4) + "年" + str.Substring(4, 2) + "月" + str.Substring(6, 2) + "日"; } ContDevExt(dev.szExtInfo); CurDevCps = dev.szCampusName; CurDevDept = dev.szDeptName; CurDevLab = dev.szLabName; CurDevPro = (dev.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0 ? "l" : "r"; UniClientPage p = new UniClientPage(); imgUrl = this.ResolveClientUrl(p.GetImg(dev.dwDevSN)); //预约信息 UNIRESVRULE rule = p.GetDevRsvRule(dev.dwDevID.ToString()); if (rule.dwEarliestResvTime != null) { CurDevEarly = rule.dwEarliestResvTime.ToString(); } if (rule.dwLatestResvTime != null) { CurDevLast = rule.dwLatestResvTime.ToString(); } if (rule.dwMaxResvTime != null) { CurDevMax = rule.dwMaxResvTime.ToString(); } if (rule.dwMinResvTime != null) { CurDevMin = rule.dwMinResvTime.ToString(); } CurDevSta = dev.dwDevStat.ToString(); //仪器状态 string devSta; if (Converter.GetDevStat(dev.dwDevStat)) { devSta = Converter.GetDevRunStat(dev.dwRunStat); } else { devSta = "<span style='color:red'>仪器不可用</span>"; } } }
protected string RoomExtReq() { UniClientPage clinetPage = new UniClientPage(); string szRoomNo = Request["roomno"]; CtrlRoomInfoExt roomInfo = new CtrlRoomInfoExt(); roomInfo.szCustNo = System.Web.Configuration.WebConfigurationManager.AppSettings["customNo"]; ctrlRoom ctrlRoom = GetDoorCtrl(szRoomNo); if (ctrlRoom != null) { roomInfo.szCtrlNo = ctrlRoom.szCtrlNo; roomInfo.szDcsNO = ctrlRoom.szDcsNO; } consoleRoom cosole = GetConsole(szRoomNo); if (cosole != null) { roomInfo.szConsoleIP = cosole.szIP; } XmlCtrl.XmlInfo info = clinetPage.GetDftXmlInfo(szRoomNo, "RoomPadImg"); List <string> imgList = clinetPage.GetSrcFromHtml(info.content); string szImgUrl = ""; for (int i = 0; i < imgList.Count; i++) { string szTemp = imgList[i]; szTemp = szTemp.Replace("~", ""); szTemp = szTemp.Replace("\r\n", ""); szImgUrl = szImgUrl + szTemp + ";"; } roomInfo.szServerIP = System.Web.Configuration.WebConfigurationManager.AppSettings["ServerIP"]; roomInfo.szServerPort = System.Web.Configuration.WebConfigurationManager.AppSettings["ServerPort"]; roomInfo.szRoomNo = szRoomNo; roomInfo.szimgURL = szImgUrl; return(JsonConvert.SerializeObject(roomInfo)); }