예제 #1
0
    private void InitKinds(uint classkind)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        DEVKINDREQ  req       = new DEVKINDREQ();

        if (classkind != 0)
        {
            req.dwClassKind = classkind;
        }
        UNIDEVKIND[] rlt;
        itemList += "<ul>";
        uResponse = m_Request.Device.DevKindGet(req, out rlt);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && rlt != null && rlt.Length > 0)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                if (rlt[i].szMemo != null && rlt[i].szMemo == "false")
                {
                    continue;
                }
                UNIDEVKIND kind = rlt[i];
                itemList += "<li>" + kind.szKindName + "(ID:" + kind.dwKindID + ")&nbsp;<a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(介绍)") + "&type=kind_intro&id=" + kind.dwKindID + "' target='_blank'>介绍</a> / <a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(硬件配置)") + "&type=kind_hard&id=" + kind.dwKindID + "' target='_blank'>硬件配置</a> / <a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(相册)") + "&type=kind_slide&id=" + kind.dwKindID + "' target='_blank'>相册</a>" +
                            " / <a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(预约须知)") + "&type=kind_rule&id=" + kind.dwKindID + "' target='_blank'>须知</a>" + ((availMobile & 5) > 0 ? " / <a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(移动端介绍)") + "&type=kind_mIntro&id=" + kind.dwKindID + "' target='_blank'>(移动端)介绍</a>" : "") + "</li>";
            }
        }
        itemList += "</ul>";
    }
예제 #2
0
    private void DelDevKind(string szID)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        DEVKINDREQ  vrGet     = new DEVKINDREQ();

        UNIDEVKIND[] vtDevKind;
        vrGet.dwKindID = ToUint(szID);
        uResponse      = m_Request.Device.DevKindGet(vrGet, out vtDevKind);
        if (uResponse != REQUESTCODE.EXECUTE_SUCCESS || vtDevKind == null || vtDevKind.Length == 0)
        {
            MessageBox(m_Request.szErrMessage, "提示", MSGBOX.ERROR);
            return;
        }
        {//同时删除devclass
            UNIDEVCLS devClass = new UNIDEVCLS();
            devClass.dwClassID = vtDevKind[0].dwClassID;
            uResponse          = m_Request.Device.DevClsDel(devClass);
        }
        UNIDEVKIND devKind = new UNIDEVKIND();

        devKind   = vtDevKind[0];
        uResponse = m_Request.Device.DevKindDel(devKind);
        if (uResponse != REQUESTCODE.EXECUTE_SUCCESS)
        {
            MessageBox(m_Request.szErrMessage, "提示", MSGBOX.ERROR);
        }
    }
예제 #3
0
    private void InitDev(UNIDEVICE dev)
    {
        UNIDEVKIND kind = GetDevKind(dev.dwKindID);

        if (kind.dwKindID != null)
        {
            uint clsKind = ToUInt(GetConfig("openClsKind"));
            if (clsKind != 0 && !IsStat(kind.dwClassKind, clsKind))
            {
                noResv      = "none";
                Cld.Disable = "true";   //不使用
                return;
            }
            Cld.ClassKind = kind.dwClassKind.ToString();

            if (GetConfig("resvAllDay") == "1" && (kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0)
            {
                Cld.IsLong = "true";
            }
            if ((kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV) > 0)
            {
                Cld.IsKind = "true";
            }
        }
        Cld.Dev     = dev.dwDevID.ToString();
        Cld.SrcType = "dev";
    }
예제 #4
0
    private void Del(string szID, string szLabID)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        UNIDEVKIND  devKind   = new UNIDEVKIND();
        UNIDEVICE   dev;

        if (getDevByID(szID, out dev))
        {
            devKind.dwKindID = dev.dwKindID;
            uResponse        = m_Request.Device.DevKindDel(devKind);
            if (uResponse != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "提示", MSGBOX.ERROR);
                return;
            }
            UNIDEVICE obj = new UNIDEVICE();
            obj.dwDevID = Parse(szID);
            obj.dwLabID = Parse(szLabID);
            uResponse   = m_Request.Device.Del(dev);
        }

        if (uResponse != REQUESTCODE.EXECUTE_SUCCESS)
        {
            MessageBox(m_Request.szErrMessage, "提示", MSGBOX.ERROR);
        }
    }
예제 #5
0
    private void InitKind(string id)
    {
        UNIDEVKIND kind = GetDevKind(ToUInt(id));

        if (kind.dwKindID != null)
        {
            //info
            devProFactory = ConvertStr(kind.szProducer);
            devProPlace   = ConvertStr(kind.dwNationCode);//must custom
            CurKindName   = kind.szKindName;
            //
            uint clsKind = ToUInt(GetConfig("openClsKind"));
            if (clsKind != 0 && !IsStat(kind.dwClassKind, clsKind))
            {
                noResv      = "none";
                Cld.Disable = "true";//不使用
                return;
            }
            Cld.ClassKind = kind.dwClassKind.ToString();
            if (GetConfig("resvAllDay") == "1" && (kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0)
            {
                Cld.IsLong = "true";
            }
        }
        Cld.IsKind  = "true";
        Cld.KindId  = id;
        Cld.SrcType = "kind";
    }
예제 #6
0
    private void InitCld()
    {
        Cld.SrcType = "rm";
        Cld.Disable = "true";
        if (Request["disable"] == "true")
        {
            noResv = "none";
            return;
        }
        string resvStateMode = GetConfig("resvStateMode");//兼容旧20150915前
        uint   fpClsKind     = ToUInt(GetConfig("floorPlanClsKind"));
        DEVREQ req           = new DEVREQ();

        req.szRoomIDs = roomId.Value;
        UNIDEVICE[] rlt;
        if (m_Request.Device.Get(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt.Length > 0)
        {
            UNIDEVKIND kind = GetDevKind(rlt[0].dwKindID);
            if (kind.dwKindID != null)
            {
                if (clsKind != 0 && !IsStat(kind.dwClassKind, clsKind))
                {
                    noResv = "none";
                    return;
                }
                Cld.Disable = "false";
                Cld.RoomId  = roomId.Value;
                //平面图
                if ((resvStateMode == "1" && fpClsKind == 0) || (fpClsKind & kind.dwClassKind) > 0)
                {
                    Cld.DisplayMode = "fp";
                    string path = ToUploadUrl("DevImg/FloorPlan/rm" + roomId.Value + ".jpg");
                    Cld.Img = path;
                    if (!File.Exists(Server.MapPath(path)))
                    {
                        MsgBox("缺少平面图<br/>" + path);
                    }
                }
                else
                {//列表
                    Cld.DisplayMode = "dlg";
                    Cld.ClassKind   = kind.dwClassKind.ToString();
                    if (GetConfig("resvAllDay") == "1" && (kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0)
                    {
                        Cld.IsLong = "true";
                    }
                    if ((kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV) > 0)
                    {
                        Cld.IsKind = "true";
                    }
                    else
                    {
                        Cld.IsKind = "false";
                    }
                }
            }
        }
    }
예제 #7
0
 private bool bDevClsFalse(UNIDEVKIND devkind, UNIDEVCLS[] devclsRes)
 {
     for (int i = 0; i < devclsRes.Length; i++)
     {
         if (devkind.dwClassID == devclsRes[i].dwClassID && devclsRes[i].szMemo != null && devclsRes[i].szMemo == "false")
         {
             return(true);
         }
     }
     return(false);
 }
예제 #8
0
 private void InitCld()
 {
     if ((mode & 2) > 0)
     {
         Cld.KindId  = infoId.Value;
         Cld.SrcType = "kind";
         UNIDEVKIND kind = GetDevKind(ToUInt(infoId.Value));
         if (kind.dwProperty != null && kind.dwProperty > 0)
         {
             if ((kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0 && GetConfig("resvAllDay") == "1")
             {
                 Cld.IsLong = "true";
             }
             if ((kind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV) > 0)
             {
                 Cld.IsKind = "true";
             }
         }
     }
     else
     {
         Cld.DevClassId = infoId.Value;
         Cld.SrcType    = "cls";
         DEVKINDREQ req = new DEVKINDREQ();
         if (!string.IsNullOrEmpty(classKind.Value) && classKind.Value != "0")
         {
             req.dwClassKind = ToUInt(classKind.Value);
         }
         UNIDEVKIND[] kinds;
         if (m_Request.Device.DevKindGet(req, out kinds) == REQUESTCODE.EXECUTE_SUCCESS && kinds.Length > 0)
         {
             for (int i = 0; i < kinds.Length; i++)
             {
                 if (kinds[i].dwClassID == ToUInt(infoId.Value))
                 {
                     if ((kinds[i].dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0 && GetConfig("resvAllDay") == "1")
                     {
                         Cld.IsLong = "true";
                     }
                     if ((kinds[i].dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV) > 0)
                     {
                         Cld.IsKind = "true";
                     }
                     break;
                 }
             }
         }
     }
     Cld.ClassKind = classKind.Value;
     Cld.Width     = Request["w"];
 }
예제 #9
0
    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];
            UNIDEVKIND kind = GetDevKind(dev.dwKindID);
            Session["CUR_DEV"] = vtResult[0];
        }
    }
예제 #10
0
파일: GetDev.cs 프로젝트: NingMoe/UniICWeb
    public bool GetDevKindByID(string szID, out UNIDEVKIND devKind)
    {
        devKind = new UNIDEVKIND();
        DEVKINDREQ vrDevKindGet = new DEVKINDREQ();

        vrDevKindGet.dwKindID = ToUint(szID);
        UNIDEVKIND[] vtDevKind;
        REQUESTCODE  uRes = m_Request.Device.DevKindGet(vrDevKindGet, out vtDevKind);

        if (uRes == REQUESTCODE.EXECUTE_SUCCESS && vtDevKind != null && vtDevKind.Length > 0)
        {
            devKind = vtDevKind[0];
            return(true);
        }
        return(false);
    }
예제 #11
0
    private void GetKindList()
    {
        DEVKINDREQ req = new DEVKINDREQ();

        req.szReqExtInfo.szOrderKey  = "szKindName";
        req.szReqExtInfo.szOrderMode = "ASC";
        UNIDEVKIND[] rlt;
        m_Request.Device.DevKindGet(req, out rlt);
        if (rlt != null)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                UNIDEVKIND kind = rlt[i];
                itemList += "<li it='" + kind.dwKindID + "' url='atydetail.aspx?kindId=" + kind.dwKindID + "'><a>" + kind.szKindName + "</a></li>";
            }
        }
    }
