Ejemplo n.º 1
0
    private void GetYardActivity()
    {
        string          aty = Request["activity"];
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        YARDACTIVITY[] rlt;
        REQUESTCODE    cd = m_Request.Reserve.GetYardActivity(req, out rlt);

        if (cd == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                //string select = "";
                //if (aty == rlt[i].dwActivitySN.ToString()) select = "selected";
                //itemClsList += "<option value='" + rlt[i].dwActivitySN + "' include='" + rlt[i].szUsableKindIDs + "' " + select + ">" + rlt[i].szActivityName + "</option>";
                if (rlt[i].dwSecurityLevel == 1)
                {
                    continue;                             //不开放
                }
                uint?      type = rlt[i].dwSecurityLevel;
                UNIACCOUNT acc  = (UNIACCOUNT)Session["LOGIN_ACCINFO"];
                if (((type & 0x20000000) > 0 || (type & 0x10000000) > 0) && (acc.dwIdent & 512) == 0)
                {
                    continue;      //非教师不开放会议和教室批量预约
                }
                bool auto = false; //(type & 0x20000000) > 0;//会议申请 自动搜索 暂时不启用 会议室数量不少 刷新缓慢
                itemList += "<li url='atydetail.aspx?rsch=" + (auto?"auto":"") + "&activityId=" + rlt[i].dwActivitySN + "'  con='#detail_con' class='click_load'><a>" + rlt[i].szActivityName + "</a></li>";
            }
        }
        else
        {
            MsgBox(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["delID"] != null)
        {
            DelLab(Request["delID"]);
        }
        if (Request["delID"] != null)
        {
            DelLab(Request["DelLab"]);
        }
        YARDACTIVITYREQ vrParameter = new YARDACTIVITYREQ();

        YARDACTIVITY[] vrResult;

        GetPageCtrlValue(out vrParameter.szReqExtInfo);
        if (m_Request.Reserve.GetYardActivity(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            UpdatePageCtrl(m_Request.Reserve);
            for (int i = 0; i < vrResult.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td data-id=\"" + vrResult[i].dwActivitySN.ToString() + "\">" + vrResult[i].szActivityName + "</td>";
                m_szOut += "<td>" + "" + "</td>";

                m_szOut += "<td><div class='OPTD'></div></td>";
                m_szOut += "</tr>";
            }
        }
        PutBackValue();
    }
Ejemplo n.º 3
0
    private void GetYardActivity()
    {
        if (string.IsNullOrEmpty(activityId.Value))
        {
            return;
        }
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        req.dwActivitySN = ToUInt(activityId.Value);
        YARDACTIVITY[] rlt;
        if (m_Request.Reserve.GetYardActivity(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                activity           = rlt[0];
                activityName.Value = activity.szActivityName;
                infoTitle          = activity.szActivityName;
                //活动类型
                if (activity.szMemo != "")
                {
                    string[] list = activity.szMemo.Split('&');
                    for (int i = 0; i < list.Length; i++)
                    {
                        if (list[i] != "")
                        {
                            condition += "<label class='click'><input class='cdt_ckbox' type='checkbox' value='" + list[i] + "'/>" + list[i] + "</label>";
                        }
                    }
                }
                multiResv = "none";                              //隐藏批量预约
                //场景区别 custom
                if ((activity.dwSecurityLevel & 0x20000000) > 0) //会议模版
                {
                    applyTbl = "apply_hy";
                }
                else
                {
                    applyTbl = "apply";
                    if ((activity.dwSecurityLevel & 0x10000000) > 0)//教室借用 显示类型选择
                    {
                        hideDevCls = false;
                    }
                }
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 4
0
    string GetAtyType()
    {
        string          ret = "";
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        YARDACTIVITY[] rlt;
        if (m_Request.Reserve.GetYardActivity(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt != null)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                bool   sel = rlt[i].dwActivitySN.ToString() == atyId;
                string str = sel? " f_sel" : "";
                ret += "<a class='it" + str + "' value=\"" + rlt[i].dwActivitySN + "\"><input type='radio' " + (sel?"checked='checked'":"") + "/> " + rlt[i].szActivityName + "</a>";
            }
        }
        return(ret);
    }
Ejemplo n.º 5
0
    private void InitYardAty()
    {
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        YARDACTIVITY[] rlt;
        REQUESTCODE    cd = m_Request.Reserve.GetYardActivity(req, out rlt);

        if (cd == REQUESTCODE.EXECUTE_SUCCESS)
        {
            itemList = "<div class='line'></div><h2>活动场景列表</h2><ul>";
            for (int i = 0; i < rlt.Length; i++)
            {
                YARDACTIVITY aty = rlt[i];
                itemList += "<li>" + aty.szActivityName + "(ID:" + aty.dwActivitySN + ")&nbsp;<a href='editcontent.aspx?name=" + Server.UrlEncode(aty.szActivityName + "(介绍)") + "&type=aty_intro&id=" + aty.dwActivitySN + "' target='_blank'>介绍</a>" +
                            " / <a href='editcontent.aspx?name=" + Server.UrlEncode(aty.szActivityName + "(预约规则)") + "&type=aty_rule&id=" + aty.dwActivitySN + "' target='_blank'>预约规则</a></li>";
            }
            itemList += "</ul>";
        }
    }
Ejemplo n.º 6
0
    private void GetAtyList()
    {
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        YARDACTIVITY[] rlt;
        REQUESTCODE    cd = m_Request.Reserve.GetYardActivity(req, out rlt);

        if (cd == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                if ((rlt[i].dwSecurityLevel & 0x20000000) > 0)//会议模版
                {
                    continue;
                }
                atyList += "<option value='" + rlt[i].dwActivitySN + "'>" + rlt[i].szActivityName + "</option>";
            }
        }
    }
Ejemplo n.º 7
0
    private void GetYardActivity()
    {
        if (string.IsNullOrEmpty(atyId))
        {
            return;
        }
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        req.dwActivitySN = ToUInt(atyId);
        YARDACTIVITY[] rlt;
        if (m_Request.Reserve.GetYardActivity(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                activity  = rlt[0];
                atyName   = activity.szActivityName;
                infoTitle = activity.szActivityName;
                //UNIDEVKIND kind=GetDevKind(ToUInt(kindId.Value));
                //if (kind.dwKindID != null)
                //{
                //    infoTitle = kind.szKindName + " <small>【" + activity.szActivityName + "】</small>";
                //}
                if (activity.szMemo != "")
                {
                    string[] list = activity.szMemo.Split('&');
                    for (int i = 0; i < list.Length; i++)
                    {
                        if (list[i] != "")
                        {
                            condition += "<label class='click'><input class='cdt_ckbox' type='checkbox' value='" + list[i] + "'/>" + list[i] + "</label>";
                        }
                    }
                }
                //支持类型
                //kinds = activity.szUsableKindIDs;
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        YARDACTIVITY newYardActivity;
        string       szOp = "新建";

        if (Request["op"] == "set")
        {
            szOp = "修改";
        }
        UNICAMPUS[] vtCamp = GetAllCampus();
        if (vtCamp != null && vtCamp.Length > 0)
        {
            for (int i = 0; i < vtCamp.Length; i++)
            {
                szCamp += GetInputItemHtml(CONSTHTML.option, "", vtCamp[i].szCampusName, vtCamp[i].dwCampusID.ToString());
            }
        }
        szSiteAppleModel = GetInputHtmlFromXml(0, CONSTHTML.option, "", "YardResvModule", true);
        UNIBUILDING[] vtBuilding = getAllBuilding();
        for (int i = 0; i < vtBuilding.Length; i++)
        {
            if (vtBuilding[i].dwCampusID.ToString() == vtCamp[0].dwCampusID.ToString())
            {
                szBuilding += GetInputItemHtml(CONSTHTML.option, "", vtBuilding[i].szBuildingName.ToString(), vtBuilding[i].dwBuildingID.ToString());
            }
        }
        if (IsPostBack)
        {
            newYardActivity.szActivityName = Request["szActivityName"];
            string szkindsTemp = Request["kindsTemp"];
            GetHTTPObj(out newYardActivity);

            /* newYardActivity.szUsableKindIDs = Request["szUsableKindIDs"];
             * string[] szDevKindList = newYardActivity.szUsableKindIDs.Split(',');
             * string szDevKindName = "";
             * for (int i = 0; i < szDevKindList.Length; i++)
             * {
             *   UNIDEVKIND devKindGet;
             *   if (GetDevKindByID(szDevKindList[i], out devKindGet))
             *   {
             *       szDevKindName += devKindGet.szKindName + ",";
             *   }
             *
             * }
             * */
            string szCheckType  = (Request["checktype"]);
            string szCheckType2 = (Request["checktype2"]);
            uint   uCheckType   = CharListToUint(szCheckType) + CharListToUint(szCheckType2);
            //    newYardActivity.szUsableDevKindNames = szDevKindName;

            string[] szCheckTypeList = new string[0];// newYardActivity.szUsableKindIDs.Split(',');
            string   szCheckTypeName = "";
            for (int i = 0; i < szCheckTypeList.Length; i++)
            {
                CHECKTYPEREQ vrCheckTypeTemp = new CHECKTYPEREQ();
                vrCheckTypeTemp.dwCheckKind = Parse(szCheckTypeList[i]);
                CHECKTYPE[] vtChecktypeTemp;

                if (m_Request.Admin.CheckTypeGet(vrCheckTypeTemp, out vtChecktypeTemp) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    szCheckTypeName += vtChecktypeTemp[0].szCheckName + ",";
                }
            }

            newYardActivity.dwCheckKinds = uCheckType;
            newYardActivity.szCheckNames = szCheckTypeName;
            string szMemo = Request["szMemo"];
            if (szMemo != null)
            {
                szMemo = szMemo.Replace(",", "&");
            }
            if (szMemo == null || szMemo == "")
            {
                szMemo = "";
            }
            newYardActivity.szMemo = szMemo;
            string[]  szkindsTempList = szkindsTemp.Split(',');
            ArrayList list            = new ArrayList();
            for (int i = 0; i < szkindsTempList.Length; i++)
            {
                string szTemp = szkindsTempList[i];
                if (szTemp != null && szTemp != "")
                {
                    list.Add(szTemp);
                }
            }
            object[]    szkindsTempListLast = (object[])list.ToArray();
            YADEVKIND[] yardkinds           = new YADEVKIND[szkindsTempListLast.Length];
            for (int i = 0; i < szkindsTempListLast.Length; i++)
            {
                yardkinds[i]              = new YADEVKIND();
                yardkinds[i].dwKindID     = Parse((string)szkindsTempListLast[i]);
                yardkinds[i].dwActivitySN = newYardActivity.dwActivitySN;
            }
            newYardActivity.UsableDevKind = yardkinds;
            if (yardkinds == null || yardkinds.Length == 0)
            {
                YADEVKIND[] yardkindsTemp = new YADEVKIND[0];
                newYardActivity.UsableDevKind = yardkindsTemp;
            }
            uint dwKindModul = Parse(Request["dwKindModul"]);
            if (newYardActivity.dwSecurityLevel == null)
            {
                newYardActivity.dwSecurityLevel = 0;
            }
            newYardActivity.dwSecurityLevel = (uint)newYardActivity.dwSecurityLevel | dwKindModul;
            if (m_Request.Reserve.SetYardActivity(newYardActivity, out newYardActivity) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, szOp + "场景失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox(szOp + "场景成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }
        m_szYardActivityMemo = GetInputHtmlFromXml(0, CONSTHTML.checkBox, "szMemo", "YardKindMemo", true);

        /* UNIDEVKIND[] devKind = GetAllDevKind();
         * if (devKind != null)
         * {
         *
         * for (int i = 0; i < devKind.Length; i++)
         * {
         *     m_szDevKind += GetInputItemHtml(CONSTHTML.checkBox, "szUsableKindIDs", devKind[i].szKindName, devKind[i].dwKindID.ToString());
         * }
         *
         * } * */
        CHECKTYPEREQ vrCheckType = new CHECKTYPEREQ();

        vrCheckType.dwMainKind = ((uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DEVMAN + (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SECURITY + (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_PUBLICITY + (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DIRECTOR);
        CHECKTYPE[] vtChecktype;

        if (m_Request.Admin.CheckTypeGet(vrCheckType, out vtChecktype) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vtChecktype.Length; i++)
            {
                m_szCheckType += GetInputItemHtml(CONSTHTML.checkBox, "checktype", vtChecktype[i].szCheckName.ToString(), vtChecktype[i].dwCheckKind.ToString());
            }
        }
        CHECKTYPEREQ vrCheckSerType = new CHECKTYPEREQ();

        vrCheckSerType.dwMainKind = ((uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SERVICE);
        CHECKTYPE[] vtCheckRestype;

        if (m_Request.Admin.CheckTypeGet(vrCheckSerType, out vtCheckRestype) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vtCheckRestype.Length; i++)
            {
                m_szCheckSerType += GetInputItemHtml(CONSTHTML.checkBox, "checktype2", vtCheckRestype[i].szCheckName.ToString(), vtCheckRestype[i].dwCheckKind.ToString());
            }
        }

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

            YARDACTIVITYREQ vrGet = new YARDACTIVITYREQ();
            vrGet.dwActivitySN = Parse(Request["dwLabID"]);
            YARDACTIVITY[] vtRes;
            if (m_Request.Reserve.GetYardActivity(vrGet, out vtRes) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtRes.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    string szMemo = vtRes[0].szMemo;
                    szMemo          = szMemo.Replace("&", ",");
                    vtRes[0].szMemo = szMemo;
                    PutJSObj(vtRes[0]);
                    PutMemberValue("checktype2", vtRes[0].dwCheckKinds.ToString());
                    PutMemberValue("checktype", vtRes[0].dwCheckKinds.ToString());
                    m_Title = "修改【" + vtRes[0].szActivityName + "】";

                    UNIDEVKIND[] vtDevKind;
                    DEVKINDREQ   vrKindGet = new DEVKINDREQ();
                    vrKindGet.dwExtRelatedID = vtRes[0].dwActivitySN;
                    if (m_Request.Device.DevKindGet(vrKindGet, out vtDevKind) == REQUESTCODE.EXECUTE_SUCCESS && vtDevKind != null && vtDevKind.Length > 0)
                    {
                        string szYardKinds = ",";
                        for (int i = 0; i < vtDevKind.Length; i++)
                        {
                            szYardKinds += vtDevKind[i].dwKindID.ToString() + ",";
                        }

                        PutMemberValue("kindsTemp", szYardKinds);
                        PutMemberValue("kinds", szYardKinds);
                    }
                    uint uSecurityLevel = (uint)vtRes[0].dwSecurityLevel;
                    if ((uSecurityLevel & (uint)268435456) > 0)//0x10000000教室借用
                    {
                        PutMemberValue("dwKindModul", "268435456");
                    }
                    else if ((uSecurityLevel & (uint)536870912) > 0)//0x20000000教室借用
                    {
                        PutMemberValue("dwKindModul", "536870912");
                    }
                    else if ((uSecurityLevel & (uint)8388608) > 0)//0x800000教室借用
                    {
                        PutMemberValue("dwKindModul", "8388608");
                    }
                }
            }
        }
        else
        {
            m_Title = szOp + "场景";
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIRESVRULE newResvRule;
        uint?       uMax = 0;
        uint        uID  = PRDevice.DEVICE_BASE | PRDevice.MSREQ_LAB_SET;

        if (GetMaxValue(ref uMax, uID, "dwLabID"))
        {
        }
        UNIGROUP[] groupList = GetGroupByKind((uint)UNIGROUP.DWKIND.GROUPKIND_USER);
        m_szGroup += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        if (groupList != null && groupList.Length > 0)
        {
            for (int i = 0; i < groupList.Length; i++)
            {
                m_szGroup += GetInputItemHtml(CONSTHTML.option, "", groupList[i].szName.ToString(), groupList[i].dwGroupID.ToString());
            }
        }
        UNIDEVICE[] vtDevList;
        m_szDevice += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        if (GetAllDev(out vtDevList) && vtDevList != null && vtDevList.Length > 0)
        {
            for (int i = 0; i < vtDevList.Length; i++)
            {
                m_szDevice += GetInputItemHtml(CONSTHTML.option, "", vtDevList[i].szDevName.ToString(), vtDevList[i].dwDevID.ToString());
            }
        }
        if (IsPostBack)
        {
            GetHTTPObj(out newResvRule);
            newResvRule.dwLatestResvTime   = 24 * 60 * newResvRule.dwLatestResvTime;
            newResvRule.dwEarliestResvTime = 24 * 60 * newResvRule.dwEarliestResvTime;
            newResvRule.dwLimit            = CharListToUint(Request["dwLimit"]);

            if (uResvFor == 1)
            {
                if (((uint)newResvRule.dwLimit & ((uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEV)) <= 0)
                {
                    newResvRule.dwLimit = (uint)newResvRule.dwLimit | (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEV;
                }
            }
            else if (uResvFor == 2)
            {
                if (((uint)newResvRule.dwLimit & ((uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEVKIND)) <= 0)
                {
                    newResvRule.dwLimit = (uint)newResvRule.dwLimit;
                }
            }
            if ((uint)newResvRule.dwGroupID != 0)
            {
                int nDeptID = -1;
                newResvRule.dwDeptID = 0xFFFFFFFF;
            }
            if (newResvRule.dwDevID != null && ((uint)newResvRule.dwDevID != 0))
            {
                newResvRule.dwDevKind = 0;
            }
            if (m_Request.Reserve.ResvRuleSet(newResvRule, out newResvRule) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "新建失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox("新建成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }
        YARDACTIVITYREQ activityReq = new YARDACTIVITYREQ();

        YARDACTIVITY[] vtYardAcitivty;
        if (m_Request.Reserve.GetYardActivity(activityReq, out vtYardAcitivty) == REQUESTCODE.EXECUTE_SUCCESS && vtYardAcitivty != null && vtYardAcitivty.Length > 0)
        {
            for (int i = 0; i < vtYardAcitivty.Length; i++)
            {
                m_szYardActivity += GetInputItemHtml(CONSTHTML.option, "", vtYardAcitivty[i].szActivityName, vtYardAcitivty[i].dwActivitySN.ToString());
            }
        }

        m_szIdent       = GetAllInputHtml(CONSTHTML.option, "", "Ident");
        m_szResvPurpose = GetAllInputHtml(CONSTHTML.radioButton, "dwResvPurpose", "ResvPurpose");
        m_Limit         = GetAllInputHtml(CONSTHTML.checkBox, "dwLimit", "ResvRule_Limit");
        UNIDEVCLS[] vtDevCls = GetDevCLS(0);
        if (vtDevCls != null && vtDevCls.Length > 0)
        {
            m_szDevCLS += "<option value='" + "0" + "'>" + "全部适用" + "</option>";
            for (int i = 0; i < vtDevCls.Length; i++)
            {
                m_szDevCLS += GetInputItemHtml(CONSTHTML.option, "", vtDevCls[i].szClassName, vtDevCls[i].dwClassID.ToString());
            }
        }
        UNIDEPT[] dept = GetAllDept();
        m_szDept += "<option value='" + "0" + "'>" + "全部适用" + "</option>";
        if (dept != null)
        {
            for (int i = 0; i < dept.Length; i++)
            {
                m_szDept += GetInputItemHtml(CONSTHTML.option, "", dept[i].szName.ToString(), dept[i].dwID.ToString());
            }
        }
        m_Priority = GetAllInputHtml(CONSTHTML.option, "", "Priority");
        if (Request["op"] == "set")
        {
            bSet = true;

            RESVRULEREQ vrResvRuleReq = new RESVRULEREQ();

            vrResvRuleReq.dwRuleSN = Parse(Request["id"]);
            UNIRESVRULE[] vtResvRule;
            if (m_Request.Reserve.ResvRuleGet(vrResvRuleReq, out vtResvRule) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtResvRule.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtResvRule[0]);
                    m_Title = "修改预约规则【" + vtResvRule[0].szRuleName + "】";
                }
            }
        }
        else
        {
            m_Title = "新建预约规则";
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        YARDACTIVITYREQ activityReq = new YARDACTIVITYREQ();

        YARDACTIVITY[] YardActivity;
        if (m_Request.Reserve.GetYardActivity(activityReq, out YardActivity) == REQUESTCODE.EXECUTE_SUCCESS && YardActivity != null & YardActivity.Length > 0)
        {
            m_YardActivity += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            for (int i = 0; i < YardActivity.Length; i++)
            {
                m_YardActivity += GetInputItemHtml(CONSTHTML.option, "", YardActivity[i].szActivityName, YardActivity[i].dwActivitySN.ToString());
            }
        }

        {
            IDENTSTATREQ vrParameter = new IDENTSTATREQ();
            IDENTSTAT[]  vrResult;
            GetPageCtrlValue(out vrParameter.szReqExtInfo);
            if (!IsPostBack)
            {
                dwStartDate.Value = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
                dwEndDate.Value   = DateTime.Now.ToString("yyyy-MM-dd");
            }
            UNIDEPT[] alldept = GetAllDept();
            szDept += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            if (alldept != null && alldept.Length > 0)
            {
                for (int i = 0; i < alldept.Length; i++)
                {
                    szDept += GetInputItemHtml(CONSTHTML.option, "", alldept[i].szName, alldept[i].dwID.ToString());
                }
            }
            UNITERM[] termList     = GetAllTerm();
            string    szYearTerm   = Request["dwYearTerm"];
            uint      uYeartermNow = Parse(szYearTerm);
            if (termList != null)
            {
                m_TermList += GetInputItemHtml(CONSTHTML.option, "", "选择学期", "0");
                for (int i = 0; i < termList.Length; i++)
                {
                    m_TermList += GetInputItemHtml(CONSTHTML.option, "", termList[i].szMemo.ToString(), termList[i].dwYearTerm.ToString());
                    uint uYearTermState = (uint)termList[i].dwStatus;
                    if (szYearTerm == null && (uYearTermState & (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE) > 0)
                    {
                        uYeartermNow = (uint)termList[i].dwYearTerm;
                    }
                }
            }
            vrParameter.dwStartDate = DateToUint(dwStartDate.Value);
            vrParameter.dwEndDate   = DateToUint(dwEndDate.Value);
            if (ConfigConst.GCICTypeMode == 1)
            {
                UNITERM[] termnow = GetTermByID(Parse(Request["dwYearTerm"]));
                if (termnow != null && termnow.Length > 0)
                {
                    vrParameter.dwStartDate = termnow[0].dwBeginDate;
                    vrParameter.dwEndDate   = termnow[0].dwEndDate;
                }
                else
                {
                    vrParameter.dwStartDate = null;
                    vrParameter.dwEndDate   = null;
                }
            }
            uint uDept = Parse(Request["dwDept"]);
            if (uDept != 0)
            {
                vrParameter.dwDeptID = uDept;
            }
            uint uActibitySN = Parse(Request["dwActivitySN"]);
            if (uActibitySN != 0)
            {
                vrParameter.dwActivitySN = uActibitySN;
            }
            if (m_Request.Report.GeIdentStat(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                UpdatePageCtrl(m_Request.Report);
                uint nOtherTotalUsers     = 0;
                uint nOtherTotalPIDNum    = 0;
                uint nOtherTotalUseTimes  = 0;
                uint nOtherdwTotalUseTime = 0;
                for (int i = 0; i < vrResult.Length; i++)
                {
                    string szIdent = GetJustNameEqual(vrResult[i].dwIdent, "Ident");
                    if (szIdent == "")
                    {
                        nOtherTotalUsers     = nOtherTotalUsers + (uint)vrResult[i].dwTotalUsers;
                        nOtherTotalPIDNum    = nOtherTotalPIDNum + (uint)vrResult[i].dwPIDNum;
                        nOtherTotalUseTimes  = nOtherTotalUseTimes + (uint)vrResult[i].dwUseTimes;
                        nOtherdwTotalUseTime = nOtherdwTotalUseTime + (uint)vrResult[i].dwTotalUseTime;
                        continue;
                    }
                    m_szOut += "<tr>";
                    m_szOut += "<td data-id=" + vrResult[i].dwIdent.ToString() + ">" + GetJustNameEqual(vrResult[i].dwIdent, "Ident", true) + "</td>";
                    m_szOut += "<td>" + vrResult[i].dwTotalUsers.ToString() + "</td>"; //学院人数
                    m_szOut += "<td>" + vrResult[i].dwPIDNum.ToString() + "</td>";     /*使用人数*/
                    m_szOut += "<td>" + vrResult[i].dwUseTimes.ToString() + "</td>";   /*使用人次*/
                    uint uUseTime = (uint)vrResult[i].dwTotalUseTime;
                    m_szOut += "<td>" + uUseTime / 60 + "小时" + uUseTime % 60 + "分钟" + "</td>";
                    m_szOut += "<td>" + (uUseTime / ((uint)vrResult[i].dwTotalUsers + 1.0)).ToString(".00") + "</td>";/*使用人次*/
                    m_szOut += "</tr>";
                }
                if (nOtherTotalUsers > 0)
                {
                    m_szOut += "<tr>";
                    m_szOut += "<td>" + "其他" + "</td>";
                    m_szOut += "<td>" + nOtherTotalUsers.ToString() + "</td>";                                       //学院人数
                    m_szOut += "<td>" + nOtherTotalPIDNum.ToString() + "</td>";                                      /*使用人数*/
                    m_szOut += "<td>" + nOtherTotalUseTimes.ToString() + "</td>";                                    /*使用人次*/
                    m_szOut += "<td>" + nOtherdwTotalUseTime / 60 + "小时" + nOtherdwTotalUseTime % 60 + "分钟" + "</td>";
                    m_szOut += "<td>" + (nOtherdwTotalUseTime / (nOtherTotalUsers * 1.0)).ToString(".00") + "</td>"; /*使用人次*/
                    m_szOut += "</tr>";
                }
            }
        }

        PutBackValue();
    }
Ejemplo n.º 11
0
    private void GetYardActivity()
    {
        if (string.IsNullOrEmpty(atyId))
        {
            return;
        }
        YARDACTIVITYREQ req = new YARDACTIVITYREQ();

        req.dwActivitySN = ToUInt(atyId);
        YARDACTIVITY[] rlt;
        if (m_Request.Reserve.GetYardActivity(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                activity  = rlt[0];
                atyName   = activity.szActivityName;
                infoTitle = activity.szActivityName;
                //UNIDEVKIND kind=GetDevKind(ToUInt(kindId.Value));
                //if (kind.dwKindID != null)
                //{
                //    infoTitle = kind.szKindName + " <small>【" + activity.szActivityName + "】</small>";
                //}
                if (activity.szMemo != "")
                {
                    string[] list = activity.szMemo.Split('&');
                    for (int i = 0; i < list.Length; i++)
                    {
                        if (list[i].Trim() != "")
                        {
                            //复制申请
                            string ck = "";
                            if (resv.szDesiredUser != null && resv.szDesiredUser.IndexOf(list[i] + ",") >= 0)
                            {
                                ck = "checked='checked'";
                            }
                            //
                            condition += "<label class='click'><input name='require' type='checkbox' value='" + list[i] + "' " + ck + "/>" + list[i] + "&nbsp;&nbsp;</label>";
                        }
                    }
                }
                //场景区分 cutstom
                if ((activity.dwSecurityLevel & 0x10000000) > 0)//教室借用 显示类型选择
                {
                    notCourse = false;
                }
                else if ((activity.dwSecurityLevel & 0x800000) > 0)//体育场地
                {
                    isSports = true;
                }
                else if ((activity.dwSecurityLevel & 0x40000000) > 0)//教室零星借用
                {
                    isTemporary = true;
                }
                //支持类型
                //kinds = activity.szUsableKindIDs;
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        YARDACTIVITYREQ activityReq = new YARDACTIVITYREQ();

        YARDACTIVITY[] YardActivity;
        if (m_Request.Reserve.GetYardActivity(activityReq, out YardActivity) == REQUESTCODE.EXECUTE_SUCCESS && YardActivity != null & YardActivity.Length > 0)
        {
            m_YardActivity += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            for (int i = 0; i < YardActivity.Length; i++)
            {
                m_YardActivity += GetInputItemHtml(CONSTHTML.option, "", YardActivity[i].szActivityName, YardActivity[i].dwActivitySN.ToString());
            }
        }
        {
            IDENTSTATREQ vrParameter = new IDENTSTATREQ();
            IDENTSTAT[]  vrResult;
            GetPageCtrlValue(out vrParameter.szReqExtInfo);
            if (!IsPostBack)
            {
                dwStartDate.Value = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
                dwEndDate.Value   = DateTime.Now.ToString("yyyy-MM-dd");
            }
            UNIDEPT[] alldept = GetAllDept();
            szDept += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
            if (alldept != null && alldept.Length > 0)
            {
                for (int i = 0; i < alldept.Length; i++)
                {
                    szDept += GetInputItemHtml(CONSTHTML.option, "", alldept[i].szName, alldept[i].dwID.ToString());
                }
            }
            UNITERM[] termList     = GetAllTerm();
            string    szYearTerm   = Request["dwYearTerm"];
            uint      uYeartermNow = Parse(szYearTerm);
            if (termList != null)
            {
                m_TermList += GetInputItemHtml(CONSTHTML.option, "", "选择学期", "0");
                for (int i = 0; i < termList.Length; i++)
                {
                    m_TermList += GetInputItemHtml(CONSTHTML.option, "", termList[i].szMemo.ToString(), termList[i].dwYearTerm.ToString());
                    uint uYearTermState = (uint)termList[i].dwStatus;
                    if (szYearTerm == null && (uYearTermState & (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE) > 0)
                    {
                        uYeartermNow = (uint)termList[i].dwYearTerm;
                    }
                }
            }
            uint uActibitySN = Parse(Request["dwActivitySN"]);
            if (uActibitySN != 0)
            {
                vrParameter.dwActivitySN = uActibitySN;
            }
            vrParameter.dwStartDate = DateToUint(dwStartDate.Value);
            vrParameter.dwEndDate   = DateToUint(dwEndDate.Value);
            if (ConfigConst.GCICTypeMode == 1)
            {
                UNITERM[] termnow = GetTermByID(Parse(Request["dwYearTerm"]));
                if (termnow != null && termnow.Length > 0)
                {
                    vrParameter.dwStartDate = termnow[0].dwBeginDate;
                    vrParameter.dwEndDate   = termnow[0].dwEndDate;
                }
                else
                {
                    vrParameter.dwStartDate = null;
                    vrParameter.dwEndDate   = null;
                }
            }
            uint uDept = Parse(Request["dwDept"]);
            if (uDept != 0)
            {
                vrParameter.dwDeptID = uDept;
            }
            if (m_Request.Report.GeIdentStat(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                UpdatePageCtrl(m_Request.Report);
                identTotal other = new identTotal();
                other.szName = "其他";
                other.uTotal = 0;
                ArrayList list = new ArrayList();
                for (int i = 0; i < vrResult.Length; i++)
                {
                    string szIdent = GetJustNameEqual(vrResult[i].dwIdent, "Ident", true);
                    if (szIdent == "")
                    {
                        other.uTotal = other.uTotal + (uint)vrResult[i].dwTotalUsers;
                        continue;
                    }
                    identTotal temp = new identTotal();
                    temp.szName = szIdent;
                    temp.uTotal = (uint)vrResult[i].dwTotalUsers;;
                    list.Add(temp);
                }
                if (other.uTotal > 0)
                {
                    list.Add(other);
                }
                for (int i = 0; i < list.Count; i++)
                {
                    identTotal temp = new identTotal();
                    temp        = (identTotal)list[i];
                    szResvRate += "<p data-value=" + temp.uTotal.ToString() + ">" + temp.szName + "</p>";
                }
            }
        }

        PutBackValue();
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szOp = "新建";

        if (Request["op"] == "set")
        {
            szOp = "修改";
        }
        if (IsPostBack)
        {
            {
                UNIRESVRULE newResvRule;
                GetHTTPObj(out newResvRule);
                newResvRule.dwResvPurpose      = Parse(Request["dwResvPurpose2"]);
                newResvRule.dwLatestResvTime   = 24 * 60 * newResvRule.dwLatestResvTime;
                newResvRule.dwEarliestResvTime = 24 * 60 * newResvRule.dwEarliestResvTime;
                newResvRule.dwLimit            = (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_NOCONFLICTCHECK;// CharListToUint(Request["dwLimit"]);
                if (uResvFor == 1)
                {
                    if (((uint)newResvRule.dwLimit & ((uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEV)) <= 0)
                    {
                        newResvRule.dwLimit = (uint)newResvRule.dwLimit | (uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEV;
                    }
                }
                else if (uResvFor == 2)
                {
                    if (((uint)newResvRule.dwLimit & ((uint)UNIRESVRULE.DWLIMIT.RESVLIMIT_DEVKIND)) <= 0)
                    {
                        newResvRule.dwLimit = (uint)newResvRule.dwLimit;
                    }
                }
                if ((uint)newResvRule.dwGroupID != 0)
                {
                    int nDeptID = -1;
                    newResvRule.dwDeptID = 0xFFFFFFFF;
                }
                if (newResvRule.dwDevID != null && ((uint)newResvRule.dwDevID != 0))
                {
                    newResvRule.dwDevKind = 0;
                }
                string ExtCheckType = Request["ExtCheckType"];
                if (ExtCheckType == null)
                {
                    ExtCheckType = "";
                }
                string[]        checkTypeList = ExtCheckType.Split(',');
                int             uLen          = checkTypeList.Length;
                RULECHECKINFO[] checkInfo     = new RULECHECKINFO[uLen];
                string          szNoCheck     = Request["noChencType"];
                szNoCheck = "," + szNoCheck + ",";
                for (int i = 0; i < uLen; i++)
                {
                    uint uCheckKind = CharListToUint(Request["ExtCheckType" + checkTypeList[i]]);
                    checkInfo[i].dwCheckKind  = Parse(checkTypeList[i]);
                    checkInfo[i].dwBeforeKind = uCheckKind;
                    if (szNoCheck.IndexOf("," + checkTypeList[i] + ",") > -1)
                    {
                        checkInfo[i].dwProperty = (uint)RULECHECKINFO.DWPROPERTY.CHECKPROP_SUB;
                    }
                    else
                    {
                        checkInfo[i].dwProperty = (uint)RULECHECKINFO.DWPROPERTY.CHECKPROP_MAIN;
                    }
                }
                newResvRule.CheckTbl   = null;
                newResvRule.dwPriority = 2;
                if (m_Request.Reserve.ResvRuleSet(newResvRule, out newResvRule) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    return;
                }
                newResvRule.CheckTbl   = checkInfo;
                newResvRule.dwLimit    = 0;
                newResvRule.dwPriority = Parse(Request["dwPriority"]);

                if (m_Request.Reserve.ResvRuleSet(newResvRule, out newResvRule) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    return;
                }
                MessageBox(szOp + "规则配置成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }
        UNIDEVICE[] vtDevList;
        m_szDevice += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        if (GetAllDev(out vtDevList) && vtDevList != null && vtDevList.Length > 0)
        {
            for (int i = 0; i < vtDevList.Length; i++)
            {
                m_szDevice += GetInputItemHtml(CONSTHTML.option, "", vtDevList[i].szDevName.ToString(), vtDevList[i].dwDevID.ToString());
            }
        }
        m_szIdent       = GetAllInputHtml(CONSTHTML.option, "", "Ident");
        m_szResvPurpose = GetAllInputHtml(CONSTHTML.radioButton, "dwResvPurpose", "ResvPurpose");
        m_Limit         = GetAllInputHtml(CONSTHTML.checkBox, "dwLimit", "ResvRule_Limit");
        UNIDEVCLS[] vtDevCls = GetDevCLS(0);
        if (vtDevCls != null && vtDevCls.Length > 0)
        {
            m_szDevCLS += "<option value='" + "0" + "'>" + "全部适用" + "</option>";
            for (int i = 0; i < vtDevCls.Length; i++)
            {
                m_szDevCLS += GetInputItemHtml(CONSTHTML.option, "", vtDevCls[i].szClassName, vtDevCls[i].dwClassID.ToString());
            }
        }
        UNIDEPT[] dept = GetAllDept();
        m_szDept += "<option value='" + "0" + "'>" + "全部适用" + "</option>";
        if (dept != null)
        {
            for (int i = 0; i < dept.Length; i++)
            {
                m_szDept += GetInputItemHtml(CONSTHTML.option, "", dept[i].szName.ToString(), dept[i].dwID.ToString());
            }
        }
        UNIDEVKIND[] devKind = GetAllDevKind();
        if (devKind != null)
        {
            for (int i = 0; i < devKind.Length; i++)
            {
                m_szDevKind += GetInputItemHtml(CONSTHTML.checkBox, "szUsableKindIDs", devKind[i].szKindName, devKind[i].dwKindID.ToString());
            }
        }
        YARDACTIVITYREQ activityReq = new YARDACTIVITYREQ();

        YARDACTIVITY[] vtYardAcitivty;
        m_szYardActivity += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        if (m_Request.Reserve.GetYardActivity(activityReq, out vtYardAcitivty) == REQUESTCODE.EXECUTE_SUCCESS && vtYardAcitivty != null && vtYardAcitivty.Length > 0)
        {
            for (int i = 0; i < vtYardAcitivty.Length; i++)
            {
                m_szYardActivity += GetInputItemHtml(CONSTHTML.option, "", vtYardAcitivty[i].szActivityName, vtYardAcitivty[i].dwActivitySN.ToString());
            }
        }
        m_Property = GetInputHtmlFromXml(0, CONSTHTML.radioButton, "dwProperty", "CheckType_Property", true);
        m_level    = GetInputHtmlFromXml(0, CONSTHTML.option, "", "Yard_ActivityLevel", true);

        CHECKTYPEREQ checkTypeReq = new CHECKTYPEREQ();

        CHECKTYPE[] vtCheckType;
        if (m_Request.Admin.CheckTypeGet(checkTypeReq, out vtCheckType) == REQUESTCODE.EXECUTE_SUCCESS && vtCheckType != null && vtCheckType.Length > 0)
        {
            m_szExtCheckType += "<tr><td class='td' style='text-align:center;height:20px;' colspan='1'>需审核部门</td><td class='td'>是否审核</td><td style='text-align:center;height:20px' colspan='2' class='td'>所依赖审核部门</td></tr>";
            for (int i = 0; i < vtCheckType.Length; i++)
            {
                m_szExtCheckType += "<tr><td class='td' colspan='1' style='text-align:center;height:20px;width:180px;'>";
                m_szExtCheckType += GetInputItemHtml(CONSTHTML.checkBox, "ExtCheckType", vtCheckType[i].szCheckName, vtCheckType[i].dwCheckKind.ToString());
                m_szExtCheckType += "<td class='td' colspan='1' style='width:58px' >" + GetInputItemHtml(CONSTHTML.checkBox, "noChencType", "不审核", vtCheckType[i].dwCheckKind.ToString()) + "</td>";
                m_szExtCheckType += "</td>";
                m_szExtCheckType += "<td class='td' colspan='2' style='text-align:left;height:20px'>";
                for (int j = 0; j < vtCheckType.Length; j++)
                {
                    if (vtCheckType[j].dwCheckKind != vtCheckType[i].dwCheckKind)
                    {
                        m_szExtCheckType += GetInputItemHtml(CONSTHTML.checkBox, "ExtCheckType" + vtCheckType[i].dwCheckKind, vtCheckType[j].szCheckName, vtCheckType[j].dwCheckKind.ToString());
                    }
                }
                m_szExtCheckType += "</td>";
                m_szExtCheckType += "</tr>";
            }
        }
        if (Request["extValue"] != "")
        {
            PutMemberValue("dwExtValue", Request["extValue"]);
        }
        if (Request["op"] == "set")
        {
            bSet = true;

            RESVRULEREQ vrResvRuleReq = new RESVRULEREQ();
            string      szResvRuleID  = Request["dwID"];
            string      szDevID       = Request["devID"];

            if (szResvRuleID != null && szResvRuleID != "")
            {
                vrResvRuleReq.dwRuleSN = Parse(szResvRuleID);
            }
            else if (szDevID != null && szDevID != "")
            {
                vrResvRuleReq.dwDevID = Parse(szDevID);
            }
            UNIRESVRULE[] vtResvRule;
            if (m_Request.Reserve.ResvRuleGet(vrResvRuleReq, out vtResvRule) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vtResvRule.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vtResvRule[0]);
                    string szCheckKind   = "";
                    string szNoCheckKind = "";
                    if (vtResvRule[0].CheckTbl != null)
                    {
                        for (int i = 0; i < vtResvRule[0].CheckTbl.Length; i++)
                        {
                            szCheckKind += vtResvRule[0].CheckTbl[i].dwCheckKind + ",";
                            if ((vtResvRule[0].CheckTbl[i].dwProperty & (uint)RULECHECKINFO.DWPROPERTY.CHECKPROP_SUB) > 0)
                            {
                                szNoCheckKind += vtResvRule[0].CheckTbl[i].dwCheckKind + ",";
                            }
                            PutMemberValue("ExtCheckType" + vtResvRule[0].CheckTbl[i].dwCheckKind, vtResvRule[0].CheckTbl[i].dwBeforeKind.ToString());
                        }
                    }
                    PutMemberValue("ExtCheckType", szCheckKind);
                    PutMemberValue("noChencType", szNoCheckKind);
                    m_Title = "修改规则配置【" + vtResvRule[0].szRuleName + "】";
                    ViewState["dwLatestResvTime"]   = vtResvRule[0].dwLatestResvTime.ToString();
                    ViewState["dwEarliestResvTime"] = vtResvRule[0].dwEarliestResvTime.ToString();
                    if (uResvFor == 2)
                    {
                        UNIDEVKIND devKind2;

                        if (vtResvRule[0].dwDevKind != null && GetDevKindByID(vtResvRule[0].dwDevKind.ToString(), out devKind2))
                        {
                            ViewState["kindName"] = devKind2.szKindName.ToString();
                        }
                        else
                        {
                            ViewState["kindName"] = "全部";
                        }
                    }
                }
            }
        }
        else
        {
            m_Title = szOp + "规则配置";
        }
    }