示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DOORCTRLREQ vrParameter = new DOORCTRLREQ();

        UNIDOORCTRL[] vrResult;
        vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;
        vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
        string szID = Request["delID"];

        if (szID != null && szID != "")
        {
            del(szID);
        }
        if (m_Request.DoorCtrlSrv.GetDoorCtrl(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td data-roomno='" + vrResult[i].szRoomNo + "' data-id='" + vrResult[i].dwCtrlSN + "' data-sn='" + vrResult[i].dwDCSSN + "'>" + vrResult[i].dwCtrlSN + "</td>";
                m_szOut += "<td>" + vrResult[i].dwDCSSN + "</td>";
                m_szOut += "<td>" + vrResult[i].szDCSName + "</td>";
                m_szOut += "<td class='lnkRoom' data-id='" + vrResult[i].szRoomNo + "'>" + vrResult[i].szRoomNo + "</td>";
                m_szOut += "<td class='lnkSta' data-id='" + vrResult[i].dwStaSN + "'>" + vrResult[i].szStaName + "</td>";
                m_szOut += "<td>" + vrResult[i].szMemo + "</td>";
                string szDivOPTD = "OPTD";
                m_szOut += "<td><div class='" + szDivOPTD + "'></div></td>";
                m_szOut += "</tr>";
            }
        }

        PutBackValue();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            DOORCTRLREQ vrParameter = new DOORCTRLREQ();
            vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
            UNIDOORCTRL[] vrResult;
            ArrayList     list    = new System.Collections.ArrayList();
            string        szError = "";
            if (m_Request.DoorCtrlSrv.GetDoorCtrl(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                for (int i = 0; i < vrResult.Length; i++)
                {
                    ctrlRoom value = new ctrlRoom();
                    value.szDcsNO  = vrResult[i].dwDCSSN.ToString();
                    value.szCtrlNo = vrResult[i].dwCtrlSN.ToString();
                    value.szRoomNo = vrResult[i].szRoomNo.ToString();
                    list.Add(value);
                }
            }

            string       json = JsonConvert.SerializeObject(list);
            string       path = Server.MapPath("~/") + ("padtxt\\dcsRoom.txt");
            FileStream   myFs = new FileStream(path, FileMode.Create); //txtFilePath为生成txt文件的路径
            StreamWriter mySw = new StreamWriter(myFs);
            mySw.Write(json);                                          //writeStr为要写入的字符串
            mySw.Close();
            myFs.Close();
            MessageBox("提示:" + vrResult.Length + "条", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        ROOMREQ     vrGet     = new ROOMREQ();

        UNIROOM[] vtRes;

        /*
         * uResponse = m_Request.Device.RoomGet(vrGet, out vtRes);
         * if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
         * {
         *  for (int i = 0; i < vtRes.Length; i++)
         *  {
         *      if (!(((uint)vtRes[i].dwManMode & (uint)UNIROOM.DWMANMODE.ROOMMAN_CAMERA) > 0))
         *      {
         *          continue;
         *      }
         *       UNIDOORCTRL[] doorCtrl;
         *       if (!GetDoorCtrl(vtRes[i].szRoomNo, out doorCtrl))
         *       {
         *          // continue;
         *       }
         *      string szID = vtRes[i].dwRoomID.ToString();
         *      string szName = vtRes[i].szRoomName.ToString();
         *
         *      m_szOut += "<input data-ctrlsn=\"" + doorCtrl[0].dwCtrlSN.ToString() + "\" data-ip=\"" + doorCtrl[0].szDCSIP.ToString() + "\" class=\"enum\" id=\"" + szID + "\" type=\"radio\" name=\"" + "szRoom" + "\" value=\"" + szID + "\" /> <label for=\"" + szID + "\">" + szName + "</label>";
         *  }
         *
         * }
         */

        DOORCTRLREQ doorGet = new DOORCTRLREQ();

        doorGet.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;
        doorGet.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_VIDEOCTRL;
        UNIDOORCTRL[] vtDoor;
        uResponse = m_Request.DoorCtrlSrv.GetDoorCtrl(doorGet, out vtDoor);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtDoor != null && vtDoor.Length > 0)
        {
            for (int i = 0; i < vtDoor.Length; i++)
            {
                UNIDOORCTRL doorCtrl = vtDoor[i];
                string      szID     = vtDoor[i].dwCtrlSN.ToString();
                if (szID == "0")
                {
                    szID = "roomid" + i.ToString();
                }
                string szName = vtDoor[i].szCtrlModel.ToString();

                m_szOut += "<input data-ctrlsn=\"" + doorCtrl.dwCtrlSN.ToString() + "\" data-ip=\"" + doorCtrl.szDCSIP.ToString() + "\" class=\"enum\" id=\"" + szID + "\" type=\"radio\" name=\"" + "szRoom" + "\" value=\"" + szID + "\" /> <label for=\"" + szID + "\">" + szName + "</label>";
            }
        }
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DCSREQ vrGet = new DCSREQ();

        UNIDCS[] vtRes;
        vrGet.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
        if (m_Request.DoorCtrlSrv.GetDCS(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            m_szOutDCS += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            for (int i = 0; i < vtRes.Length; i++)
            {
                m_szOutDCS += GetInputItemHtml(CONSTHTML.option, "", vtRes[i].szName.ToString(), vtRes[i].dwSN.ToString());
            }
        }
        uint dwDCSSN = Parse(Request["dwDCSSN"]);

        DOORCTRLREQ vrParameter = new DOORCTRLREQ();

        if (dwDCSSN != 0)
        {
            vrParameter.dwGetType = (uint)DCSREQ.DWGETTYPE.DCSGET_BYSN;
            vrParameter.szGetKey  = dwDCSSN.ToString();
        }
        else
        {
            vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;
        }
        UNIDOORCTRL[] vrResult;

        vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
        if (m_Request.DoorCtrlSrv.GetDoorCtrl(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td>" + vrResult[i].dwCtrlSN + "</td>";
                m_szOut += "<td>" + vrResult[i].dwDCSSN + "</td>";
                m_szOut += "<td>" + vrResult[i].szDCSName + "</td>";
                m_szOut += "<td class='lnkRoom' data-id='" + vrResult[i].szRoomNo + "'>" + vrResult[i].szRoomNo + "</td>";
                m_szOut += "<td class='lnkSta' data-id='" + vrResult[i].dwStaSN + "'>" + vrResult[i].szStaName + "</td>";
                m_szOut += "<td>" + vrResult[i].szMemo + "</td>";
                m_szOut += "<td><div class='OPTD'></div></td>";
                m_szOut += "</tr>";
            }
        }

        PutBackValue();
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            DOORCTRLREQ   vrParameter = new DOORCTRLREQ();
            UNIDOORCTRL[] vrResult;
            vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;
            vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
            if (m_Request.DoorCtrlSrv.GetDoorCtrl(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                System.IO.StringWriter swCSV = new System.IO.StringWriter();
                swCSV.WriteLine("集控器编号,控制器编号,门禁刷卡方向,名称");
                for (int i = 0; i < vrResult.Length; i++)
                {
                    uint uPropy = (uint)vrResult[i].dwCtrlKind;
                    System.Text.StringBuilder sbText = new System.Text.StringBuilder();
                    sbText = AppendCSVFields(sbText, vrResult[i].dwDCSSN.ToString());
                    sbText = AppendCSVFields(sbText, vrResult[i].dwCtrlSN.ToString());
                    sbText = AppendCSVFields(sbText, "InDoor");
                    sbText = AppendCSVFields(sbText, System.Web.HttpUtility.HtmlEncode(ConfigConst.GCSysKindRoom + ":" + vrResult[i].szRoomNo.ToString()));
                    //去掉尾部的逗号
                    sbText.Remove(sbText.Length - 1, 1);

                    //写datatable的一行
                    swCSV.WriteLine(sbText.ToString());
                    if ((uPropy & (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_DOUBLE) > 0)
                    {
                        System.Text.StringBuilder sbText1 = new System.Text.StringBuilder();
                        sbText1 = AppendCSVFields(sbText1, vrResult[i].dwDCSSN.ToString());
                        sbText1 = AppendCSVFields(sbText1, vrResult[i].dwCtrlSN.ToString());
                        sbText1 = AppendCSVFields(sbText1, "OutDoor");
                        sbText1 = AppendCSVFields(sbText1, System.Web.HttpUtility.HtmlEncode(ConfigConst.GCSysKindRoom + ":" + vrResult[i].szRoomNo.ToString()));
                        sbText1.Remove(sbText1.Length - 1, 1);
                        swCSV.WriteLine(sbText1.ToString());
                    }
                }
                DownloadFile(Response, swCSV.GetStringBuilder(), "门禁信息.csv");
                swCSV.Close();
                Response.End();
            }
        }
    }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        DOORCTRLREQ doorGet   = new DOORCTRLREQ();

        doorGet.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;
        doorGet.szGetKey  = Request["roomno"];
        doorGet.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_VIDEOCTRL;
        UNIDOORCTRL[] vtDoor;
        uResponse = m_Request.DoorCtrlSrv.GetDoorCtrl(doorGet, out vtDoor);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtDoor != null && vtDoor.Length > 0)
        {
            for (int i = 0; i < vtDoor.Length; i++)
            {
                if (vtDoor[i].szRoomNo != null && vtDoor[i].szRoomNo == Request["roomno"])
                {
                    ip.Value = vtDoor[i].szDCSIP.ToString();
                    sn.Value = vtDoor[i].dwCtrlSN.ToString();
                }
            }
        }
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DOORCTRLREQ vrParameter = new DOORCTRLREQ();

        UNIDOORCTRL[] vrResult;
        string        type = Request["dcsKind"];

        if (type == "1")
        {
            vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_DOORCTRL;
        }
        else if (type == "2")
        {
            vrParameter.dwDCSKind = (uint)UNIDCS.DWDCSKIND.DCSKIND_VIDEOCTRL;
        }

        vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;

        if (m_Request.DoorCtrlSrv.GetDoorCtrl(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td>" + vrResult[i].dwDCSSN + "</td>";
                m_szOut += "<td>" + vrResult[i].dwCtrlSN + "</td>";
                m_szOut += "<td>" + vrResult[i].szDCSName + "</td>";
                m_szOut += "<td class='lnkRoom' data-id='" + vrResult[i].szRoomNo + "'>" + vrResult[i].szRoomNo + "</td>";
                m_szOut += "<td class='lnkSta' data-id='" + vrResult[i].dwStaSN + "'>" + vrResult[i].szStaName + "</td>";
                m_szOut += "<td>" + vrResult[i].szMemo + "</td>";
                m_szOut += "<td><div class='OPTD'></div></td>";
                m_szOut += "</tr>";
            }
        }

        PutBackValue();
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        UNIDOORCTRL setDoorCtrl;
        string      szOp = Request["op"];
        uint?       uMax = 0;
        uint        uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_LAB_SET;

        if (GetMaxValue(ref uMax, uID, "dwLabID"))
        {
        }
        if (IsPostBack)
        {
            GetHTTPObj(out setDoorCtrl);
            uint uCtrlKind  = (uint)setDoorCtrl.dwCtrlKind;
            uint uCtrlKind2 = CharListToUint(Request["dwCtrlKind2"]);
            setDoorCtrl.dwCtrlKind = uCtrlKind + uCtrlKind2;
            UNIDCS dcs = new UNIDCS();
            if (GetDCSBySN(setDoorCtrl.dwDCSSN.ToString(), out dcs))
            {
                setDoorCtrl.dwStaSN   = dcs.dwStaSN;
                setDoorCtrl.szStaName = dcs.szStaName;
                setDoorCtrl.dwDCSKind = dcs.dwDCSKind;
            }
            if (szOp == "new")
            {
                if (m_Request.DoorCtrlSrv.SetDoorCtrl(setDoorCtrl, out setDoorCtrl) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "新建失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("新建成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }
            else
            {
                if (m_Request.DoorCtrlSrv.SetDoorCtrl(setDoorCtrl, out setDoorCtrl) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("修改成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }
        }
        m_KindProperty = GetAllInputHtml(CONSTHTML.checkBox, "dwCtrlKind2", "UNIDOORCTRL_CtrlKind2");
        m_dwKind       = GetAllInputHtml(CONSTHTML.option, "", "UNIDOORCTRL_CtrlKind");
        DCSREQ vrDcsReq = new DCSREQ();

        vrDcsReq.dwDCSKind = uDCSKIND;
        UNIDCS[] vtDcs;
        uResponse = m_Request.DoorCtrlSrv.GetDCS(vrDcsReq, out vtDcs);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtDcs != null && vtDcs.Length > 0)
        {
            for (int i = 0; i < vtDcs.Length; i++)
            {
                szDCS += GetInputItemHtml(CONSTHTML.option, "", vtDcs[i].szName.ToString(), vtDcs[i].dwSN.ToString());
            }
        }
        if (Request["op"] == "set")
        {
            DOORCTRLREQ doorReq = new DOORCTRLREQ();
            doorReq.dwDCSKind = uDCSKIND;
            doorReq.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYSN;
            doorReq.szGetKey  = Request["dwSN"];
            UNIDOORCTRL[] door;
            uResponse = m_Request.DoorCtrlSrv.GetDoorCtrl(doorReq, out door);
            if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && door != null && door.Length > 0)
            {
                uint   uCtrlKind   = (uint)door[0].dwCtrlKind;
                string szCtrlKind1 = "";
                if ((uCtrlKind & (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_ROOM) > 0)
                {
                    szCtrlKind1 = ((uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_ROOM).ToString();
                }
                else if ((uCtrlKind & (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_CHANNELGATE) > 0)
                {
                    szCtrlKind1 = ((uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_CHANNELGATE).ToString();
                }
                else if ((uCtrlKind & (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_POWERCTRL) > 0)
                {
                    szCtrlKind1 = ((uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_POWERCTRL).ToString();
                }

                ViewState["szCtrlKind1"] = szCtrlKind1;
                string    szCtrlKind2 = "";
                ArrayList list2       = GetListFromXml("UNIDOORCTRL_CtrlKind2", uCtrlKind, false);
                for (int i = 0; i < list2.Count; i++)
                {
                    CStatue temp = (CStatue)list2[i];
                    szCtrlKind2 += temp.szValue + ",";
                }
                ViewState["szCtrlKind2"] = szCtrlKind2;
                PutHTTPObj(door[0]);
            }
            m_Title = "修改控制器";
        }
        else
        {
            m_Title = "新建控制器";
        }
    }
示例#9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIROOM newRoom;
        uint?   uMax = 0;
        uint    uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_DEVICE_SET;

        if (GetMaxValue(ref uMax, uID, "szRoomNo"))
        {
        }
        if (IsPostBack)
        {
            GetHTTPObj(out newRoom);
            string szManMode = Request["dwManMode"];
            newRoom.dwManMode = CharListToUint(szManMode);
            if (newRoom.dwManGroupID == null || newRoom.dwManGroupID.ToString() == "0")
            {
                UNIGROUP newGroup = new UNIGROUP();
                if (!NewGroup(newRoom.szRoomName + "管理员组", (uint)UNIGROUP.DWKIND.GROUPKIND_MAN, out newGroup))
                {
                    MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                    DelGroup(newGroup.dwGroupID);
                    return;
                }
                newRoom.dwManGroupID = newGroup.dwGroupID;
            }
            UNILAB setLab = new UNILAB();
            setLab.dwLabID      = newRoom.dwLabID;
            setLab.dwManGroupID = newRoom.dwManGroupID;
            setLab.dwDeptID     = newRoom.dwDeptID;
            setLab.szDeptName   = newRoom.szDeptName;
            setLab.szLabName    = newRoom.szRoomName;
            setLab.szLabSN      = newRoom.szRoomNo;

            if (m_Request.Device.LabSet(setLab, out setLab) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                if (m_Request.Device.RoomSet(newRoom, out newRoom) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("修改" + ConfigConst.GCRoomName + "成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }
        }
        DOORCTRLREQ vrParameter = new DOORCTRLREQ();
        uint        uRoomMode   = (uint)(UNIROOM.DWMANMODE.ROOMMAN_CAMERA | UNIROOM.DWMANMODE.ROOMMAN_DOORLOCK | UNIROOM.DWMANMODE.ROOMMAN_FREEINOUT);

        m_szRoomMode          = GetInputHtml(uRoomMode, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode");
        vrParameter.dwDCSKind = (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_ROOM;
        vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;

        UNILAB[] vtLab = GetAllLab();
        if (vtLab != null && vtLab.Length > 0)
        {
            for (int i = 0; i < vtLab.Length; i++)
            {
                m_szLab += "<option value='" + vtLab[i].dwLabID + "'>" + vtLab[i].szLabName + "</option>";
            }
        }
        DEVOPENRULE[] vtOpenRule = GetAllOpenRule();
        if (vtOpenRule != null && vtOpenRule.Length > 0)
        {
            for (int i = 0; i < vtOpenRule.Length; i++)
            {
                m_szOpenRule += "<option value='" + vtOpenRule[i].dwRuleSN + "'>" + vtOpenRule[i].szRuleName + "</option>";
            }
        }

        if (Request["op"] == "set")
        {
            bSet = true;

            ROOMREQ vrRoomReq = new ROOMREQ();
            vrRoomReq.dwRoomID = ToUint(Request["roomid"]);
            UNIROOM[] vtRoom;
            if (m_Request.Device.RoomGet(vrRoomReq, out vtRoom) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtRoom.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtRoom[0]);
                    m_Title = "修改【" + vtRoom[0].szRoomName + "】";
                }
            }
        }
        else
        {
            UNISTATION station = new UNISTATION();
            station.dwStaSN = uMax;
            PutJSObj(station);
            m_Title = "新建" + ConfigConst.GCRoomName;
        }
    }
示例#10
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIROOM newRoom;
        uint?   uMax = 0;
        uint    uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_DEVICE_SET;

        if (GetMaxValue(ref uMax, uID, "szRoomNo"))
        {
        }
        UNICAMPUS[] vtCamp = GetAllCampus();
        for (int i = 0; i < vtCamp.Length; i++)
        {
            szCamp += GetInputItemHtml(CONSTHTML.option, "", vtCamp[i].szCampusName, vtCamp[i].dwCampusID.ToString());
        }
        if (IsPostBack)
        {
            GetHTTPObj(out newRoom);
            string szManMode = Request["dwManMode"];
            string scprop    = Request["scprop"];
            uint   usxprop   = CharListToUint(scprop);

            newRoom.dwManMode = CharListToUint(szManMode);
            if (newRoom.dwManGroupID == null || newRoom.dwManGroupID.ToString() == "0")
            {
                UNIGROUP newGroup = new UNIGROUP();
                if (!NewGroup(newRoom.szRoomName + "管理员组", (uint)UNIGROUP.DWKIND.GROUPKIND_MAN, out newGroup))
                {
                    MessageBox(m_Request.szErrMessage, "修改区域失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                    DelGroup(newGroup.dwGroupID);
                    return;
                }
                newRoom.dwManGroupID = newGroup.dwGroupID;
            }
            UNILAB setLab = new UNILAB();
            setLab.dwLabID      = newRoom.dwLabID;
            setLab.dwManGroupID = newRoom.dwManGroupID;
            setLab.dwDeptID     = newRoom.dwDeptID;
            setLab.szDeptName   = newRoom.szDeptName;
            setLab.szLabName    = newRoom.szRoomName;
            setLab.szLabSN      = newRoom.szRoomNo;
            setLab.dwLabClass   = newRoom.dwInClassKind;

            newRoom.dwCampusID = Parse(Request["dwCampusID"]);

            uint        uLabID   = 0;
            REQUESTCODE uRespnse = REQUESTCODE.DBERR_FAILED;
            if (ConfigConst.GCICLabRoom == 1)
            {
                uRespnse = REQUESTCODE.EXECUTE_SUCCESS;
                uLabID   = Parse(Request["dwLabID"]);
            }
            else
            {
                uRespnse = m_Request.Device.LabSet(setLab, out setLab);
                if (uRespnse != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "修改区域失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
            }
            if (uRespnse == REQUESTCODE.EXECUTE_SUCCESS)
            {
                newRoom.dwLabID = uLabID;
                uint uPropMode = 0;
                if (newRoom.dwProperty != null)
                {
                    uPropMode = (uint)newRoom.dwProperty;
                }
                uPropMode          = uPropMode | Parse(Request["propyMode"]) | Parse(Request["prop"]);
                uPropMode          = uPropMode | usxprop;
                newRoom.dwProperty = uPropMode;
                newRoom.szFloorNo  = (Parse(Request["floorNOPre"]) * 1000 + Parse(Request["floorNONext"])).ToString();
                if (m_Request.Device.RoomSet(newRoom, out newRoom) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "修改区域失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("修改区域成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }
        }
        DOORCTRLREQ vrParameter = new DOORCTRLREQ();
        uint        uRoomMode   = (uint)(UNIROOM.DWMANMODE.ROOMMAN_CAMERA | UNIROOM.DWMANMODE.ROOMMAN_DOORLOCK | UNIROOM.DWMANMODE.ROOMMAN_FREEINOUT);

        m_szRoomMode          = GetInputHtml(uRoomMode, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode");
        vrParameter.dwDCSKind = (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_ROOM;
        vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;

        UNILAB[] vtLab = GetAllLab();
        if (vtLab != null && vtLab.Length > 0)
        {
            for (int i = 0; i < vtLab.Length; i++)
            {
                m_szLab += "<option value='" + vtLab[i].dwLabID + "'>" + vtLab[i].szLabName + "</option>";
            }
        }
        DEVOPENRULE[] vtOpenRule = GetAllOpenRule();
        if (vtOpenRule != null && vtOpenRule.Length > 0)
        {
            for (int i = 0; i < vtOpenRule.Length; i++)
            {
                m_szOpenRule += "<option value='" + vtOpenRule[i].dwRuleSN + "'>" + vtOpenRule[i].szRuleName + "</option>";
            }
        }

        if (Request["op"] == "set")
        {
            bSet = true;

            ROOMREQ vrRoomReq = new ROOMREQ();
            vrRoomReq.dwRoomID = ToUint(Request["roomid"]);
            UNIROOM[] vtRoom;
            if (m_Request.Device.RoomGet(vrRoomReq, out vtRoom) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtRoom.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtRoom[0]);
                    m_Title = "修改【" + vtRoom[0].szRoomName + "】";
                    uint uRoomProp = (uint)vtRoom[0].dwProperty;
                    uint uRoomPrp2 = (uint)vtRoom[0].dwProperty;
                    uint uPropMode = 0;
                    if ((uRoomProp & ((uint)UNIROOM.DWPROPERTY.ROOMPROPHP_AUTOGATE)) > 0)
                    {
                        uPropMode = (uint)UNIROOM.DWPROPERTY.ROOMPROPHP_AUTOGATE;
                    }
                    else if ((uRoomProp & ((uint)UNIROOM.DWPROPERTY.ROOMPROPHP_IP)) > 0)
                    {
                        uPropMode = (uint)UNIROOM.DWPROPERTY.ROOMPROPHP_IP;
                    }
                    if (vtRoom[0].szFloorNo != null)
                    {
                        uint uFloorNo = Parse((vtRoom[0].szFloorNo));
                        PutMemberValue("floorNOPre", (uFloorNo / 1000).ToString());
                        PutMemberValue("floorNONext", (uFloorNo % 1000).ToString());
                    }
                    PutMemberValue("propyMode", uPropMode.ToString());
                    PutMemberValue("prop", (uRoomProp & 0x800000).ToString());
                    PutMemberValue("noresv", (uRoomPrp2 & 16).ToString());
                    PutMemberValue("nocheck", (uRoomPrp2 & 32).ToString());
                    PutMemberValue("noleaveout", (uRoomProp & 64).ToString());
                    PutMemberValue("noend", (uRoomPrp2 & 128).ToString());
                }
            }
        }
        else
        {
            UNISTATION station = new UNISTATION();
            station.dwStaSN = uMax;
            PutJSObj(station);
            m_Title = "新建区域";
        }
    }
示例#11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIROOM newRoom;
        uint?   uMax = 0;
        uint    uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_DEVICE_SET;

        if (GetMaxValue(ref uMax, uID, "szRoomNo"))
        {
        }
        UNIGROUP[] manGroup = GetGroupByKind((uint)UNIGROUP.DWKIND.GROUPKIND_MAN);
        if (manGroup != null && manGroup.Length > 0)
        {
            for (int i = 0; i < manGroup.Length; i++)
            {
                szManGroup += GetInputItemHtml(CONSTHTML.option, "", manGroup[i].szName, manGroup[i].dwGroupID.ToString());
            }
        }
        szManModeList = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode", true);
        if (IsPostBack)
        {
            GetHTTPObj(out newRoom);
            newRoom.dwInClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_COMPUTER;
            string szManMode = Request["dwManMode"];
            newRoom.dwManMode = CharListToUint(szManMode);
            if (newRoom.dwManGroupID == null || newRoom.dwManGroupID.ToString() == "0")
            {
                UNIGROUP newGroup = new UNIGROUP();
                if (!NewGroup(newRoom.szRoomName + "管理员组", (uint)UNIGROUP.DWKIND.GROUPKIND_MAN, out newGroup))
                {
                    MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                    DelGroup(newGroup.dwGroupID);
                    return;
                }
                newRoom.dwManGroupID = newGroup.dwGroupID;
            }
            if (ConfigConst.GroomNumMode == 1)
            {
                uint uManGroupID2 = Parse(Request["manGroupID2"]);
                newRoom.dwManGroupID = uManGroupID2;
            }
            {
                if (string.IsNullOrEmpty(newRoom.szRoomURL))
                {
                    newRoom.szMemo    = "";
                    newRoom.szRoomURL = "";
                }
                string szProperty = Request["dwProp"];
                if (szProperty != null && szProperty == "1")
                {
                    newRoom.dwProperty = (uint)UNIROOM.DWPROPERTY.ROOMPROP_NORESV;
                }
                else if (szProperty == null)
                {
                    newRoom.dwProperty = 0;
                }
                if (m_Request.Device.RoomSet(newRoom, out newRoom) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("修改" + ConfigConst.GCRoomName + "成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }
        }
        DOORCTRLREQ vrParameter = new DOORCTRLREQ();
        uint        uRoomMode   = (uint)(UNIROOM.DWMANMODE.ROOMMAN_CAMERA | UNIROOM.DWMANMODE.ROOMMAN_DOORLOCK | UNIROOM.DWMANMODE.ROOMMAN_FREEINOUT);

        m_szRoomMode          = GetInputHtml(uRoomMode, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode");
        vrParameter.dwDCSKind = (uint)UNIDOORCTRL.DWCTRLKIND.DCKIND_ROOM;
        vrParameter.dwGetType = (uint)DOORCTRLREQ.DWGETTYPE.DOORCTRLGET_BYALL;

        UNILAB[] vtLab = GetAllLab();
        if (vtLab != null && vtLab.Length > 0)
        {
            for (int i = 0; i < vtLab.Length; i++)
            {
                m_szLab += "<option value='" + vtLab[i].dwLabID + "'>" + vtLab[i].szLabName + "</option>";
            }
        }
        DEVOPENRULE[] vtOpenRule = GetAllOpenRule();
        if (vtOpenRule != null && vtOpenRule.Length > 0)
        {
            for (int i = 0; i < vtOpenRule.Length; i++)
            {
                m_szOpenRule += "<option value='" + vtOpenRule[i].dwRuleSN + "'>" + vtOpenRule[i].szRuleName + "</option>";
            }
        }

        if (Request["op"] == "set")
        {
            bSet = true;

            ROOMREQ vrRoomReq = new ROOMREQ();
            vrRoomReq.dwRoomID = ToUint(Request["roomid"]);
            UNIROOM[] vtRoom;
            if (m_Request.Device.RoomGet(vrRoomReq, out vtRoom) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtRoom.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtRoom[0]);
                    m_Title = "修改【" + vtRoom[0].szRoomName + "】";
                    if (ConfigConst.GroomNumMode == 1)
                    {
                        PutMemberValue("manGroupID2", vtRoom[0].dwManGroupID.ToString());
                    }
                    uint?uProp = vtRoom[0].dwProperty;
                    if (uProp != null && (uProp & (uint)UNIROOM.DWPROPERTY.ROOMPROP_NORESV) > 0)
                    {
                        PutMemberValue("dwProp", "1");
                    }
                }
            }
        }
        else
        {
            UNISTATION station = new UNISTATION();
            station.dwStaSN = uMax;
            PutJSObj(station);
            m_Title = "新建" + ConfigConst.GCRoomName;
        }
    }