예제 #12
0
    private bool NewDevKind(out UNIDEVKIND setDevKind)
    {
        setDevKind = new UNIDEVKIND();
        GetHTTPObj(out setDevKind);
        setDevKind.szKindName = Request["szDevName"];
        if (setDevKind.dwClassID == null || setDevKind.dwClassID == 0)
        {
            return(false);
        }
        setDevKind.dwProperty = CharListToUint(Request["dwKindProperty"]);
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;

        uResponse = m_Request.Device.DevKindSet(setDevKind, out setDevKind);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            return(true);
        }
        return(false);
    }
예제 #13
0
    private void InitRuleList()
    {
        string ruleType = GetConfig("needToKnow");

        if (ruleType == "3")
        {
            DEVKINDREQ req = new DEVKINDREQ();
            itemList += "<div class='line'></div><h2>类型预约须知</h2><ul>";
            UNIDEVKIND[] rlt;
            if (m_Request.Device.DevKindGet(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt != null && rlt.Length > 0)
            {
                for (int i = 0; i < rlt.Length; i++)
                {
                    UNIDEVKIND kind = rlt[i];
                    itemList += "<li>" + kind.szKindName + "(ID:" + kind.dwKindID + ")&nbsp;" +
                                "<a href='editcontent.aspx?name=" + Server.UrlEncode(kind.szKindName + "(预约须知)") + "&type=kind_rule&id=" + kind.dwKindID + "' target='_blank'>预约须知</a></li>";
                }
            }
            itemList += "</ul>";
        }
    }
예제 #14
0
    private void InitKinds()
    {
        string     classkind = Request["classkind"];
        DEVKINDREQ req       = new DEVKINDREQ();

        req.dwClassKind = ToUInt(classkind);
        UNIDEVKIND[] rlt;
        if (m_Request.Device.DevKindGet(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length == 1)
            {
                hideKind = "hidden";
            }
            for (int i = 0; i < rlt.Length; i++)
            {
                UNIDEVKIND kind = rlt[i];
                qkKind += "<li><label class='label-radio item-content'><input type='radio' name='kind_id' value='" + kind.dwKindID + "'" + (i == 0 ? " checked='checked'" : "") + ">"
                          + "<div class='item-inner'><div class='item-title'>" + kind.szKindName + "</div></div></label></li>";
            }
        }
    }
예제 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIDEVICE newDev;
        uint?     uMax = 0;
        uint      uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_DEVICE_SET;

        if (GetMaxValue(ref uMax, uID, "dwDevSN"))
        {
        }
        if (IsPostBack)
        {
            GetHTTPObj(out newDev);
            newDev.dwDevSN        = GetDevSN();
            newDev.dwProperty     = CharListToUint(Request["dwProperty"]) + CharListToUint(Request["dwKindProperty"]);
            newDev.dwPurchaseDate = DateToUint(Request["dwPurchaseDate"]);
            newDev.szExtInfo      = GetDevExt();
            UNIDEVKIND devKind = new UNIDEVKIND();
            if (!NewDevKind(out devKind))
            {
                MessageBox(m_Request.szErrMessage, "新建" + ConfigConst.GCDevName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                return;
            }
            newDev.dwKindID = devKind.dwKindID;
            UNIGROUP newUseGroup;
            if (NewGroup(newDev.szDevName.ToString() + "使用组", (uint)UNIGROUP.DWKIND.GROUPKIND_DEV, out newUseGroup))
            {
                newDev.dwUseGroupID = newUseGroup.dwGroupID;
            }
            if (m_Request.Device.Set(newDev, out newDev) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "新建" + ConfigConst.GCDevName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                m_Request.Device.DevKindDel(devKind);
                return;
            }
            else
            {
                MessageBox("新建" + ConfigConst.GCDevName + "成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);

                DEVATTENDANT devAttendSet = new DEVATTENDANT();
                devAttendSet.dwAttendantID   = Parse(Request["dwAttendantID"]);
                devAttendSet.dwDevID         = newDev.dwDevID;
                devAttendSet.dwLabID         = newDev.dwLabID;
                devAttendSet.szAttendantName = Request["szAttendantName"];
                devAttendSet.szAttendantTel  = Request["szAttendantTel"];
                m_Request.Device.AttendantSet(devAttendSet);
                return;
            }
        }
        m_szCtrlMode = GetAllInputHtml(CONSTHTML.option, "", "UNIDEVICE_CtrlMode");
        UNIADMIN[] adminlist;
        if (GetAdmin(out adminlist) == true)
        {
            for (int i = 0; i < adminlist.Length; i++)
            {
                m_szManager += "<option value='" + adminlist[i].dwAccNo.ToString() + "'>" + adminlist[i].szTrueName + "</option>";
            }
        }
        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>";
            }
        }

        UNIROOM[] vtRoom = GetAllRoom();
        if (vtRoom != null && vtRoom.Length > 0)
        {
            for (int i = 0; i < vtRoom.Length; i++)
            {
                m_szRoom += "<option value='" + vtRoom[i].dwRoomID + "'>" + vtRoom[i].szRoomName + "</option>";
            }
        }

        UNIDEVCLS[] vtDevCls = GetAllDevCls();
        if (vtDevCls != null && vtDevCls.Length > 0)
        {
            for (int i = 0; i < vtDevCls.Length; i++)
            {
                m_szDevCls += "<option value='" + vtDevCls[i].dwClassID + "'>" + vtDevCls[i].szClassName + "</option>";
            }
        }
        m_szPorperty     = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "dwProperty", "UNIDEVICE_Property", true);
        m_szKindPorperty = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "dwKindProperty", "DevKind_dwProperty", true);
        if (Request["op"] == "set")
        {
            bSet = true;

            DEVREQ vrDevReq = new DEVREQ();
            vrDevReq.dwDevID = Parse(Request["id"]);
            UNIDEVICE[] vtDev;
            if (m_Request.Device.Get(vrDevReq, out vtDev) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtDev.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtDev[0]);
                    m_Title = "修改【" + vtDev[0].szPCName + "】";
                }
            }
        }
        else
        {
            m_Title = "新建" + ConfigConst.GCDevName;
        }
    }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIROOM newRoom;
        uint?   uMax    = 0;
        uint    uDevNum = Parse(Request["DevNum"]);
        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);
            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;
            UNIDEVCLS[] vtDevCls = GetDevCLSName(newRoom.szLabName.ToString());
            if (!(vtDevCls != null && vtDevCls.Length > 0))
            {
                return;
            }
            UNIDEVKIND setDevKind = new UNIDEVKIND();
            setDevKind.szKindName = newRoom.szRoomName;
            setDevKind.dwClassID  = vtDevCls[0].dwClassID;
            setDevKind.dwProperty = (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_EXCLUSIVE;
            setDevKind.dwMaxUsers = 10000;
            setDevKind.dwMinUsers = 1;
            if (m_Request.Device.DevKindSet(setDevKind, out setDevKind) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "新建" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                return;
            }
            if (m_Request.Device.RoomSet(newRoom, out newRoom) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "新建" + ConfigConst.GCRoomName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                for (int i = 0; i < uDevNum; i++)
                {
                    UNIDEVICE setDev = new UNIDEVICE();
                    setDev.szDevName  = newRoom.szRoomName + "(" + (i + 1) + ")";
                    setDev.dwDevSN    = GetDevSN();
                    setDev.dwRoomID   = newRoom.dwRoomID;
                    setDev.dwKindID   = setDevKind.dwKindID;
                    setDev.dwCtrlMode = (uint)UNIDEVICE.DWCTRLMODE.DEVCTRL_BYHAND;
                    m_Request.Device.Set(setDev, out setDev);
                }
                MessageBox("新建" + ConfigConst.GCRoomName + "成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                if (Session["LoginResult"] != null)
                {
                    ADMINLOGINRES admin = (ADMINLOGINRES)Session["LoginResult"];
                    AddGroupMember(newGroup.dwGroupID, admin.AdminInfo.dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL);
                }
                return;
            }
        }

        uint uRoomMode = (uint)(UNIROOM.DWMANMODE.ROOMMAN_CAMERA | UNIROOM.DWMANMODE.ROOMMAN_DOORLOCK | UNIROOM.DWMANMODE.ROOMMAN_FREEINOUT);

        m_szRoomMode = GetInputHtml(uRoomMode, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode");
        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["id"]);
            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;
        }
    }
