protected void Page_Load(object sender, EventArgs e) { CONREQ vrParameter = new CONREQ(); UNICONSOLE[] vrResult; if (Request["delID"] != null) { DelTerm(Request["delID"]); } GetPageCtrlValue(out vrParameter.szReqExtInfo); if (m_Request.Console.ConGet(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { for (int i = 0; i < vrResult.Length; i++) { m_szOut += "<tr>"; m_szOut += "<td data-id=\"" + vrResult[i].dwConsoleSN.ToString() + "\">" + vrResult[i].dwConsoleSN + "</td>"; m_szOut += "<td data-id=\"" + vrResult[i].dwConsoleSN.ToString() + "\">" + vrResult[i].szConsoleName + "</td>"; m_szOut += "<td>" + (vrResult[i].szIP) + "</td>"; m_szOut += "<td>" + GetTimeStr(vrResult[i].dwOpenTime) + "到" + GetTimeStr(vrResult[i].dwCloseTime) + "</td>"; m_szOut += "<td>" + GetJustName(vrResult[i].dwKind, "Console_Kind_Total") + "</td>"; m_szOut += "<td>" + GetJustName(vrResult[i].dwKind, "Console_Kind_Detail") + "</td>"; m_szOut += "<td>" + GetJustName(vrResult[i].dwStatus, "Console_Status") + "</td>"; string szDivOPTD = "OPTD"; m_szOut += "<td><div class='" + szDivOPTD + "'></div></td>"; m_szOut += "</tr>"; } UpdatePageCtrl(m_Request.Console); } PutBackValue(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { UNICONSOLE newConsole; uint? uSN = 0; GetHTTPObj(out newConsole); uSN = newConsole.dwConsoleSN; newConsole.dwConsoleSN = 0; newConsole.dwOpenTime = GetTime(Request["dwOpenTime"]); newConsole.dwCloseTime = GetTime(Request["dwCloseTime"]); string szKindListObject = Request["dwKindListObject"] == null?"0":Request["dwKindListObject"].ToString(); newConsole.dwKind = CharListToUint(szKindListObject.ToString()) + Parse(Request["dwKind"]); newConsole.szManRooms = GetRoomNoCtrlList(Request["szManRooms"]); newConsole.dwConsoleSN = uSN; if (m_Request.Console.ConSet(newConsole, out newConsole) != REQUESTCODE.EXECUTE_SUCCESS) { MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE); return; } else { MessageBox("修改成功", "修改控制台", MSGBOX.SUCCESS, MSGBOX_ACTION.OK); return; } } dwKindList = GetAllInputHtml(CONSTHTML.option, "", "Console_Kind"); szKindObject = GetAllInputHtml(CONSTHTML.checkBox, "dwKindListObject", "Console_Kind_Object"); UNIROOM[] roomList = GetAllRoom(); if (roomList != null && roomList.Length > 0) { for (int i = 0; i < roomList.Length; i++) { string szCheck = ""; m_szRoom += "<label><input class=\"enum\"" + szCheck + "type=\"checkbox\" name=\"" + "szManRooms" + "\" value=\"" + roomList[i].szRoomNo.ToString() + "\" /> " + roomList[i].szRoomName + "</label>"; } } if (Request["op"] == "set") { bSet = true; CONREQ vrConGet = new CONREQ(); vrConGet.dwConsoleSN = ToUint(Request["dwID"]); UNICONSOLE[] vrConRes; if (m_Request.Console.ConGet(vrConGet, out vrConRes) != REQUESTCODE.EXECUTE_SUCCESS) { MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } else { if (vrConRes.Length == 0) { MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL); } else { PutJSObj(vrConRes[0]); ViewState["dwKind"] = vrConRes[0].dwKind.ToString(); m_Title = "修改" + "【" + vrConRes[0].szConsoleName + "】"; } } } else { uint?uMax = 0; uint uID = PRStation.DOORCTRLSRV_BASE | PRDoorCtrlSrv.MSREQ_DCS_SET; if (GetMaxValue(ref uMax, uID, "dwSN")) { UNICONSOLE setValue = new UNICONSOLE(); setValue.dwConsoleSN = uMax; PutJSObj(setValue); } m_Title = "修改控制台"; } }
protected void Page_Load(object sender, EventArgs e) { m_Title = "生成配置文件"; if (IsPostBack) { string szKindError = ""; string szRoomNoNull = ""; string szRoomNoMut = ""; CONREQ vrParameter = new CONREQ(); UNICONSOLE[] vrResult; ArrayList list = new System.Collections.ArrayList(); string szError = ""; if (m_Request.Console.ConGet(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS) { int nCountError = 0; for (int i = 0; i < vrResult.Length; i++) { uint uKind = (uint)vrResult[i].dwKind; if ((uKind & (uint)UNICONSOLE.DWKIND.CONKIND_DISPLAY) == 0) { nCountError = nCountError + 1; szKindError += vrResult[i].szConsoleName + ","; continue; } string szRoomNo = vrResult[i].szManRooms; if (string.IsNullOrEmpty(szRoomNo)) { nCountError = nCountError + 1; szRoomNoNull += vrResult[i].szConsoleName + ","; continue; } else if ((szRoomNo.Length - szRoomNo.Replace(",", "").Length) > 2) { nCountError = nCountError + 1; szRoomNoMut += vrResult[i].szConsoleName + ","; continue; } consoleRoom value = new consoleRoom(); value.szIP = vrResult[i].szIP; value.szRoomNo = vrResult[i].szManRooms; list.Add(value); } szError += "成功导出" + (vrResult.Length - nCountError).ToString() + "个,"; if (szKindError != "") { szError += "不是触控柜不能导出:" + szKindError; } if (szRoomNoNull != "") { szError += "不关联房间不能导出:" + szKindError; } if (szRoomNoMut != "") { szError += "关联多个房间不能导出:" + szKindError; } } string json = JsonConvert.SerializeObject(list); string path = Server.MapPath("~/") + ("padtxt\\ctrlroom.txt"); FileStream myFs = new FileStream(path, FileMode.Create); //txtFilePath为生成txt文件的路径 StreamWriter mySw = new StreamWriter(myFs); mySw.Write(json); //writeStr为要写入的字符串 mySw.Close(); myFs.Close(); MessageBox("提示:" + szError, "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK); } }