예제 #17
0
    private void InitDevInfo(string id)
    {
        UNIDEVICE[] vtResult = GetDevById(id);
        if (vtResult == null || vtResult.Length == 0)
        {
            return;
        }
        UNIDEVICE  dev  = vtResult[0];
        UNIDEVKIND kind = GetDevKind(dev.dwKindID);

        devNum            = dev.szAssertSN;
        devName.InnerText = dev.szDevName;
        CurDevName        = dev.szDevName;
        devModel          = dev.szModel;
        devUsers          = dev.dwMinUsers + (dev.dwMinUsers == dev.dwMaxUsers?"":" - " + dev.dwMaxUsers);
        if (dev.dwPurchaseDate != null && dev.dwPurchaseDate > 10000000)
        {
            string str = dev.dwPurchaseDate.ToString();
            devDate = str.Substring(0, 4) + "-" + str.Substring(4, 2) + "-" + str.Substring(6, 2);
        }
        devProFactory    = ConvertStr(kind.szProducer);
        devProPlace      = ConvertStr(kind.dwNationCode);//must custom
        devCam           = dev.szCampusName;
        devCol           = dev.szDeptName;
        deploy           = dev.szExtInfo;
        devLoc.InnerHtml = dev.szLabName + " , " + dev.szRoomName;
        imgUrl           = GetImg(dev.dwDevSN);
        //预约信息
        UNIRESVRULE rule = GetDevRsvRule(dev.dwDevID.ToString());

        //仪器状态
        if (Converter.GetDevStat(dev.dwDevStat))
        {
            devSta = Converter.GetDevRunStat(dev.dwRunStat);
        }
        else
        {
            devSta = "<span class='red'>" + Translate("仪器不可用") + "</span>";
        }
        //获取管理员
        //GROUPMEMDETAIL[] mbs = GetMembers(dev.dwManGroupID);
        //if (mbs != null && mbs.Length > 0)
        //{
        //    for (int i = 0; i < mbs.Length; i++)
        //    {
        //        devMan.InnerHtml += mbs[i].szTrueName + "&nbsp;&nbsp;";
        //        devCon.InnerHtml += mbs[i].szHandPhone + "&nbsp;&nbsp;";
        //    }
        //}
        //else
        //{
        devMan.InnerHtml = dev.szAttendantName;
        devCon.InnerHtml = dev.szAttendantTel;
        //}
        //初始化
        if (Request["disable"] != "true")
        {
            InitDev(dev);
        }
        else
        {
            noResv      = "none";
            Cld.Disable = "true";
        }
    }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIDEVICE newDev;
        uint?     uMax = 0;
        uint      uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_DEVICE_SET;

        if (GetMaxValue(ref uMax, uID, "dwDevSN"))
        {
        }
        if (IsPostBack)
        {
            GetHTTPObj(out newDev);
            newDev.dwProperty     = CharListToUint(Request["dwProperty"]);
            newDev.dwPurchaseDate = DateToUint(Request["dwPurchaseDate"]);
            newDev.szExtInfo      = GetDevExt();
            UNIDEVKIND devKind = new UNIDEVKIND();
            if (GetDevKindByID(newDev.dwKindID.ToString(), out devKind))
            {
                devKind.dwClassID = newDev.dwClassID;
                if (m_Request.Device.DevKindSet(devKind, out devKind) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    return;
                }
            }

            //newDev.dwKindID = devKind.dwKindID;
            if (m_Request.Device.Set(newDev, out newDev) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCDevName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                /*
                 * if (!NewDevKind(out devKind))
                 * {
                 *  MessageBox(m_Request.szErrMessage, "修改" + ConfigConst.GCDevName + "失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                 *  return;
                 * }
                 * */
                MessageBox("修改" + ConfigConst.GCDevName + "成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                DEVATTENDANT devAttendSet = new DEVATTENDANT();
                devAttendSet.dwAttendantID = Parse(Request["dwAttendantID"]);
                devAttendSet.dwDevID       = newDev.dwDevID;
                devAttendSet.dwLabID       = newDev.dwLabID;
                if (devAttendSet.dwAttendantID != null)
                {
                    UNIACCOUNT acc;
                    if (GetAccByAccno(devAttendSet.dwAttendantID.ToString(), out acc))
                    {
                        devAttendSet.szAttendantName = acc.szTrueName;
                    }
                }

                devAttendSet.szAttendantTel = Request["szAttendantTel"];
                m_Request.Device.AttendantSet(devAttendSet);
                return;
            }
        }
        m_szCtrlMode = GetAllInputHtml(CONSTHTML.option, "", "UNIDEVICE_CtrlMode");

        ACCREQ accGet = new ACCREQ();

        accGet.dwIdent = (uint)UNIACCOUNT.DWIDENT.EXTIDENT_MANAGER;
        UNIACCOUNT[] vtAcc;
        m_Request.Account.Get(accGet, out vtAcc);
        if (vtAcc != null && vtAcc.Length > 0)
        {
            for (int i = 0; i < vtAcc.Length; i++)
            {
                m_szManager += "<option value='" + vtAcc[i].dwAccNo.ToString() + "'>" + vtAcc[i].szTrueName + "</option>";
            }
        }

        UNIADMIN[] adminlist;
        if (GetAdmin(out adminlist) == true)
        {
        }

        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>";
            }
        }

        UNIROOM[] vtRoom = GetAllRoom();
        if (vtRoom != null && vtRoom.Length > 0)
        {
            for (int i = 0; i < vtRoom.Length; i++)
            {
                m_szRoom += "<option value='" + vtRoom[i].dwRoomID + "'>" + vtRoom[i].szRoomName + "</option>";
            }
        }

        UNIDEVCLS[] vtDevCls = GetAllDevCls();
        if (vtDevCls != null && vtDevCls.Length > 0)
        {
            for (int i = 0; i < vtDevCls.Length; i++)
            {
                m_szDevCls += "<option value='" + vtDevCls[i].dwClassID + "'>" + vtDevCls[i].szClassName + "</option>";
            }
        }
        UNIDEVKIND[] vtDevKind = GetAllDevKind();
        if (vtDevKind != null && vtDevKind.Length > 0)
        {
            for (int i = 0; i < vtDevKind.Length; i++)
            {
                m_szDevKind += "<option value='" + vtDevKind[i].dwKindID + "'>" + vtDevKind[i].szKindName + "</option>";
            }
        }
        m_szPorperty     = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "dwProperty", "UNIDEVICE_Property", true);
        m_szKindPorperty = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "dwKindProperty", "DevKind_dwProperty", true);
        if (Request["op"] == "set")
        {
            bSet = true;
            DEVREQ vrDevReq = new DEVREQ();
            vrDevReq.dwDevID = Parse(Request["id"]);
            UNIDEVICE[] vtDev;
            if (m_Request.Device.Get(vrDevReq, out vtDev) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtDev.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtDev[0]);
                    ContDevExt(vtDev[0].szExtInfo.ToString());
                    UNIDEVKIND getDevKind = new UNIDEVKIND();
                    if (vtDev[0].dwKindID != null && GetDevKindByID(vtDev[0].dwKindID.ToString(), out getDevKind))
                    {
                        ViewState["dwKindProperty"] = UintToCharList(getDevKind.dwProperty, "DevKind_dwProperty");
                        ViewState["dwUsableNum"]    = getDevKind.dwUsableNum.ToString();
                        ViewState["szProducer"]     = getDevKind.szProducer.ToString();
                        ViewState["szNation"]       = getDevKind.dwNationCode.ToString();
                    }
                    m_Title = "修改【" + vtDev[0].szPCName + "】";
                }
            }
        }
        else
        {
            m_Title = "新建" + ConfigConst.GCDevName;
        }
    }
예제 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            DEVKINDREQ yardReq = new DEVKINDREQ();
            if (Request["dwLabID"] != null)
            {
                yardReq.dwExtRelatedID = Parse(Request["dwLabID"].ToString());
                UNIDEVKIND[] vtYard = new UNIDEVKIND[1];
                if (m_Request.Device.DevKindGet(yardReq, out vtYard) == REQUESTCODE.EXECUTE_SUCCESS && vtYard != null && vtYard.Length > 0)
                {
                    UNIADMIN newAdmin;
                    GetHTTPObj(out newAdmin);
                    uint uManroleTemp = 0;
                    uint uRoleArea    = 0;
                    uint ucheck       = 0;
                    uint uProperty    = (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DEVMAN;// uProperty CharListToUint(Request["dwProperty"]);

                    /*
                     * if ((uProperty & 536870912) > 0)
                     * {
                     *  uManroleTemp=(uint)ADMINLOGINRES.DWMANROLE.MANROLE_LEADER;//领导
                     *  uRoleArea = (uint)ADMINLOGINRES.DWMANROLE.MANSCOPE_STATION;
                     *  //uProperty = uProperty - 536870912;
                     * }
                     * else{
                     *
                     * }
                     * if ((uProperty & 1073741824) > 0)
                     * {
                     *  //uProperty = uProperty - 1073741824;
                     * }
                     * else {
                     *  ucheck = (uint)ADMINLOGINRES.DWMANROLE.MANIDENT_EANDA;
                     * }
                     */
                    newAdmin.dwProperty = uProperty;

                    uManroleTemp = (uint)ADMINLOGINRES.DWMANROLE.MANROLE_OPERATOR;
                    uRoleArea    = (uint)ADMINLOGINRES.DWMANROLE.MANSCOPE_ROOM;

                    if (!((newAdmin.dwProperty & (uint)UNIADMIN.DWPROPERTY.ADMINPROP_SYS) > 0))
                    {
                        newAdmin.dwProperty = newAdmin.dwProperty | (uint)UNIADMIN.DWPROPERTY.ADMINPROP_SYS;
                    }
                    newAdmin.dwManRole = uRoleArea + uManroleTemp + ucheck + (uint)ADMINLOGINRES.DWMANROLE.MANIDENT_ADMIN;
                    if (m_Request.Admin.Set(newAdmin, out newAdmin) != REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        MessageBox(m_Request.szErrMessage, "新建失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                        return;
                    }
                    else
                    {
                        UNIACCOUNT setAcount;
                        if (GetAccByAccno(newAdmin.dwAccNo.ToString(), out setAcount))
                        {
                            setAcount.szHandPhone = newAdmin.szHandPhone;
                            m_Request.Account.Set(setAcount, out setAcount);
                        }
                        ArrayList list = new ArrayList();
                        if (vtYard != null)
                        {
                            string szDevKinds = "";
                            for (int i = 0; i < vtYard.Length; i++)
                            {
                                szDevKinds += vtYard[i].dwKindID.ToString() + ",";
                                if (((i + 1) % 10) == 0)
                                {
                                    if (szDevKinds.EndsWith(","))
                                    {
                                        szDevKinds = szDevKinds.Substring(0, szDevKinds.Length - 1);
                                    }
                                    DEVREQ devReq = new DEVREQ();
                                    devReq.szKindIDs = szDevKinds;
                                    UNIDEVICE[] vtDev;
                                    if (m_Request.Device.Get(devReq, out vtDev) == REQUESTCODE.EXECUTE_SUCCESS && vtDev != null && vtDev.Length > 0)
                                    {
                                        for (int m = 0; m < vtDev.Length; m++)
                                        {
                                            UNIROOM setRoom;
                                            if (GetRoomID(vtDev[m].dwRoomID.ToString(), out setRoom))
                                            {
                                                AddGroupMember(setRoom.dwManGroupID, newAdmin.dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL);
                                            }
                                        }
                                        szDevKinds = "";
                                    }
                                }
                            }
                        }
                        MessageBox("新建成功", "新建成功", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                        return;
                    }
                }
            }
            else
            {
                MessageBox("获取不到该场景对应的房间", "新建失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                return;
            }
        }


        {
            m_Title = "新建场景管理员";
        }
    }
예제 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIBUILDING[] vtBuliding  = getAllBuilding();
        string        szIsOutDoor = Request["isOutDoor"];

        for (int i = 0; i < vtBuliding.Length; i++)
        {
            sz_building += GetInputItemHtml(CONSTHTML.option, "", vtBuliding[i].szBuildingName, vtBuliding[i].dwBuildingID.ToString());
        }
        UNIDEVCLS[] vtClass = GetAllDevCls();
        for (int i = 0; i < vtClass.Length; i++)
        {
            sz_DevCls += GetInputItemHtml(CONSTHTML.option, "", vtClass[i].szClassName, vtClass[i].dwClassID.ToString());
        }
        UNILAB[] vtLab = GetAllLab();
        for (int i = 0; i < vtLab.Length; i++)
        {
            sz_Lab += GetInputItemHtml(CONSTHTML.option, "", vtLab[i].szLabName, vtLab[i].dwLabID.ToString());
        }
        if (IsPostBack)
        {
            UNIDEVICE setDevice;
            GetHTTPObj(out setDevice);
            UNIROOM setRoom;
            setDevice.dwDevSN = Parse(setDevice.szAssertSN);
            GetHTTPObj(out setRoom);
            if (m_Request.Device.Set(setDevice, out setDevice) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                if (GetRoomID(setDevice.dwRoomID.ToString(), out setRoom))
                {
                    setRoom.szRoomName   = setDevice.szDevName;
                    setRoom.szRoomNo     = setDevice.szAssertSN;
                    setRoom.dwLabID      = setDevice.dwLabID;
                    setRoom.dwBuildingID = setDevice.dwBuildingID;
                    if (m_Request.Device.RoomSet(setRoom, out setRoom) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        UNIDEVKIND setKind = new UNIDEVKIND();
                        if (GetDevKindByID(setDevice.dwKindID.ToString(), out setKind))
                        {
                            setKind.dwKindID   = setDevice.dwKindID;
                            setKind.szKindName = setDevice.szDevName;
                            setKind.dwMinUsers = 1;
                            setKind.dwMaxUsers = setDevice.dwMaxUsers;
                            uint uNum = Parse(Request["num"]);
                            if (szIsOutDoor != null && uNum != 0)
                            {
                                setKind.dwProperty   = (uint)setKind.dwProperty | (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE;
                                setKind.dwMaxUsers   = (setKind.dwMaxUsers) * uNum;
                                setKind.dwNationCode = uNum;
                            }
                            else
                            {
                                if (((uint)setKind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE) > 0)
                                {
                                    setKind.dwProperty = (uint)setKind.dwProperty - (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE;
                                }
                            }
                            setKind.dwClassID = setDevice.dwClassID;
                            if (m_Request.Device.DevKindSet(setKind, out setKind) == REQUESTCODE.EXECUTE_SUCCESS)
                            {
                                MessageBox("修改成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                                return;
                            }
                            else
                            {
                                MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                                return;
                            }
                        }
                    }
                    else
                    {
                        MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                        return;
                    }
                }
                else
                {
                    MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                    return;
                }
            }
        }

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

            DEVREQ vrGet = new DEVREQ();
            string devID = Request["id"];
            vrGet.dwDevID = Parse(Request["id"]);
            UNIDEVICE[] vtDev;
            if (m_Request.Device.Get(vrGet, out vtDev) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtDev.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    UNIDEVKIND devKind;
                    if (GetDevKindByID(vtDev[0].dwKindID.ToString(), out devKind))
                    {
                        if (((uint)devKind.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE) > 0)
                        {
                            PutMemberValue("isOutDoor", "1");
                            sz_Share = "1";
                            if (devKind.dwNationCode != null)
                            {
                                PutMemberValue("num", devKind.dwNationCode.ToString());
                            }
                            else
                            {
                                PutMemberValue("num", "0");
                            }
                            vtDev[0].dwMaxUsers = ((uint)vtDev[0].dwMaxUsers) / (uint)devKind.dwNationCode;
                        }

                        PutMemberValue("isOutDoor", "0");
                    }

                    PutJSObj(vtDev[0]);
                    m_Title = "修改【" + vtDev[0].szDevName + "】";
                }
            }
        }
        else
        {
            m_Title = "新建";
        }
    }
예제 #21
0
    private void SyRoom(DataSet dsTable)
    {
        int            uAll        = 0;
        int            uUnSy       = 0;
        int            uADD        = 0;
        int            uAddSuccse  = 0;
        int            uAddFail    = 0;
        int            uSet        = 0;
        int            uSetSuccse  = 0;
        int            uSetFail    = 0;
        DEVOPENRULE    setOpenRule = new DEVOPENRULE();
        DEVOPENRULEREQ vrOpenRule  = new DEVOPENRULEREQ();

        DEVOPENRULE[] devOpenRule;
        if (m_Request.Device.DevOpenRuleGet(vrOpenRule, out devOpenRule) == REQUESTCODE.EXECUTE_SUCCESS && devOpenRule != null && devOpenRule.Length > 0)
        {
            setOpenRule = devOpenRule[0];
        }
        else
        {
            Logger.trace("对应的开放规则不存在");
        }
        UNICAMPUS[]   camp        = GetAllCampus();
        UNIBUILDING[] allBuilding = getAllBuilding();
        UNIDEPT[]     allDept     = GetAllDept();
        UNIROOM[]     allRoom     = GetAllRoom();
        UNILAB[]      allLab      = GetAllLab();
        UNIDEVCLS[]   allDevClass = GetAllDevCls();
        UNIDEVKIND[]  allDevKind  = GetAllDevKind();
        UNIDEVICE[]   allDev;
        GetAllDev(out allDev);
        if (camp == null || camp.Length == 0)
        {
            Logger.trace("校区内容为空 不同步房间");
            return;
        }
        if (allLab == null || allLab.Length == 0)
        {
            Logger.trace("实验室内容为空 不同步房间");
            return;
        }
        if (allBuilding == null || allBuilding.Length == 0)
        {
            Logger.trace("楼宇内容为空 不同步房间");
            return;
        }
        if (allDevClass == null || allDevClass.Length == 0)
        {
            Logger.trace("楼宇类型为空 不同步房间");
            return;
        }
        DataTable dtRoom = new DataTable();

        dtRoom = dsTable.Tables[0];
        uAll   = dtRoom.Rows.Count;
        Logger.trace("allroomList" + allRoom.Length);
        for (int op = 0; op < allRoom.Length; op++)
        {
            UNIROOM setRoom = new UNIROOM();
            setRoom = allRoom[op];
            if (setRoom.dwBuildingID != null && setRoom.dwBuildingID.ToString() != "" && setRoom.dwBuildingID.ToString() != "0")
            {
                continue;
            }
            Logger.trace("房间需要设置楼宇" + setRoom.szRoomName);
            string szRoomNameObj = setRoom.szRoomName;
            for (int i = 0; i < dtRoom.Rows.Count; i++)
            {
                string szRoomName = "";
                if (dtRoom.Rows[i]["room_name"] != null)
                {
                    szRoomName = dtRoom.Rows[i]["room_name"].ToString();
                }
                string szRoomNo = "";
                if (dtRoom.Rows[i]["room_no"] != null)
                {
                    szRoomNo = dtRoom.Rows[i]["room_no"].ToString();
                }
                if (!(szRoomName.IndexOf(szRoomNo) > -1))
                {
                    szRoomName = szRoomName + szRoomNo;
                }
                string szBulidingName = "";
                if (szRoomNameObj == szRoomName)
                {
                    szBulidingName = dtRoom.Rows[i]["house_name"].ToString();
                }
                bool bRead = false;
                if (szBulidingName != "")
                {
                    Logger.trace("房间需要设置楼宇" + setRoom.szRoomName + szBulidingName);
                    for (int n = 0; n < allBuilding.Length; n++)
                    {
                        if (szBulidingName == allBuilding[n].szBuildingName.ToString())
                        {
                            Logger.trace("找到对应房间需要设置楼宇" + setRoom.szRoomName + szBulidingName);
                            setRoom.dwBuildingID = allBuilding[n].dwBuildingID;
                            m_Request.Device.RoomSet(setRoom, out setRoom);
                            Logger.trace("房间所在楼宇设置成功");
                            bRead = true;
                            break;
                        }
                    }
                }
                if (bRead)
                {
                    break;
                }
            }
        }
        // return;


        Logger.trace("dtRoom.Rows.Count.ToString()" + dtRoom.Rows.Count.ToString());
        for (int i = 0; i < dtRoom.Rows.Count; i++)
        {
            string szRoomName = "";
            if (dtRoom.Rows[i]["room_name"] != null)
            {
                szRoomName = dtRoom.Rows[i]["room_name"].ToString();
            }
            string szRoomNo = "";
            if (dtRoom.Rows[i]["room_no"] != null)
            {
                szRoomNo = dtRoom.Rows[i]["room_no"].ToString();
            }
            if (!(szRoomName.IndexOf(szRoomNo) > -1))
            {
                szRoomName = szRoomName + szRoomNo;
            }
            string szRoomNameCamp = szRoomName + "(" + dtRoom.Rows[i]["campus_name"].ToString() + ")";
            bool   bbread         = false;
            for (int j = 0; j < allRoom.Length; j++)
            {
                UNIROOM setRoom = new UNIROOM();

                setRoom = allRoom[j];
                //Logger.trace("房间所在楼宇设置已存在"+setRoom.szRoomName);
                if (setRoom.dwBuildingID != null)
                {
                    //Logger.trace("房间所在楼宇设置已存在");
                    continue;
                }
                if (GetRoomByName(szRoomName, out setRoom))
                {
                    // Logger.trace("房间所在楼宇设置开始" + setRoom.szRoomName);

                    string szBuilding = dtRoom.Rows[i]["house_name"].ToString();
                    for (int n = 0; n < allBuilding.Length; n++)
                    {
                        if (szBuilding == allBuilding[n].szBuildingName.ToString())
                        {
                            Logger.trace("找到房间所在楼宇设置开始" + setRoom.szRoomName);
                            setRoom.dwBuildingID = allBuilding[n].dwBuildingID;
                            m_Request.Device.RoomSet(setRoom, out setRoom);
                            // Logger.trace("房间所在楼宇设置成功");
                            break;
                        }
                    }
                }
                else
                {
                    //  szRoomName = szRoomName + "(" + dtRoom.Rows[i]["campus_name"].ToString() + ")";
                    string szBuilding = dtRoom.Rows[i]["house_name"].ToString();
                    if (GetRoomByName(szRoomNameCamp, out setRoom))
                    {
                    }
                }
                if (bbread)
                {
                    break;
                }
            }
        }
        //return;
        //
        for (int i = 0; i < dtRoom.Rows.Count; i++)
        {
            string szCampName = "";
            if (dtRoom.Rows[i]["campus_name"] != null)
            {
                szCampName = dtRoom.Rows[i]["campus_name"].ToString();
            }
            string szDeptName = "";
            if (dtRoom.Rows[i]["department_name"] != null)
            {
                szDeptName = dtRoom.Rows[i]["department_name"].ToString();
            }
            if (szDeptName == "")
            {
                uUnSy = uUnSy + 1;
                Logger.trace("房间对应的实验室名称为空 不同步房间,第三方部门名称:" + dtRoom.Rows[i]["room_name"].ToString() + "保存为其他" + szDeptName);
                szDeptName = "上海财经大学";
                //continue;
            }
            string szBuidlName = "";
            if (dtRoom.Rows[i]["house_name"] != null)
            {
                szBuidlName = dtRoom.Rows[i]["house_name"].ToString();
            }
            if (szBuidlName == "")
            {
                uUnSy = uUnSy + 1;
                Logger.trace("房间对应的楼宇名称为空 不同步房间,第三方房间名称:" + szBuidlName);
                continue;
            }
            UNILAB setLab      = new UNILAB();
            UNILAB setOtherLab = new UNILAB();
            for (int m = 0; m < allLab.Length; m++)
            {
                if (allLab[m].szLabName.ToString() == szDeptName)
                {
                    setLab = allLab[m];
                    break;
                }
                if (allLab[m].szLabName.ToString() == "其他")
                {
                    setOtherLab = allLab[m];
                }
            }
            if (setLab.dwLabID == null)
            {
                if (setOtherLab.dwLabID != null)
                {
                    setLab = setOtherLab;
                }
                else
                {
                    /*
                     * UNILAB tempLab;
                     * if (GetLabByID(100661724, out tempLab))
                     * {
                     *  uUnSy = uUnSy + 1;
                     *  Logger.trace("房间对应的实验室不存在 不同步房间,第三方部门名称:" + szDeptName);
                     *  setLab = tempLab;
                     * }
                     */
                    uUnSy = uUnSy + 1;
                    Logger.trace("房间对应的实验室不存在 不同步房间,第三方部门名称:" + szDeptName);
                    continue;
                }
            }
            UNIBUILDING setBuliding = new UNIBUILDING();
            for (int m = 0; m < allBuilding.Length; m++)
            {
                if (allBuilding[m].szBuildingName.ToString() == szBuidlName)
                {
                    setBuliding = allBuilding[m];
                    break;
                }
            }
            if (setBuliding.dwBuildingID == null)
            {
                uUnSy = uUnSy + 1;
                Logger.trace("房间对应的楼宇名称为空 不同步房间,第三方房间名称:" + szBuidlName);
                continue;
            }
            string szDevClssName = "";
            if (dtRoom.Rows[i]["classroom_type_name"] != null)
            {
                if (dtRoom.Rows[i]["classroom_type_name"].ToString() == "")
                {
                    szDevClssName = "空白";
                }
                else
                {
                    szDevClssName = dtRoom.Rows[i]["classroom_type_name"].ToString();
                }
            }
            UNIDEVCLS setDevClass = new UNIDEVCLS();
            for (int m = 0; m < allDevClass.Length; m++)
            {
                if (allDevClass[m].szClassName.ToString() == szDevClssName)
                {
                    setDevClass = allDevClass[m];
                    break;
                }
            }
            if (setDevClass.dwClassID == null)
            {
                uUnSy = uUnSy + 1;
                Logger.trace("房间对应的类型不存在 不同步房间:" + szDevClssName);
                continue;
            }

            string szRoomName = "";
            if (dtRoom.Rows[i]["room_name"] != null)
            {
                szRoomName = dtRoom.Rows[i]["room_name"].ToString();
            }

            uint uMaxUser = 1;
            if (dtRoom.Rows[i]["seat_amt"] != null)
            {
                uMaxUser = Parse(dtRoom.Rows[i]["seat_amt"].ToString());
            }
            string szRoomNo = "";
            if (dtRoom.Rows[i]["room_no"] != null)
            {
                szRoomNo = dtRoom.Rows[i]["room_no"].ToString();
            }
            if (!(szRoomName.IndexOf(szRoomNo) > -1))
            {
                szRoomName = szRoomName + szRoomNo;
            }
            UNIDEVKIND setDevKind         = new UNIDEVKIND();
            UNIDEVKIND setDevKindCampName = new UNIDEVKIND();
            bool       bAddKind           = true;
            bool       bAddKindCampName   = true;
            for (int m = 0; allDevKind != null && m < allDevKind.Length; m++)
            {
                if (allDevKind[m].szProducer == dtRoom.Rows[i]["room_code"].ToString())
                {
                    for (int k = 0; k < allDevKind.Length; k++)
                    {
                        if (allDevKind[k].szKindName == szRoomName)
                        {
                            bAddKind         = false;
                            bAddKindCampName = false;
                            setDevKind       = allDevKind[k];
                            break;
                        }
                    }
                }
            }
            if (bAddKind)
            {
                setDevKind.dwClassID  = setDevClass.dwClassID;
                setDevKind.dwMaxUsers = uMaxUser;
                setDevKind.dwMinUsers = 1;
                setDevKind.szKindName = szRoomName;
                setDevKind.szProducer = dtRoom.Rows[i]["room_code"].ToString();
                setDevKind.dwProperty = (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_EXCLUSIVE;
                setDevKindCampName    = setDevKind;
                if (m_Request.Device.DevKindSet(setDevKind, out setDevKind) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    //uAddSuccse = uAddSuccse + 1;
                    Logger.trace("房间对应的类型新建成功:" + szRoomName);
                    allDevKind = GetAllDevKind();
                }
                else
                {
                    // uAddFail = uAddFail + 1;
                    Logger.trace("房间对应的类型新建失败:" + m_Request.szErrMessage.ToString());
                    if (m_Request.szErrMessage.ToString().IndexOf("已存在") > -1)
                    {
                        szRoomName            = szRoomName + "(" + szCampName + ")";
                        setDevKind.szKindName = szRoomName;
                        if (m_Request.Device.DevKindSet(setDevKindCampName, out setDevKindCampName) == REQUESTCODE.EXECUTE_SUCCESS)
                        {
                            Logger.trace("房间对应的类型新建成功-添加校区名:" + szRoomName);
                            allDevKind = GetAllDevKind();
                        }
                        else
                        {
                            Logger.trace("房间对应的类型新建失败-添加校区名:" + szRoomName);
                            continue;
                        }
                    }
                }
            }
            else
            {
                if (!((((uint)setDevKind.dwProperty) & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE) > 0))
                {
                    if (uMaxUser > 0)
                    {
                        setDevKind.dwMaxUsers = uMaxUser;
                    }
                    else
                    {
                        setDevKind.dwMaxUsers = 1;
                    }
                    setDevKind.dwMinUsers = 1;
                    setDevKind.dwMaxUsers = uMaxUser;
                    setDevKind.szProducer = dtRoom.Rows[i]["room_code"].ToString();
                    if (m_Request.Device.DevKindSet(setDevKind, out setDevKind) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        Logger.trace(setDevKind.dwKindID + "房间类型修改成功:" + setDevKind.dwMaxUsers + szRoomName);

                        allDevKind = GetAllDevKind();
                    }
                    else
                    {
                        Logger.trace("房间类型修改失败:" + m_Request.szErrMessage + szRoomName);
                    }
                }
                else
                {
                    setDevKind.dwMinUsers = 1;
                    setDevKind.szProducer = dtRoom.Rows[i]["room_code"].ToString();

                    setDevKind.szKindName = szRoomName;
                    if (m_Request.Device.DevKindSet(setDevKind, out setDevKind) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        Logger.trace("房间类型修改成功:" + szRoomName);
                        allDevKind = GetAllDevKind();
                    }
                    else
                    {
                        Logger.trace("房间类型修改失败:" + m_Request.szErrMessage + szRoomName);
                    }
                }
                //  uSet = uSet + 1;
            }
            string szRoomCode = "";
            if (dtRoom.Rows[i]["room_code"] != null)
            {
                szRoomCode = dtRoom.Rows[i]["room_code"].ToString();
            }
            uint uRoomSize = 0;
            if (dtRoom.Rows[i]["build_area"] != null)
            {
                uRoomSize = Parse(dtRoom.Rows[i]["build_area"].ToString());
            }
            UNIROOM newRoom         = new UNIROOM();
            UNIROOM newRoomCampName = new UNIROOM();
            bool    bNewRoom        = true;
            UNIROOM bExistRoom      = new UNIROOM();
            for (int k = 0; k < allRoom.Length; k++)
            {
                if (allRoom[k].szRoomNo == szRoomCode)
                {
                    //if (allRoom[k].szRoomNo == szRoomCode)
                    {
                        bExistRoom = allRoom[k];
                        bNewRoom   = false;
                        break;
                    }
                }
            }
            if (!bNewRoom)
            {
                uint   uOldBuilding = (uint)bExistRoom.dwBuildingID;
                string szOldName    = bExistRoom.szRoomName;
                if (bExistRoom.dwBuildingID != setBuliding.dwBuildingID)
                {
                    bExistRoom.dwBuildingID = setBuliding.dwBuildingID;
                    if (m_Request.Device.RoomSet(bExistRoom, out bExistRoom) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        Logger.trace("房间所在楼宇变动" + uOldBuilding.ToString() + "改为" + setBuliding.dwBuildingID.ToString());
                    }
                }
                if (bExistRoom.szRoomName != szRoomName)
                {
                    bExistRoom.szRoomName   = szRoomName;
                    bExistRoom.dwBuildingID = setBuliding.dwBuildingID;
                    if (m_Request.Device.RoomSet(bExistRoom, out bExistRoom) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        Logger.trace("房间名称变动" + szOldName.ToString() + "改为" + szRoomName.ToString());
                    }
                }
            }
            if (bNewRoom)
            {
                newRoom.szRoomName   = szRoomName;
                newRoom.dwBuildingID = setBuliding.dwBuildingID;
                //newRoom.dwCampusID = setBuliding.dwCampusID;
                newRoom.dwCampusID = Parse(dtRoom.Rows[i]["CAMPUS_CODE"].ToString());
                newRoom.dwLabID    = setLab.dwLabID;

                newRoom.dwRoomSize = uRoomSize;
                newRoom.szRoomNo   = szRoomCode;
                DEVOPENRULE newOpenRule = new DEVOPENRULE();
                if (newOpenRuleSN(setOpenRule, out newOpenRule, szRoomName))
                {
                    newRoom.dwOpenRuleSN = newOpenRule.dwRuleSN;
                }
                else
                {
                    Logger.trace("开放规则新建成功:" + m_Request.szErrMessage);
                    newRoom.dwOpenRuleSN = setOpenRule.dwRuleSN;
                }
                UNIGROUP manGroup = new UNIGROUP();
                if (NewGroup(szRoomName, (uint)UNIGROUP.DWKIND.GROUPKIND_MAN, out manGroup))
                {
                    Logger.trace("房间对应的管理员新建成功:");
                    newRoom.dwManGroupID = manGroup.dwGroupID;
                }
                else
                {
                    Logger.trace("房间对应的管理员新建失败" + ";" + m_Request.szErrMessage.ToString());
                    continue;
                }
                newRoomCampName = newRoom;

                if (m_Request.Device.RoomSet(newRoom, out newRoom) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    Logger.trace("房间新建成功" + szRoomName);
                    allRoom = GetAllRoom();
                }
                else
                {
                    uAddFail = uAddFail + 1;
                    Logger.trace("房间新建失败:" + szRoomName + ";" + m_Request.szErrMessage.ToString());
                    szRoomName = szRoomName + "(" + szCampName + ")";
                    newRoomCampName.szRoomName = szRoomName;
                    if (m_Request.szErrMessage.IndexOf("已存在") > -1)
                    {
                        if (m_Request.Device.RoomSet(newRoomCampName, out newRoomCampName) == REQUESTCODE.EXECUTE_SUCCESS)
                        {
                            Logger.trace("房间新建成功" + szRoomName);
                            allRoom = GetAllRoom();
                        }
                        else
                        {
                            Logger.trace("房间新建失败:" + szRoomName + ";" + m_Request.szErrMessage.ToString());

                            continue;
                        }
                    }
                }
            }
            GetAllDev(out allDev);
            UNIDEVICE setDev  = new UNIDEVICE();
            bool      bAddDev = true;
            for (int m = 0; m < allDev.Length; m++)
            {
                if (allDev[m].dwDevSN.ToString() == szRoomCode)
                {
                    setDev  = allDev[m];
                    bAddDev = false;
                    break;
                }
            }
            if (bAddDev)
            {
                setDev.szDevName = szRoomName;
                setDev.dwRoomID  = newRoom.dwRoomID;
                setDev.dwKindID  = setDevKind.dwKindID;
                uint uDevSN = Parse(szRoomCode);
                if (uDevSN == 0)
                {
                    uDevSN = (uint)newRoom.dwRoomID;
                }
                setDev.dwDevSN    = uDevSN;
                setDev.szAssertSN = uDevSN.ToString();
                if (setDev.dwRoomID == null || setDev.dwRoomID == 0)
                {
                    Logger.trace("房间编号为空或者0:" + setDev.szDevName.ToString());
                    continue;
                }
                if (m_Request.Device.Set(setDev, out setDev) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    uAddSuccse = uAddSuccse + 1;
                    Logger.trace("房间新建成功:" + setDev.szDevName.ToString());
                }
                else
                {
                    uAddFail = uAddFail + 1;
                    Logger.trace("房间新建失败:" + szRoomName + m_Request.szErrMessage.ToString());
                }
            }
            else
            {
                setDev.dwRoomID = newRoom.dwRoomID;
                setDev.dwKindID = setDevKind.dwKindID;
                uint uDevSN = Parse(szRoomCode);
                if (uDevSN == 0)
                {
                    uDevSN = (uint)newRoom.dwRoomID;
                }
                setDev.dwDevSN    = uDevSN;
                setDev.szDevName  = szRoomName;
                setDev.szAssertSN = uDevSN.ToString();
                if (m_Request.Device.Set(setDev, out setDev) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    uSetSuccse = uSetSuccse + 1;
                    Logger.trace("房间更新成功:" + setDev.szDevName.ToString());
                }
                else
                {
                    uSetFail = uSetFail + 1;
                    Logger.trace("房间更新失败:" + m_Request.szErrMessage.ToString());
                }
            }
        }
        Logger.trace("房间总共需同步数据:" + uAll + ";新建数据" + uADD + ";新建成功:" + uAddSuccse + ";新建失败:" + uAddFail + ";更新总数据:" + uSet + ";更新成功:" + uSetSuccse + ";更新失败:" + uSetFail);
    }
예제 #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szOpName = "新建";

        if (Request["op"] == "set")
        {
            bSet     = true;
            szOpName = "修改";
        }
        UNIROOM newRoom;

        CODINGTABLE[] vtCodeTable = getCodeTableByType((uint)CODINGTABLE.DWCODETYPE.CODE_LABKIND);
        if (vtCodeTable != null && vtCodeTable.Length > 0)
        {
            for (int i = 0; i < vtCodeTable.Length; i++)
            {
                m_szLabKind += GetInputItemHtml(CONSTHTML.option, "", vtCodeTable[i].szCodeName, vtCodeTable[i].szCodeSN.ToString());
            }
        }
        vtCodeTable = getCodeTableByType((uint)CODINGTABLE.DWCODETYPE.CODE_LABFROM);
        if (vtCodeTable != null && vtCodeTable.Length > 0)
        {
            for (int i = 0; i < vtCodeTable.Length; i++)
            {
                m_szLabFromCode += GetInputItemHtml(CONSTHTML.option, "", vtCodeTable[i].szCodeName, vtCodeTable[i].szCodeSN.ToString());
            }
        }
        vtCodeTable = getCodeTableByType((uint)CODINGTABLE.DWCODETYPE.CODE_ACADEMICSUBJECT);
        if (vtCodeTable != null && vtCodeTable.Length > 0)
        {
            for (int i = 0; i < vtCodeTable.Length; i++)
            {
                m_dwDecam += GetInputItemHtml(CONSTHTML.option, "", vtCodeTable[i].szCodeName, vtCodeTable[i].szCodeSN.ToString());
            }
        }
        vtCodeTable = getCodeTableByType((uint)CODINGTABLE.DWCODETYPE.CODE_LABLEVEL);
        if (vtCodeTable != null && vtCodeTable.Length > 0)
        {
            for (int i = 0; i < vtCodeTable.Length; i++)
            {
                m_szLabLevelCode += GetInputItemHtml(CONSTHTML.option, "", vtCodeTable[i].szCodeName, vtCodeTable[i].szCodeSN.ToString());
            }
        }

        if (IsPostBack)
        {
            GetHTTPObj(out newRoom);
            UNILAB setLab = new UNILAB();
            GetHTTPObj(out setLab);
            string szManMode = Request["dwManMode"];
            newRoom.dwManMode = CharListToUint(szManMode);
            if (bSet == true)
            {
                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;
                setLab.dwManGroupID  = newGroup.dwGroupID;
            }
            CAMPUSREQ campGet = new CAMPUSREQ();

            setLab.dwDeptID   = newRoom.dwDeptID;
            setLab.szDeptName = newRoom.szDeptName;
            setLab.szLabName  = newRoom.szRoomName;
            setLab.szLabSN    = newRoom.szRoomNo;
            setLab.dwLabClass = newRoom.dwInClassKind;
            UNICAMPUS[] vtCampres;
            if (!bSet)
            {
                if (m_Request.Account.CampusGet(campGet, out vtCampres) == REQUESTCODE.EXECUTE_SUCCESS && vtCampres != null && vtCampres.Length > 0)
                {
                    newRoom.dwCampusID = vtCampres[0].dwCampusID;
                }
            }
            if (m_Request.Device.LabSet(setLab, out setLab) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, szOpName + "实验室失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                if (Request["dwRoomSize"] != null && newRoom.dwRoomSize != null)
                {
                    newRoom.dwRoomSize = (uint)newRoom.dwRoomSize;
                }
                newRoom.dwLabID = setLab.dwLabID;
                if (m_Request.Device.RoomSet(newRoom, out newRoom) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, szOpName + "实验室失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                    m_Request.Device.LabDel(setLab);
                }
                else
                {
                    UNIDEVICE[] devTempList = GetDevByRoomId(newRoom.dwRoomID);
                    bool        bIsAllNew   = false;
                    if (devTempList != null && devTempList.Length == 1)
                    {
                        bIsAllNew = true;
                    }
                    string szNewDevic = Request["chkNewDev"];
                    if (szNewDevic != null && szNewDevic == "1")
                    {
                        UNIDEVCLS newDevCls = new UNIDEVCLS();
                        if (bIsAllNew)
                        {
                            newDevCls.dwClassID = devTempList[0].dwClassID;
                        }
                        newDevCls.dwKind      = (uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS;
                        newDevCls.szClassName = setLab.szLabName;
                        if (m_Request.Device.DevClsSet(newDevCls, out newDevCls) == REQUESTCODE.EXECUTE_SUCCESS)
                        {
                            UNIDEVKIND newDevKind = new UNIDEVKIND();
                            if (bIsAllNew)
                            {
                                newDevKind.dwKindID = devTempList[0].dwKindID;
                            }
                            newDevKind.dwClassID  = newDevCls.dwClassID;
                            newDevKind.szKindName = setLab.szLabName;
                            newDevKind.dwMaxUsers = 1;
                            newDevKind.dwMinUsers = 1;
                            if (m_Request.Device.DevKindSet(newDevKind, out newDevKind) == REQUESTCODE.EXECUTE_SUCCESS)
                            {
                                UNIDEVICE newDevAll = new UNIDEVICE();
                                if (bIsAllNew)
                                {
                                    newDevAll.dwDevID = devTempList[0].dwDevID;
                                }
                                else
                                {
                                    newDevAll.dwDevSN    = GetDevSN();
                                    newDevAll.szAssertSN = GetDevSN().ToString();
                                }
                                newDevAll.szDevName = newDevKind.szKindName;
                                newDevAll.dwKindID  = newDevKind.dwKindID;
                                newDevAll.dwRoomID  = newRoom.dwRoomID;

                                if (m_Request.Device.Set(newDevAll, out newDevAll) == REQUESTCODE.EXECUTE_SUCCESS)
                                {
                                    MessageBox(szOpName + "实验室成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                                    return;
                                }
                                else
                                {
                                    MessageBox(m_Request.szErrMessage, szOpName + "实验室失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                                    m_Request.Device.DevClsDel(newDevCls);
                                    m_Request.Device.LabDel(setLab);
                                    m_Request.Device.RoomDel(newRoom);
                                    m_Request.Device.DevKindDel(newDevKind);
                                }
                            }
                            else
                            {
                                m_Request.Device.DevClsDel(newDevCls);
                                m_Request.Device.LabDel(setLab);
                                m_Request.Device.RoomDel(newRoom);
                                MessageBox(m_Request.szErrMessage, szOpName + "实验室失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                            }
                        }

                        return;
                    }
                    MessageBox(szOpName + "实验室成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    if (Session["LoginResult"] != null)
                    {
                        ADMINLOGINRES admin = (ADMINLOGINRES)Session["LoginResult"];
                        if (!bSet)
                        {
                            AddGroupMember(newRoom.dwManGroupID, admin.AdminInfo.dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL);
                        }
                    }
                    return;
                }
            }
        }
        uint uRoomMode = (uint)(UNIROOM.DWMANMODE.ROOMMAN_CAMERA | UNIROOM.DWMANMODE.ROOMMAN_DOORLOCK | UNIROOM.DWMANMODE.ROOMMAN_FREEINOUT);

        m_szRoomMode = GetInputHtml(uRoomMode, CONSTHTML.checkBox, "dwManMode", "Room_dwManMode");
        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")
        {
            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]);
                    UNIDEVICE[] devList = GetDevByRoomId(vtRoom[0].dwRoomID);
                    if (devList != null && devList.Length == 1)
                    {
                        PutMemberValue("chkNewDev", "1");
                    }
                    m_Title = "修改【" + vtRoom[0].szRoomName + "】";
                }
            }
        }
        else
        {
            UNISTATION station = new UNISTATION();
            //station.dwStaSN = uMax;
            PutJSObj(station);
            m_Title = szOpName + "实验室";
        }
    }
예제 #23
0
    private string GetDevKinds()
    {
        DEVKINDREQ req = new DEVKINDREQ();

        req.dwClassKind = classkind;
        if (prop > 0)
        {
            req.dwProperty = prop;
        }
        //if (purpose > 0)
        //    req.dwPurpose = purpose;

        //
        //uint special = (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV | (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV | (uint)UNIDEVICE.DWPROPERTY.DEVPROP_NORESV;
        //20170609zy
        uint special = (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_KINDRESV | (uint)UNIDEVICE.DWPROPERTY.DEVPROP_NORESV;

        UNIDEVKIND[] rlt;
        string       ret = "<div class='content-block-title'>类型</div>";

        req.szReqExtInfo.szOrderKey  = "dwNationCode";
        req.szReqExtInfo.szOrderMode = "asc";

        if (m_Request.Device.DevKindGet(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt.Length > 0)
        {
            ret += "<div class='list-block'><ul>";
            for (int i = 0; i < rlt.Length; i++)
            {
                /*原本修改内容,不现实长期预约
                 * UNIDEVKIND kind=rlt[i];
                 * if (prop == 0 && (kind.dwProperty & special) > 0) continue;//过滤长期、按类型预约、不支持预约
                 * availableKinds += kind.dwKindID + ",";
                 * ret += "<li><label class='label-checkbox item-content'><input type='checkbox' name='kind_id' class='ck_kind' value='" + kind.dwKindID + "'/><div class='item-media'>"+
                 * "<i class='icon icon-form-checkbox'></i></div><div class='item-inner'><div class='item-title'>" + kind.szKindName + "</div></div></label></li>";
                 */
                //20170609zy
                UNIDEVKIND kind = rlt[i];
                if (prop == 0 && (kind.dwProperty & special) > 0)
                {
                    continue;//按类型预约、不支持预约
                }
                if ((kind.dwProperty & ((uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV)) > 0)
                {
                    availableKinds += kind.dwKindID + ",";
                    ret            += "<li><label class='label-checkbox item-content'><div class='item-inner'><div class='item-title'>" + kind.szKindName + "(请在电脑端预约)</div></div></label></li>";
                    continue;
                }
                else
                {
                    availableKinds += kind.dwKindID + ",";
                    ret            += "<li><label class='label-checkbox item-content'><input type='checkbox' name='kind_id' class='ck_kind' value='" + kind.dwKindID + "'/><div class='item-media'>" +
                                      "<i class='icon icon-form-checkbox'></i></div><div class='item-inner'><div class='item-title'>" + kind.szKindName + "</div></div></label></li>";
                }
            }
            if (availableKinds.Length > 0)
            {
                availableKinds = availableKinds.Substring(0, availableKinds.Length - 1);                        //去逗号
            }
            ret += "</ul></div>";
        }
        return(ret);
    }
예제 #24
0
    private void InitDevInfo(uint devID)
    {
        Session["CUR_DEV"] = null;
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        DEVREQ      vrGet     = new DEVREQ();

        UNIDEVICE[] vtResult;
        vrGet.dwDevID = new UniDW(devID);
        uResponse     = m_Request.Device.Get(vrGet, out vtResult);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtResult.Length > 0)
        {
            UNIDEVICE  dev  = vtResult[0];
            UNIDEVKIND kind = GetDevKind(dev.dwKindID);
            Session["CUR_DEV"] = vtResult[0];
            devNum.InnerHtml   = dev.szAssertSN;
            CurDevId           = dev.dwDevID.ToString();
            pagePosition       = "<strong style='color:#333;'>" + dev.szCampusName + " | " + dev.szDevName + "</strong>";
            devName.InnerText  = dev.szDevName;
            CurDevName         = dev.szDevName;
            devModel.InnerHtml = dev.szModel;
            if (dev.dwPurchaseDate != null && dev.dwPurchaseDate > 10000000)
            {
                string str = dev.dwPurchaseDate.ToString();
                devDate.InnerHtml = str.Substring(0, 4) + "年" + str.Substring(4, 2) + "月" + str.Substring(6, 2) + "日";
            }
            ContDevExt(dev.szExtInfo);
            devProFactory.InnerHtml = ConvertStr(kind.szProducer);
            devProPlace.InnerHtml   = ConvertStr(kind.dwNationCode);//must custom
            devPara.InnerHtml       = ConvertStr(ViewState["szPerform"]);
            devSpecimen.InnerHtml   = ConvertStr(ViewState["szSample"]);
            devFun.InnerHtml        = "";//dev.szFunc;
            devCam.InnerHtml        = dev.szCampusName;
            CurDevCps        = dev.szCampusName;
            devCol.InnerHtml = dev.szDeptName;
            CurDevDept       = dev.szDeptName;
            CurDevLab        = dev.szLabName;
            CurDevPro        = (dev.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_LONGTERMRESV) > 0 ? "l" : "r";
            devLoc.InnerHtml = dev.szLabName + " | " + dev.szRoomName;
            imgUrl           = GetImg(dev.dwDevSN);
            //预约信息
            UNIRESVRULE rule = 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();
            //仪器状态
            if (Converter.GetDevStat(dev.dwDevStat))
            {
                devSta.InnerHtml = Converter.GetDevRunStat(dev.dwRunStat);
            }
            else
            {
                devSta.InnerHtml = "<span style='color:red'>仪器不可用</span>";
            }
            //获取管理员
            devMan.InnerHtml = dev.szAttendantName;
            devCon.InnerHtml = dev.szAttendantTel;

            InitFee(dev);
            InitVadio(dev);
        }
    }