Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         YARDRESVREQ vrGet    = new YARDRESVREQ();
         string      szResvID = Request["id"];
         string      szText   = Request["szMessageInfo"];
         if (szResvID == null || szResvID == "")
         {
             MessageBox("设置失败", "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
             return;
         }
         vrGet.dwResvID = Parse(szResvID);
         YARDRESV[] vtRes;
         if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
         {
             YARDRESV outResv = new YARDRESV();
             outResv            = vtRes[0];
             outResv.szHostUnit = szText;
             if (m_Request.Reserve.DelYardResv(outResv) == REQUESTCODE.EXECUTE_SUCCESS)
             {
                 MessageBox("取消成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
             }
             else
             {
                 MessageBox(m_Request.szErrMessage.ToString(), "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
             }
         }
     }
 }
Ejemplo n.º 2
0
    private void copyResv(string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return;
        }
        YARDRESVREQ req = new YARDRESVREQ();

        req.dwResvGroupID = ToUInt(id);
        req.dwReqProp     = (uint)YARDRESVREQ.DWREQPROP.YARDREQ_ONLYMAINRESV;
        req.dwStatFlag    = (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER | (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE | (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL | (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;
        YARDRESV[] rlt;
        if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                resv   = rlt[0];
                profit = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT) > 0 ? "true" : "false";
                open   = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0 ? "false" : "true";
                media  = (resv.dwProperty & 0x4000000) > 0 ? "true" : "false";
                date   = Get1970Date((int)resv.dwBeginTime).Substring(0, 10);
                start  = Get1970Date((int)resv.dwBeginTime).Substring(11);
                end    = Get1970Date((int)resv.dwEndTime).Substring(11);
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 3
0
    private void copyResv(string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return;
        }
        YARDRESVREQ req = new YARDRESVREQ();

        req.dwResvGroupID = ToUInt(id);
        req.dwReqProp     = (uint)YARDRESVREQ.DWREQPROP.YARDREQ_ONLYMAINRESV;
        req.dwStatFlag    = (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER | (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE | (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL | (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;
        YARDRESV[] rlt;
        if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                resv   = rlt[0];
                profit = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT) > 0 ? "true" : "false";
                media  = (resv.dwProperty & 0x4000000) > 0 ? "true" : "false";
                open   = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0 ? "false" : "true";
                string[] arr = resv.szDesiredUser.Split(',');
                if (arr.Length > 0)
                {
                    require = arr[arr.Length - 1];
                }
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 4
0
    private YARDRESV[] GetYardResvByGroupID(uint uGroupID)
    {
        YARDRESVREQ vrGet = new YARDRESVREQ();

        vrGet.dwResvGroupID = uGroupID;
        YARDRESV[] vtRes;
        if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            return(vtRes);
        }
        return(null);
    }
Ejemplo n.º 5
0
    protected void DelResv(string delID)
    {
        YARDRESVREQ vrGet = new YARDRESVREQ();

        vrGet.dwResvID = Parse(delID);
        YARDRESV[] vtRes;
        if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            YARDRESV delResv = new YARDRESV();
            delResv = vtRes[0];
            m_Request.Reserve.DelYardResv(delResv);
        }
    }
Ejemplo n.º 6
0
    private YARDRESV[] GetYardResvByGroupID(uint uGroupID)
    {
        YARDRESVREQ vrGet = new YARDRESVREQ();

        vrGet.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER + (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;

        vrGet.dwResvGroupID = uGroupID;
        YARDRESV[] vtRes;
        if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            return(vtRes);
        }
        return(null);
    }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         YARDRESVREQ vrGet    = new YARDRESVREQ();
         string      szResvID = Request["id"];
         string      szText   = Request["szMessageInfo"];
         if (szResvID == null || szResvID == "")
         {
             MessageBox("设置失败", "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
             return;
         }
         vrGet.dwResvID = Parse(szResvID);
         YARDRESV[] vtRes;
         if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
         {
             ADMINCREDIT setValue = new ADMINCREDIT();
             setValue.dwAccNo    = vtRes[0].dwApplicantID;
             setValue.szTrueName = vtRes[0].szApplicantName;
             string szScore = Request["score"];
             if (szScore == "")
             {
                 MessageBox("请填写扣除分数", "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                 return;
             }
             setValue.dwCreditScore = Parse(szScore);
             setValue.dwCTSN        = (uint)CREDITKIND.DWCREDITSN.CREDIT_DEREGULATION;
             setValue.dwCreditSN    = (uint)CREDITKIND.DWCREDITSN.CREDIT_DEREGULATION;
             setValue.dwSubjectID   = Parse(szResvID);
             string szMessageInfo = Request["szMessageInfo"];
             if (szMessageInfo == "")
             {
                 MessageBox("必须填写原因", "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                 return;
             }
             setValue.szReason = "不按时使用";
             setValue.szMemo   = "不按时使用";
             if (m_Request.System.AdminCreditDo(setValue) == REQUESTCODE.EXECUTE_SUCCESS)
             {
                 MessageBox("强制违约成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
             }
             else
             {
                 MessageBox(m_Request.szErrMessage.ToString(), "提示", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
             }
         }
     }
 }
Ejemplo n.º 8
0
    private void InitDelYardResv()
    {
        YARDRESVREQ req = new YARDRESVREQ();

        req.dwBeginDate              = ToUInt(DateTime.Now.AddMonths(-24).ToString("yyyyMMdd"));//2年
        req.dwEndDate                = ToUInt(DateTime.Now.AddMonths(3).ToString("yyyyMMdd"));
        req.dwApplicantID            = acc.dwAccNo;
        req.szReqExtInfo.szOrderKey  = "dwOccurTime";
        req.szReqExtInfo.szOrderMode = "DESC";
        req.dwStatFlag               = (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL;
        YARDRESV[] rlt;
        if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                YARDRESV resv = rlt[i];
                if (!IsStat(resv.dwStatus, (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNDO))
                {
                    continue;
                }
                string id        = resv.dwResvID.ToString();
                string timespan  = rlt[i].szCycRule;
                string occurtime = Get1970Date((int)resv.dwOccurTime);
                string cause     = resv.szHostUnit;
                if (cause == "")
                {
                    cause = "主动删除";
                }
                delResvList += "<tr class='it'><td>" + resv.dwResvGroupID + "</td><td>" + resv.szResvName + "</td><td>" + resv.szDevName + "</td><td class='text-center'>" + occurtime + "</td>" +
                               "<td class='text-center'>" + Get1970Date((int)resv.dwBeginTime) + "-" + Get1970Date((int)resv.dwEndTime).Substring(11) + "</td>" +
                               "<td>" + cause + "</td></tr>";
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 9
0
    private void InitYardResv(string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return;
        }
        YARDRESVREQ req = new YARDRESVREQ();

        req.dwResvGroupID = ToUInt(id);
        //req.dwReqProp = (uint)YARDRESVREQ.DWREQPROP.YARDREQ_ONLYMAINRESV;必须获取多条才能判断是否批量预约
        req.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER | (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE | (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL | (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;
        YARDRESV[] rlt;
        if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                resv = rlt[0];
                /////////////////
                CHECKTYPE[]         mantypes  = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DEVMAN);
                CHECKTYPE[]         dicttypes = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DIRECTOR);
                CHECKTYPE[]         servtypes = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SERVICE);
                string              msg;
                YARDRESVCHECKINFO[] ckInfo  = GetResvCheckInfo(id, out msg);
                string              man     = "";
                string              dict    = "";
                string              service = "";
                for (int j = 0; j < ckInfo.Length; j++)
                {
                    YARDRESVCHECKINFO info     = ckInfo[j];
                    CHECKTYPE         mantype  = IsInAarray(info.dwCheckKind, mantypes);
                    CHECKTYPE         dicttype = IsInAarray(info.dwCheckKind, dicttypes);
                    CHECKTYPE         servtype = IsInAarray(info.dwCheckKind, servtypes);
                    if (mantype.dwCheckKind != null)
                    {
                        man = resv.szDeptName + " (" + GetCheckState(info.dwCheckStat) + ")";
                    }
                    else if (dicttype.dwCheckKind != null)
                    {
                        UNIACCOUNT acc  = (UNIACCOUNT)Session["LOGIN_ACCINFO"];
                        string     name = dicttype.szDeptName;
                        if (string.IsNullOrEmpty(name.Trim()))
                        {
                            name = acc.szDeptName;
                        }
                        dict = name + " (" + GetCheckState(info.dwCheckStat) + ")";
                    }
                    else if (servtype.dwCheckKind != null)
                    {
                        service += info.szCheckName + "&nbsp;&nbsp;&nbsp;";
                    }
                }
                checkService  = service;
                checkDirector = dict;
                checkMan      = man;
                ////////////////////////
                status  = ToUInt(resv.dwStatus);
                profit  = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT) > 0?"是":"否";
                media   = (resv.dwProperty & 0x4000000) > 0 ? "是" : "否";
                open    = (resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0 ? "否" : "是";
                require = resv.szDesiredUser;
                if (rlt.Length > 1)
                {
                    resvTime = resv.szCycRule;
                }
                else
                {
                    resvTime = Get1970Date((int)resv.dwBeginTime) + "至" + Get1970Date((int)resv.dwEndTime).Substring(11);
                }
                isShare = (resv.dwProperty & (uint)UNIDEVKIND.DWPROPERTY.DEVPROP_SHARE) > 0;//室外场地
                atyType = GetTypeList(resv.dwKind.ToString());

                //申请模版
                applyTbl = "dft";
                //申请模版
                if ((resv.dwSecurityLevel & 0x20000000) > 0)//会议模版
                {
                    applyTbl = "hy";
                }
                else if ((resv.dwSecurityLevel & 0x800000) > 0)//体育场地
                {
                    isSports = true;
                }
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Ejemplo n.º 10
0
    private REQUESTCODE CheckByResvID(string szResvID, uint?uCheckState, string szMemo)
    {
        REQUESTCODE          uResponse = REQUESTCODE.EXECUTE_FAIL;
        YARDRESVCHECKINFOREQ vrPar     = new YARDRESVCHECKINFOREQ();

        vrPar.dwResvID       = Parse(szResvID);
        vrPar.dwCheckStat    = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_CANDO;
        vrPar.dwNeedYardResv = 1;
        YARDRESVCHECKINFO[] vtRes;
        uResponse = m_Request.Reserve.GetYardResvCheckInfo(vrPar, out vtRes);
        REQUESTCODE bRes = REQUESTCODE.EXECUTE_FAIL;

        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS == vtRes.Length > 0)
        {
            for (int i = 0; i < vtRes.Length; i++)
            {
                if (!((vtRes[i].dwCheckStat & (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_CANDO) > 0))
                {
                    continue;
                }
                ADMINLOGINRES accno = (ADMINLOGINRES)Session["LoginResult"];
                if (accno.AccInfo.dwAccNo != null && (accno.AccInfo.dwDeptID != vtRes[i].dwCheckDeptID))
                {
                    //continue;
                }
                CHECKTYPE checktype = new CHECKTYPE();
                if (GetCheckType((uint)vtRes[i].dwCheckKind, out checktype))
                {
                    if ((checktype.dwMainKind & (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SERVICE) > 0)
                    {
                        continue;
                    }
                }
                else
                {
                    continue;
                }

                YARDRESVCHECK setValue = new YARDRESVCHECK();
                setValue.dwCheckID   = vtRes[i].dwCheckID;
                setValue.dwCheckKind = vtRes[i].dwCheckKind;
                setValue.dwResvID    = vtRes[i].dwResvID;
                setValue.YardResv    = vtRes[i].YardResv;
                setValue.YardResv.dwActivityLevel = Parse(Request["dwActivityLevel"]);
                setValue.YardResv.dwSecurityLevel = Parse(Request["dwSecurityLevel"]);
                setValue.YardResv.dwCheckKinds    = Parse(Request["dwDirectors"]);
                setValue.szCheckDetail            = Request["szCheckInfo"];
                string szDevID = Request["devID"];
                if (szDevID != null && szDevID != "")
                {
                    UNIDEVICE dev;
                    if (getDevByID(szDevID, out dev))
                    {
                        setValue.YardResv.dwDevID    = dev.dwDevID;
                        setValue.YardResv.dwDevKind  = dev.dwKindID;
                        setValue.YardResv.dwDevSN    = dev.dwDevSN;
                        setValue.YardResv.szDevName  = dev.szDevName;
                        setValue.YardResv.dwLabID    = dev.dwLabID;
                        setValue.YardResv.dwRoomID   = dev.dwRoomID;
                        setValue.YardResv.szRoomName = dev.szRoomName;
                    }
                    YARDRESVREQ vrYardGet = new YARDRESVREQ();
                    vrYardGet.dwResvID = vtRes[i].dwResvID;
                    YARDRESV[] vtYardResv;
                    if (m_Request.Reserve.GetYardResv(vrYardGet, out vtYardResv) == REQUESTCODE.EXECUTE_SUCCESS && vtYardResv != null && vtYardResv.Length > 0)
                    {
                        YARDRESV setYardResv = new YARDRESV();
                        setYardResv         = vtYardResv[i];
                        setYardResv.dwDevID = dev.dwDevID;
                        m_Request.Reserve.SetYardResv(setYardResv, out setYardResv);
                    }
                }
                setValue.dwCheckStat   = uCheckState;
                setValue.szCheckDetail = szMemo;
                uResponse = m_Request.Reserve.YardResvCheck(setValue);
                if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    bRes = REQUESTCODE.EXECUTE_SUCCESS;
                }
            }
            return(bRes);
        }
        return(REQUESTCODE.EXECUTE_FAIL);
    }
Ejemplo n.º 11
0
    private REQUESTCODE CheckAll(YARDRESVCHECKINFO[] vtRes)
    {
        REQUESTCODE          uResponse = REQUESTCODE.EXECUTE_FAIL;
        YARDRESVCHECKINFOREQ vrPar     = new YARDRESVCHECKINFOREQ();
        string szCheckIDs = Request["ID"];

        vrPar.dwCheckID      = (vtRes[0].dwCheckID);
        vrPar.dwCheckStat    = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_CANDO;
        vrPar.dwNeedYardResv = 1;
        YARDRESVCHECKINFO[] vtRes1;
        uResponse = m_Request.Reserve.GetYardResvCheckInfo(vrPar, out vtRes1);
        if (vtRes1 != null && vtRes1.Length == 0)
        {
            return(REQUESTCODE.EXECUTE_SUCCESS);
        }
        uint          openProp       = Parse(Request["resvPro2"]);        //是否开放
        uint          kindPro        = Parse(Request["dwKind"]);          //活动类型
        uint          openYL         = Parse(Request["resvPro1"]);        //盈利
        uint          openAttendUser = Parse(Request["dwMaxAttendance"]); //参与人数
        YARDRESVCHECK setValue       = new YARDRESVCHECK();

        setValue.dwCheckID   = vtRes[0].dwCheckID;
        setValue.dwCheckKind = vtRes[0].dwCheckKind;
        setValue.dwResvID    = vtRes[0].dwResvID;
        setValue.YardResv    = vtRes[0].YardResv;
        setValue.YardResv.dwActivityLevel = Parse(Request["dwActivityLevel"]);
        setValue.YardResv.dwSecurityLevel = Parse(Request["dwSecurityLevel"]);
        setValue.YardResv.dwCheckKinds    = Parse(Request["dwDirectors"]);
        setValue.szCheckDetail            = Request["szCheckInfo"];
        uint uResvProp = (uint)setValue.YardResv.dwProperty;

        //开放
        if (openProp == 1)
        {
            uResvProp = uResvProp | (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN;
        }
        else
        {
            if ((uResvProp & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0)
            {
                uResvProp = uResvProp - (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN;
            }
        }

        //盈利
        if (openYL == 1)
        {
            uResvProp = uResvProp | (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT;
        }
        else
        {
            if ((uResvProp & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT) > 0)
            {
                uResvProp = uResvProp - (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT;
            }
        }
        setValue.YardResv.dwProperty = uResvProp;
        if (openAttendUser != 0)
        {
            setValue.YardResv.dwMaxAttendance = openAttendUser;
        }
        if (kindPro != 0)
        {
            setValue.YardResv.dwKind = kindPro;
        }
        string szDevID = Request["devID"];

        if (szDevID != null && szDevID != "")
        {
            UNIDEVICE dev;
            if (getDevByID(szDevID, out dev))
            {
                setValue.YardResv.dwDevID    = dev.dwDevID;
                setValue.YardResv.dwDevKind  = dev.dwKindID;
                setValue.YardResv.dwDevSN    = dev.dwDevSN;
                setValue.YardResv.szDevName  = dev.szDevName;
                setValue.YardResv.dwLabID    = dev.dwLabID;
                setValue.YardResv.dwRoomID   = dev.dwRoomID;
                setValue.YardResv.szRoomName = dev.szRoomName;
            }
            YARDRESVREQ vrYardGet = new YARDRESVREQ();
            vrYardGet.dwResvID = vtRes[0].dwResvID;
            YARDRESV[] vtYardResv;

            if (m_Request.Reserve.GetYardResv(vrYardGet, out vtYardResv) == REQUESTCODE.EXECUTE_SUCCESS && vtYardResv != null && vtYardResv.Length > 0)
            {
                YARDRESV setYardResv = new YARDRESV();
                setYardResv         = vtYardResv[0];
                setYardResv.dwDevID = dev.dwDevID;
                //  m_Request.Reserve.SetYardResv(setYardResv, out setYardResv);
            }
        }
        string szCheckName = Request["checkstate"];

        if (szCheckName == "16")
        {
            setValue.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_OK;
        }
        else
        {
            setValue.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_OK + (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_REDO;
        }
        setValue.szCheckDetail = Request["szCheckDetail"];
        uResponse = m_Request.Reserve.YardResvCheck(setValue);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            uResponse = CheckByResvID(setValue.dwResvID.ToString(), setValue.dwCheckStat, setValue.szCheckDetail);
            return(REQUESTCODE.EXECUTE_SUCCESS);
        }
        else
        {
            return(REQUESTCODE.EXECUTE_FAIL);
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string m_szDev = "[";

        Response.CacheControl = "no-cache";
        string szStart = Request["start"];

        szStart = szStart.Replace("-", "");
        string szEnd = Request["end"];

        szEnd = szEnd.Replace("-", "");

        string szCamp       = Request["campuid"];
        string szBuildingID = Request["buildingid"];
        string szRoomID     = Request["roomid"];

        string GetResvID = "";

        /*
         * YARDRESVCHECKINFOREQ vrPar = new YARDRESVCHECKINFOREQ();
         * vrPar.dwBeginDate = Parse(szStart);
         * vrPar.dwEndDate = Parse(szEnd);
         * vrPar.dwNeedYardResv = 1;
         * //   vrPar.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_CANDO + (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_ADMINOK + +(uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_ADMINFAIL;
         * YARDRESVCHECKINFO[] vtRes;
         * if (m_Request.Reserve.GetYardResvCheckInfo(vrPar, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
         * {
         *  for (int i = 0; i < vtRes.Length; i++)
         *  {
         *     YARDRESV yaresev=vtRes[i].YardResv;
         *      string szTime ="";
         *     if (yaresev.dwBeginTime != null)
         *     {
         *         szTime = Get1970Date(yaresev.dwBeginTime, "HH:mm") + Get1970Date(yaresev.dwEndTime, "到HH:mm");
         *     }
         *     string szDevName = "";
         *     if (yaresev.szDevName != null)
         *     {
         *         szDevName = yaresev.szDevName;
         *     }
         *     string szApplicantName = "";
         *     if (yaresev.szApplicantName != null)
         *     {
         *         szApplicantName = yaresev.szApplicantName;
         *     }
         *     string szActivityName = "";
         *     if (yaresev.szActivityName != null)
         *     {
         *         szActivityName = yaresev.szActivityName;
         *     }
         *     string dwPreDate = "";
         *     if (yaresev.dwPreDate != null)
         *     {
         *         dwPreDate = GetDateStr(yaresev.dwPreDate);
         *     }
         *    uint dwSecurityLevel=0;
         *    if (yaresev.dwSecurityLevel != null)
         *    {
         *        dwSecurityLevel = (uint)yaresev.dwSecurityLevel;
         *    }
         *    m_szDev += "{\"dwSecurityLevel\":" + dwSecurityLevel.ToString()+ ",\"id\":" + vtRes[i].dwCheckID.ToString() + ",\"title\": \"" + szTime + "," + szDevName + "," + szApplicantName + "," + szActivityName + "\",\"start\": \"" + dwPreDate + "\"},";
         *
         *  }
         * }
         *
         *
         */
        YARDRESVREQ vrGet = new YARDRESVREQ();

        if (!string.IsNullOrEmpty(szCamp) && szCamp != "0")
        {
            vrGet.szCampusIDs = szCamp;
        }
        if (!string.IsNullOrEmpty(szBuildingID) && szBuildingID != "0")
        {
            vrGet.szBuildingIDs = szBuildingID;
        }
        if (!string.IsNullOrEmpty(szRoomID) && szRoomID != "0")
        {
            vrGet.szRoomIDs = szRoomID;
        }
        vrGet.dwBeginDate = Parse(szStart);
        vrGet.dwEndDate   = Parse(szEnd);
        vrGet.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_ADMINOK;
        vrGet.dwStatFlag  = (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER + (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE;
        YARDRESV[] vtRes;
        if (m_Request.Reserve.GetYardResv(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            // Logger.trace("yarresv count="+vtRes.Length.ToString());
            for (int i = 0; i < vtRes.Length; i++)
            {
                GetResvID = GetResvID + vtRes[i].dwResvID.ToString() + ",";
                string   szTime  = Get1970Date(vtRes[i].dwBeginTime, "HH:mm") + Get1970Date(vtRes[i].dwEndTime, "到HH:mm");
                YARDRESV yaresev = vtRes[i];

                string szIsTody = "false";
                if (Get1970Date(vtRes[i].dwCheckTime, "yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
                {
                    szIsTody = "true";
                }

                if (yaresev.dwBeginTime != null)
                {
                    szTime = Get1970Date(yaresev.dwBeginTime, "HH:mm") + Get1970Date(yaresev.dwEndTime, "到HH:mm");
                }
                string szDevName = "";
                if (yaresev.szDevName != null)
                {
                    szDevName = yaresev.szDevName;
                }
                string szApplicantName = "";
                if (yaresev.szApplicantName != null)
                {
                    szApplicantName = yaresev.szApplicantName;
                }
                string szActivityName = "";
                if (yaresev.szActivityName != null)
                {
                    szActivityName = yaresev.szActivityName;
                }
                string dwPreDate = "";
                if (yaresev.dwPreDate != null)
                {
                    dwPreDate = GetDateStr(yaresev.dwPreDate);
                }
                uint dwSecurityLevel = 0;
                if (yaresev.dwSecurityLevel != null)
                {
                    dwSecurityLevel = (uint)yaresev.dwSecurityLevel;
                }
                //  Logger.trace("szDevName=" + szDevName);


                m_szDev += "{\"dwSecurityLevel\":" + dwSecurityLevel.ToString() + ",\"id\":" + vtRes[i].dwResvID.ToString() + ",\"title\": \"" + szDevName + "," + szTime + "," + szApplicantName + "," + szActivityName + "," + szIsTody + "\",\"start\": \"" + dwPreDate + "\",\"istody\": \"" + szIsTody + "\"},";
            }
        }
        //Logger.trace("yardresv=" + m_szDev);
        RESVREQ getResv = new RESVREQ();

        getResv.dwBeginDate = Parse(szStart);
        getResv.dwEndDate   = Parse(szEnd);
        getResv.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_ADMINOK;
        getResv.dwStatFlag  = (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER + (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE;
        getResv.dwPurpose   = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL + (uint)UNIRESERVE.DWPURPOSE.USEFOR_RESERVED + (uint)UNIRESERVE.DWPURPOSE.USEFOR_STUDYROOM;
        //(uint)UNIRESERVE.DWPURPOSE.USEFOR_RESERVED;
        UNIRESERVE[] vtResv;
        if (m_Request.Reserve.Get(getResv, out vtResv) == REQUESTCODE.EXECUTE_SUCCESS && vtResv != null && vtResv.Length > 0)
        {
            for (int i = 0; i < vtResv.Length; i++)
            {
                if (GetResvID.IndexOf(vtResv[i].dwResvID.ToString()) > -1)
                {
                    continue;
                }
                GetResvID = GetResvID + vtResv[i].dwResvID.ToString() + ",";
                RESVDEV[] vtResvDev = vtResv[i].ResvDev;
                if (vtResvDev != null && vtResvDev.Length > 0)
                {
                    UNIDEVICE devRes = new UNIDEVICE();

                    if (GetDevInfo(vtResvDev[0].dwDevStart.ToString(), vtResvDev[0].dwRoomID.ToString(), out devRes) == true)
                    {
                        if (!string.IsNullOrEmpty(szCamp) && szCamp != "0" && devRes.dwCampusID.ToString() != szCamp)
                        {
                            continue;
                        }
                        if (!string.IsNullOrEmpty(szBuildingID) && szBuildingID != "0" && devRes.dwBuildingID.ToString() != szBuildingID)
                        {
                            continue;
                        }
                        if (!string.IsNullOrEmpty(szRoomID) && szRoomID != "0" && devRes.dwRoomID.ToString() != szRoomID)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        //   Logger.trace("resvid="+ vtResv[i].dwResvID.ToString() + ";devsn="+vtResvDev[0].dwDevStart.ToString()+";roomid="+vtResvDev[0].dwRoomID.ToString()+"不存在"+"");
                        continue;
                    }
                }
                else
                {
                    continue;
                }
                if ((((uint)vtResv[i].dwPurpose) & ((uint)UNIRESERVE.DWPURPOSE.USEFOR_YARD)) > 0)
                {
                    continue;
                }
                string szRoomName = "";
                if (vtResv[i].ResvDev != null && vtResv[i].ResvDev.Length > 0)
                {
                    szRoomName = vtResv[i].ResvDev[0].szRoomName;
                }
                string szTime   = Get1970Date(vtResv[i].dwBeginTime, "HH:mm") + Get1970Date(vtResv[i].dwEndTime, "到HH:mm");
                string szDate   = GetDateStr(vtResv[i].dwPreDate);
                string szIsTody = "false";
                if (Get1970Date(vtResv[i].dwCheckTime, "yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
                {
                    szIsTody = "true";
                }
                szDate   = szDate.Replace("/", "-");
                m_szDev += "{\"title\": \"" + szRoomName + "," + szTime + "," + vtResv[i].szOwnerName + "," + vtResv[i].szTestName + "\",\"start\": \"" + szDate + "\",\"id\": \"" + vtResv[i].dwResvID + "\",\"istody\": \"" + szIsTody + "\"}";

                if (i < (vtResv.Length - 1))
                {
                    m_szDev += ",";
                }
            }
        }

        // Logger.trace("reserve=" + m_szDev);
        if (m_szDev != "[" && !m_szDev.EndsWith(","))
        {
            m_szDev = m_szDev + ",";
        }
        //   GetThirdDevResv thirdResv=new GetThirdDevResv();

        UNIDEVICE[]   devResv  = (UNIDEVICE[])Session["devInfo"];
        ADMINLOGINRES loginRes = (ADMINLOGINRES)Session["LoginResult"];

        if (devResv == null)
        {
            UNIDEVICE[] devResvRes;
            if (Session["devInfo"] == null)
            {
                DEVREQ devReqGet = new DEVREQ();

                if (m_Request.Device.Get(devReqGet, out devResvRes) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    devResv = devResvRes;
                }
                else
                {
                }
            }
        }

        if (GetResvID.EndsWith(","))
        {
            GetResvID = GetResvID.Substring(0, GetResvID.Length - 1);
        }

        string szThirdResvInfo = GetResvInfo(szStart, szEnd, szCamp, szBuildingID, szRoomID, devResv, loginRes, GetResvID);

        // Logger.trace("szThirdResvInfo:"+szThirdResvInfo);
        szThirdResvInfo = szThirdResvInfo.Replace("<br />", "");
        m_szDev         = m_szDev + szThirdResvInfo;
        if (m_szDev.EndsWith(","))
        {
            m_szDev = m_szDev.Substring(0, m_szDev.Length - 1);
        }


        m_szDev += "]";
        // Logger.trace("thirdresv=" + m_szDev);
        Response.Write(m_szDev);
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            YARDRESVREQ vrParameter = new YARDRESVREQ();
            string      szCheckStat = Request["dwCheckStat"];
            string      szKey       = Request["szGetKey"];
            string      szPID       = Request["dwPID"];
            string      szDelID     = Request["delID"];


            if (szPID != null && szPID != "")
            {
                UNIACCOUNT accno;
                if (GetAccByLogonName(szPID, out accno))
                {
                    vrParameter.dwApplicantID = accno.dwAccNo;
                }
            }
            if (szKey != null && szKey != "")
            {
                vrParameter.dwDevID = Parse(szKey);
            }
            string szBuildingIDs = Request["szBuildingIDs"];
            if (szBuildingIDs != "0")
            {
                vrParameter.szBuildingIDs = szBuildingIDs;
            }

            uint uBeginDate = GetDate(Request["dwStartDate"]);
            uint uEndDate   = GetDate(Request["dwEndDate"]);
            vrParameter.dwBeginDate = uBeginDate;
            vrParameter.dwEndDate   = uEndDate;

            //  vrParameter.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS;
            vrParameter.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER;
            if (!(szCheckStat == null || szCheckStat == "" || szCheckStat == "0"))
            {
                vrParameter.dwCheckStat = Parse(szCheckStat);
            }
            if (szCheckStat != null && szCheckStat == "4")
            {
                vrParameter.dwStatFlag  = (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL;
                vrParameter.dwCheckStat = null;
            }
            YARDRESV[] vrResult;
            // GetPageCtrlValue(out vrParameter.szReqExtInfo);
            if (m_Request.Reserve.GetYardResv(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                System.IO.StringWriter swCSV = new System.IO.StringWriter();
                swCSV.WriteLine("预约号,申请人姓名,资源名称,状态,提交时间,申请时间,时段,位置,申请说明");

                uint uTimeNow = Get1970Seconds(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
                for (int i = 0; i < vrResult.Length; i++)
                {
                    System.Text.StringBuilder sbText = new System.Text.StringBuilder();


                    uint uState = (uint)vrResult[i].dwStatus;
                    sbText = AppendCSVFields(sbText, vrResult[i].dwResvID.ToString());
                    sbText = AppendCSVFields(sbText, vrResult[i].szApplicantName.ToString());
                    sbText = AppendCSVFields(sbText, vrResult[i].szDevName);

                    if (((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_DONE) > 0) && (((uState & (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_DOING) > 0)))
                    {
                        vrResult[i].dwStatus = (uint)UNIRESERVE.DWSTATUS.RESVSTAT_DONE;
                    }
                    sbText = AppendCSVFields(sbText, GetJustName((vrResult[i].dwStatus), "Reserve_Status"));
                    sbText = AppendCSVFields(sbText, Get1970Date((uint)vrResult[i].dwOccurTime, "MM-dd HH:mm"));
                    sbText = AppendCSVFields(sbText, Get1970Date((uint)vrResult[i].dwBeginTime, "MM-dd HH:mm") + "到" + Get1970Date((uint)vrResult[i].dwEndTime, "MM-dd HH:mm"));
                    string szOp   = "";
                    uint   nHour  = Parse(Get1970Date((uint)vrResult[i].dwBeginTime, "HHmm"));
                    string szHour = "";
                    if (nHour < 1300)
                    {
                        szHour = "上午";
                    }
                    else if (nHour >= 1300 && nHour < 1800)
                    {
                        szHour = "下午";
                    }
                    else if (nHour >= 1800)
                    {
                        szHour = "晚上";
                    }
                    sbText = AppendCSVFields(sbText, szHour);

                    if ((!(((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNSETTLE) > 0)) || !(((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNDO) > 0))))
                    {
                        szOp = "'OPTD OPTD" + uState + "'";
                    }
                    else
                    {
                        szOp = "";
                    }
                    sbText = AppendCSVFields(sbText, vrResult[i].szBuildingName);
                    string szDetail = vrResult[i].szMemo;
                    if (szDetail.Length > 10)
                    {
                        szDetail = szDetail.Substring(0, 10) + "...";
                    }
                    sbText = AppendCSVFields(sbText, vrResult[i].szMemo);
                    //去掉尾部的逗号
                    sbText.Remove(sbText.Length - 1, 1);
                    swCSV.WriteLine(sbText.ToString());
                }
                DownloadFile(Response, swCSV.GetStringBuilder(), "RuleDaySum.csv");
                swCSV.Close();
                Response.End();
            }
        }
    }
Ejemplo n.º 14
0
    private REQUESTCODE CheckAll(YARDRESVCHECKINFO[] vtRes)
    {
        REQUESTCODE          uResponse = REQUESTCODE.EXECUTE_FAIL;
        YARDRESVCHECKINFOREQ vrPar     = new YARDRESVCHECKINFOREQ();
        string szCheckIDs = Request["ID"];

        vrPar.dwCheckID      = (vtRes[0].dwCheckID);
        vrPar.dwCheckStat    = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_CANDO;
        vrPar.dwNeedYardResv = 1;
        YARDRESVCHECKINFO[] vtRes1;
        uResponse = m_Request.Reserve.GetYardResvCheckInfo(vrPar, out vtRes1);
        if (vtRes1 != null && vtRes1.Length == 0)
        {
            return(REQUESTCODE.EXECUTE_SUCCESS);
        }
        YARDRESVCHECK setValue = new YARDRESVCHECK();

        setValue.dwCheckID   = vtRes[0].dwCheckID;
        setValue.dwCheckKind = vtRes[0].dwCheckKind;
        setValue.dwResvID    = vtRes[0].dwResvID;
        setValue.YardResv    = vtRes[0].YardResv;
        //setValue.YardResv.dwActivityLevel =vtRes[0].YardResv.dw Parse(Request["dwActivityLevel"]);
        //setValue.YardResv.dwSecurityLevel = Parse(Request["dwSecurityLevel"]);
        setValue.YardResv.dwCheckKinds = Parse(Request["dwDirectors"]);
        setValue.szCheckDetail         = Request["szCheckInfo"];
        string szDevID = Request["devID"];

        if (szDevID != null && szDevID != "")
        {
            UNIDEVICE dev;
            if (getDevByID(szDevID, out dev))
            {
                setValue.YardResv.dwDevID    = dev.dwDevID;
                setValue.YardResv.dwDevKind  = dev.dwKindID;
                setValue.YardResv.dwDevSN    = dev.dwDevSN;
                setValue.YardResv.szDevName  = dev.szDevName;
                setValue.YardResv.dwLabID    = dev.dwLabID;
                setValue.YardResv.dwRoomID   = dev.dwRoomID;
                setValue.YardResv.szRoomName = dev.szRoomName;
            }
            YARDRESVREQ vrYardGet = new YARDRESVREQ();
            vrYardGet.dwResvID = vtRes[0].dwResvID;
            YARDRESV[] vtYardResv;
            if (m_Request.Reserve.GetYardResv(vrYardGet, out vtYardResv) == REQUESTCODE.EXECUTE_SUCCESS && vtYardResv != null && vtYardResv.Length > 0)
            {
                YARDRESV setYardResv = new YARDRESV();
                setYardResv         = vtYardResv[0];
                setYardResv.dwDevID = dev.dwDevID;
                m_Request.Reserve.SetYardResv(setYardResv, out setYardResv);
            }
        }
        string szCheckName = Request["checkstate"];

        if (szCheckName == "16")
        {
            setValue.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_OK;
        }
        else
        {
            setValue.dwCheckStat = (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_OK + (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_REDO;
        }
        setValue.szCheckDetail = Request["szCheckDetail"];
        uResponse = m_Request.Reserve.YardResvCheck(setValue);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            uResponse = CheckByResvID(setValue.dwResvID.ToString(), setValue.dwCheckStat, setValue.szCheckDetail);
            return(REQUESTCODE.EXECUTE_SUCCESS);
        }
        else
        {
            return(REQUESTCODE.EXECUTE_FAIL);
        }
    }
Ejemplo n.º 15
0
    private void InitYardResv(uint start, uint end)
    {
        YARDRESVREQ req = new YARDRESVREQ();

        req.dwBeginDate              = start;
        req.dwEndDate                = end;
        req.dwApplicantID            = acc.dwAccNo;
        req.szReqExtInfo.szOrderKey  = "dwResvGroupID DESC,OccurTime";
        req.szReqExtInfo.szOrderMode = "ASC";
        //req.dwReqProp = (uint)YARDRESVREQ.DWREQPROP.YARDREQ_ONLYMAINRESV;
        req.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER | (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE | (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;
        YARDRESV[] rlt;
        if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            CHECKTYPE[] mantypes  = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DEVMAN);
            CHECKTYPE[] dicttypes = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_DIRECTOR);
            CHECKTYPE[] servtypes = GetCheckType(null, (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SERVICE);
            //获取服务列表
            for (int i = 0; i < servtypes.Length; i++)
            {
                svcArray += servtypes[i].dwCheckKind + ",";
            }
            if (svcArray.Length > 0)
            {
                svcArray = svcArray.Substring(0, svcArray.Length - 1);
            }
            //
            string delList = "";
            for (int i = 0; i < rlt.Length; i++)
            {
                YARDRESV resv    = rlt[i];
                string   groupId = resv.dwResvGroupID.ToString();
                bool     over    = (resv.dwStatus & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_DONE) > 0;
                //预约明细
                if (i == 0 || rlt[i - 1].dwResvGroupID != resv.dwResvGroupID)
                {
                    delList     = resv.dwResvID.ToString();
                    timeDetail += (i == 0 ? "" : "</tbody></table></div>") + "<div id='timedetail_" + groupId + "'><table class='timedetail_info state_info uni_sort_tbl'><thead><tr><th class='sort_asc'>时间</th></tr></thead><tbody>";
                    //timeDetail += (i == 0 ? "" : "</tbody></table></div>") + "<div id='timedetail_" + groupId + "'><table class='timedetail_info state_info uni_sort_tbl'><thead><tr><th>预约号</th><th class='sort_asc'>时间</th><th>状态</th><th class='no_sort'>操作</th></tr></thead><tbody>";
                }
                else
                {
                    delList += "," + resv.dwResvID;
                }
                timeDetail += "<tr class='tdetail_tr_" + resv.dwResvID + "'><td>" + Get1970Date((int)resv.dwBeginTime) + "至" + Get1970Date((int)resv.dwEndTime).Substring(11) + "</td></tr>" + (i == rlt.Length - 1 ? "</tbody></table></div>" : "");
//                timeDetail += "<tr class='tdetail_tr_"+resv.dwResvID+"'><td>" + resv.dwResvID + "</td><td>" + Get1970Date((int)resv.dwBeginTime) + "至" + Get1970Date((int)resv.dwEndTime).Substring(11) + "</td><td>" + Util.Converter.ResvStatusConverter(resv.dwStatus) + "</td>" +
//"<td class='text-center resv_act'>" + GetResvAct(resv) + "</td></tr>" + (i == rlt.Length - 1 ? "</tbody></table></div>" : "");
                if (i < rlt.Length - 1 && rlt[i + 1].dwResvGroupID == resv.dwResvGroupID)//非同组最后一个
                {
                    continue;
                }
                string timespan = resv.szCycRule;
                bool   isCycle  = true;
                if (i == 0 || rlt[i - 1].dwResvGroupID != resv.dwResvGroupID)//非周期预约
                {
                    isCycle  = false;
                    timespan = Get1970Date((int)resv.dwBeginTime) + "至" + Get1970Date((int)resv.dwEndTime).Substring(11);
                }
                string occurtime = Get1970Date((int)resv.dwOccurTime);
                //申请模版
                string applyTbl = "apply";
                //申请模版
                if ((resv.dwSecurityLevel & 0x20000000) > 0)//会议模版
                {
                    applyTbl = "apply_hy";
                }

                string man     = "";
                string dict    = "";
                string service = "";
                bool   noCheck = true;//未审核
                if (over)
                {
                    man     = "<span class='grey'>见【审核详情】</span>";
                    dict    = "<span class='grey'>见【审核详情】</span>";
                    service = "<span class='grey'>见【审核详情】</span>";
                }
                else
                {
                    string msg;
                    YARDRESVCHECKINFO[] ckInfo = GetResvCheckInfo(resv.dwResvID.ToString(), out msg);
                    for (int j = 0; j < ckInfo.Length; j++)
                    {
                        YARDRESVCHECKINFO info = ckInfo[j];
                        if (noCheck && (info.dwCheckStat & (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_ADMINOK) > 0)
                        {
                            noCheck = false;
                        }
                        CHECKTYPE mantype  = IsInAarray(info.dwCheckKind, mantypes);
                        CHECKTYPE dicttype = IsInAarray(info.dwCheckKind, dicttypes);
                        CHECKTYPE servtype = IsInAarray(info.dwCheckKind, servtypes);
                        if (mantype.dwCheckKind != null)
                        {
                            man = resv.szDeptName + "<br/>" + Util.Converter.GetCheckState(info.dwCheckStat);
                        }
                        else if (dicttype.dwCheckKind != null)
                        {
                            string name = dicttype.szDeptName;
                            if (string.IsNullOrEmpty(name.Trim()))
                            {
                                name = acc.szDeptName;
                            }
                            //if (dicttype.dwDeptID != null || dicttype.dwDeptID != 0) name = acc.szDeptName;
                            dict = name + "<br/>" + Util.Converter.GetCheckState(info.dwCheckStat);
                        }
                        else if (servtype.dwCheckKind != null)
                        {
                            service += info.szCheckName + "<br/>";//"(" + Util.Converter.GetCheckState(info.dwCheckStat) + ")<br/>"
                        }
                    }
                }
                resvList += "<tbody date='" + occurtime + "' over='" + (over?"true":"false") + "' style='display:none;'>" +
                            "<tr class='head'><td colspan='6'><h3>" + resv.szResvName + "<small>" + ((resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0 ? "(不公开)" : "(公开)") + "</small></h3>"
                            + "<span>状态:<strong class='green'>" + Util.Converter.ResvStatusWithCheck(resv.dwStatus) + "</strong> </span><span class='pull-right'>"
                            + "<span class='grey'>单号:" + groupId + " </span><a class='activity_detail' resv_id='" + groupId + "'>详情</a></span></td></tr>"
                            + "<tr class='content'><td><div class='box'><span class='load_apply_detail'>" + resv.szDevName + "</span><br/><a target='_blank' href='applydetail.aspx?resv_id=" + groupId + "' >详细</a> | <a onclick='copyApply(\"" + groupId + "\",\"" + resv.dwActivitySN + "\",\"" + applyTbl + ".aspx\")'>复制申请</a></div></td>"
                            + "<td>" + dict + "</td>"
                            + "<td>" + man + "</td>"
                            + "<td>" + timespan + "<button type='button' class='btn btn-info btn-xs time_detail " + (isCycle?"":"hidden") + "' resv_id='" + groupId + "' no_check='" + noCheck + "'><<时间明细&nbsp;</button></td>"
                            + "<td>服务:<br /><span class='part'>" + service + "</span></td>"
                            + "<td class='text-center'><div style='margin: 5px auto;'>" + GetAct(resv, delList, noCheck) + "</div><div>"
                            + "<button type='button' class='btn btn-info btn-xs check_state' resv_id='" + resv.dwResvID + "'>&nbsp;审核详情&nbsp;</button></div></td></tr></tbody>";
                detailList += "<div id='detail_" + groupId + "'><table class='detail_info'>"
                              + "<tr><td>活动场景</td><td>" + resv.szActivityName + "</td></tr>"
                              + "<tr><td>组织方</td><td>" + resv.szOrganization + "</td></tr>"
                              + "<tr><td>人数规模</td><td>" + resv.dwMaxAttendance + "人 </td></tr>"
                              + "<tr><td>校区</td><td>" + resv.szCampusName + "</td></tr>"
                              + "<tr><td>申请时间</td><td>" + occurtime + "</td></tr>"
                              + "<tr><td>是否盈利</td><td>" + ((resv.dwProperty & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_PROFIT) > 0?"营利":"非营利") + "</td></tr></table></div>";
            }
            if (rlt.Length == 0)
            {
                resvList = "<tbody><tr><td colspan='6' class='text-center'>没有数据</td></tr></tbody>";
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
        //删除明细
        //    req.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL;
        //    req.dwBeginDate = ToUInt(DateTime.Now.AddMonths(-12).ToString("yyyyMMdd"));
        //    if (m_Request.Reserve.GetYardResv(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        //    {
        //        for (int i = 0; i < rlt.Length; i++)
        //        {
        //            YARDRESV resv = rlt[i];
        //            delList += "<tr class='it'><td>" + resv.dwResvID + "</td><td>" + resv.szResvName + "</td><td>" + resv.szDevName + "</td>" +
        //"<td>" + resv.szDeptName + "</td><td class='text-center'>" + Get1970Date((int)resv.dwBeginTime).Substring(5) + "至" + Get1970Date((int)resv.dwEndTime).Substring(5) + "</td>" +
        //"<td class='text-center'>" + Get1970Date((int)resv.dwOccurTime) + "</td></tr>";
        //        }
        //        if (rlt.Length == 0)
        //        {
        //            resvList = "<tbody><tr><td colspan='6' class='text-center'>没有数据</td></tr></tbody>";
        //        }
        //    }
        //    else
        //    {
        //        MsgBoxH(m_Request.szErrMsg);
        //    }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UNICAMPUS[] vtCamp = GetAllCampus();
        szCamp += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        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());
            }
        }
        UNIDEVCLS[] vtKind = GetAllDevCls();
        szKinds += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        for (int i = 0; vtKind != null && i < vtKind.Length; i++)
        {
            szKinds += GetInputItemHtml(CONSTHTML.option, "", vtKind[i].szClassName.ToString(), vtKind[i].dwClassID.ToString());
        }
        UNIBUILDING[] vtBuilding = getAllBuilding();
        szBuilding += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        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());
            }
        }
        CODINGTABLE[] vtCodeing = getCodeTableByType((uint)CODINGTABLE.DWCODETYPE.CODE_YARDRESVKIND);
        for (int i = 0; vtCodeing != null && i < vtCodeing.Length; i++)
        {
            szYardKind += GetInputItemHtml(CONSTHTML.radioButton, "dwKind", vtCodeing[i].szCodeName, vtCodeing[i].szCodeSN);
        }
        UNILAB newLab;

        if (IsPostBack)
        {
        }

        if (Request["op"] == "set")
        {
            bSet = true;
            REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
            YARDRESVREQ vrPar     = new YARDRESVREQ();
            string      szResvID  = Request["ID"];
            vrPar.dwResvID   = Parse(szResvID);
            vrPar.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER;
            YARDRESV[] vtRes;
            uResponse = m_Request.Reserve.GetYardResv(vrPar, out vtRes);
            if (uResponse != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else if (vtRes.Length > 0 && vtRes[0].dwActivitySN != null)
            {
                YARDRESV yardResv = vtRes[0];
                szMemoYardResv = vtRes[0].szMemo;
                uint uResvPro = (uint)yardResv.dwProperty;

                PutHTTPObj(yardResv);

                if ((uResvPro & 67108864) > 0)//是否使用多媒体
                {
                    PutMemberValue("resvPro3", "1");
                }
                else
                {
                    PutMemberValue("resvPro2", "2");
                }
                if ((uResvPro & (uint)UNIRESERVE.DWPROPERTY.RESVPROP_UNOPEN) > 0)//是否公开
                {
                    PutMemberValue("resvPro4", "2");
                }
                else
                {
                    PutMemberValue("resvPro4", "1");
                }

                PutMemberValue("dwKind", yardResv.dwKind.ToString());
                szResvDevName  = vtRes[0].szDevName;
                szResvDevDept  = vtRes[0].szDeptName;
                szApplyName    = vtRes[0].szApplicantName;
                szActivity     = vtRes[0].szActivityName;
                szPeople       = vtRes[0].dwMinAttendance.ToString() + "-" + vtRes[0].dwMaxAttendance.ToString() + "人";
                szOrganiger    = vtRes[0].szOrganiger;
                szOrganization = vtRes[0].szOrganization;

                szPreDate   = vtRes[0].dwPreDate.ToString();
                szResvBegin = Get1970Date(vtRes[0].dwBeginTime, "HHmm");
                szResvEnd   = Get1970Date(vtRes[0].dwEndTime, "HHmm");


                szLeveal        = GetJustNameEqual(vtRes[0].dwActivityLevel, "Yard_ActivityLevel");
                szSecurityLevel = GetJustNameEqual(vtRes[0].dwSecurityLevel, "Yard_dwSecurityLevel");
                szDirectors     = GetJustNameEqual(vtRes[0].dwCheckKinds, "Yard_dwDirectors");
                szDesiredUser   = yardResv.szDesiredUser;
                dwMinAttendance = yardResv.dwMaxAttendance.ToString();

                uint         uCheckKinds    = (uint)vtRes[0].dwCheckKinds;
                CHECKTYPEREQ vrCheckTypeReq = new CHECKTYPEREQ();
                vrCheckTypeReq.dwMainKind = (uint)CHECKTYPE.DWMAINKIND.ADMINCHECK_SERVICE;
                CHECKTYPE[] vtCheckType;
                if (m_Request.Admin.CheckTypeGet(vrCheckTypeReq, out vtCheckType) == REQUESTCODE.EXECUTE_SUCCESS && vtCheckType != null && vtCheckType.Length > 0)
                {
                    for (int m = 0; m < vtCheckType.Length; m++)
                    {
                        if ((uCheckKinds & (uint)vtCheckType[m].dwCheckKind) > 0)
                        {
                            szServiceType += vtCheckType[m].szCheckName + ",";
                        }
                    }
                }
                if ((vtRes[0].dwProperty & ((uint)UNIRESERVE.DWPROPERTY.RESVPROP_NEEDVIDEO)) > 0)
                {
                    szNeedCameor = "需要";
                }
                UNIACCOUNT accno;
                if (GetAccByAccno(vtRes[0].dwApplicantID.ToString(), out accno))
                {
                    accno.szTrueName = accno.szTrueName + "(" + accno.szLogonName + ")";
                    PutMemberValue("szTrueName", accno.szTrueName);
                    szMemo = vtRes[0].szMemo;

                    string[] szMemoList = szMemo.Split('$');
                    if (szMemoList != null && szMemoList.Length > 0)
                    {
                        szMemo    = szMemoList[0];
                        szMemoExt = szMemoList[0].Replace("&", ",");
                    }
                }
                szResvTime = vtRes[0].szCycRule;
                if (szResvTime == "")
                {
                    szResvTime = Get1970Date(vtRes[0].dwBeginTime) + "至" + Get1970Date(vtRes[0].dwEndTime) + ";";
                }
                if (vtRes[0].szApplicationURL != null && vtRes[0].szApplicationURL != "")
                {
                    PutMemberValue("szApplicationURL", vtRes[0].szApplicationURL);
                }
            }
        }
        else
        {
        }
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNIBUILDING[] vtBuilding = getAllBuilding();
        szBuilding = GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        if (vtBuilding != null)
        {
            for (int i = 0; i < vtBuilding.Length; i++)
            {
                szBuilding += GetInputItemHtml(CONSTHTML.option, "", vtBuilding[i].szBuildingName, vtBuilding[i].dwBuildingID.ToString());
            }
        }
        UNICAMPUS[] vtCamp = GetAllCampus();
        szCamp += GetInputItemHtml(CONSTHTML.option, "", "全部", "0");
        for (int i = 0; i < vtCamp.Length; i++)
        {
            szCamp += GetInputItemHtml(CONSTHTML.option, "", vtCamp[i].szCampusName, vtCamp[i].dwCampusID.ToString());
        }


        YARDRESVREQ vrParameter = new YARDRESVREQ();
        string      szCheckStat = Request["dwCheckStat"];
        //string szKey = Request["szGetKey"];
        string szPID   = Request["dwPID"];
        string szDelID = Request["delID"];

        if (szDelID != null && szDelID != "")
        {
            DelResv(szDelID);
        }
        if (!IsPostBack)
        {
            vrParameter.dwBeginDate = GetDate(DateTime.Now.AddDays(0).ToString("yyyy-MM-dd"));
            vrParameter.dwEndDate   = GetDate(DateTime.Now.AddDays(0).ToString("yyyy-MM-dd"));

            dwStartDate.Value = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd");
            dwEndDate.Value   = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd");
        }
        if (szPID != null && szPID != "")
        {
            UNIACCOUNT accno;
            if (GetAccByLogonName(szPID, out accno))
            {
                vrParameter.dwApplicantID = accno.dwAccNo;
            }
        }

        /*
         * if (szKey != null && szKey != "")
         * {
         *  roomid
         *  vrParameter.dwDevID = Parse(szKey);
         *
         * }*/
        string szRoomIDs = Request["roomid"];

        if (szRoomIDs != null && szRoomIDs != "0" && szRoomIDs != "")
        {
            vrParameter.szRoomIDs = szRoomIDs;
        }
        string szBuildingIDs = Request["szBuildingIDs"];

        if (szBuildingIDs != "0")
        {
            vrParameter.szBuildingIDs = szBuildingIDs;
        }
        string szCampusIDs = Request["szCampusIDs"];

        if (szCampusIDs != "0")
        {
            vrParameter.szCampusIDs = szCampusIDs;
        }
        if (dwStartDate.Value != "" && dwEndDate.Value != "")
        {
            vrParameter.dwBeginDate = GetDate(dwStartDate.Value);
            vrParameter.dwEndDate   = GetDate(dwEndDate.Value);
        }
        //  vrParameter.dwClassKind = (uint)UNIDEVCLS.DWKIND.CLSKIND_COMMONS;
        vrParameter.dwStatFlag = (uint)RESVREQ.DWSTATFLAG.STATFLAG_INUSE + (uint)RESVREQ.DWSTATFLAG.STATFLAG_OVER + (uint)RESVREQ.DWSTATFLAG.STATFLAG_CHECKFAIL;
        if (!(szCheckStat == null || szCheckStat == "" || szCheckStat == "0"))
        {
            vrParameter.dwCheckStat = Parse(szCheckStat);
        }
        if (szCheckStat != null && szCheckStat == "32")
        {
            vrParameter.dwStatFlag  = (uint)RESVREQ.DWSTATFLAG.STATFLAG_DEL;
            vrParameter.dwCheckStat = null;
        }
        YARDRESV[] vrResult;
        GetPageCtrlValue(out vrParameter.szReqExtInfo);
        if (m_Request.Reserve.GetYardResv(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            uint uTimeNow = Get1970Seconds(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
            for (int i = 0; i < vrResult.Length; i++)
            {
                uint uState = (uint)vrResult[i].dwStatus;
                m_szOut += "<tr>";
                m_szOut += "<td data-id=\"" + vrResult[i].dwResvID.ToString() + "\">" + vrResult[i].dwResvID.ToString() + "</td>";
                m_szOut += "<td class='lnkAccount' data-id='" + vrResult[i].dwApplicantID.ToString() + "' title='查看个人信息'><a href=\"#\">" + vrResult[i].szApplicantName.ToString() + "</a></td>";
                m_szOut += "<td>" + vrResult[i].szDevName + "</td>";

                if (((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_DONE) > 0) && (((uState & (uint)ADMINCHECK.DWCHECKSTAT.CHECKSTAT_DOING) > 0)))
                {
                    vrResult[i].dwStatus = (uint)UNIRESERVE.DWSTATUS.RESVSTAT_DONE;
                }
                m_szOut += "<td>" + GetJustName((vrResult[i].dwStatus), "Reserve_Status") + "</td>";
                m_szOut += "<td>" + Get1970Date((uint)vrResult[i].dwOccurTime, "MM-dd HH:mm") + "</td>";
                m_szOut += "<td>" + Get1970Date((uint)vrResult[i].dwBeginTime, "MM-dd HH:mm") + "到" + Get1970Date((uint)vrResult[i].dwEndTime, "MM-dd HH:mm") + "</td>";
                string szOp = "";



                if ((!(((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNSETTLE) > 0)) || !(((uState & (uint)UNIRESERVE.DWSTATUS.RESVSTAT_UNDO) > 0))))
                {
                    szOp = "'OPTD OPTD" + uState + "'";
                }
                else
                {
                    szOp = "";
                }
                m_szOut += "<td>" + vrResult[i].szBuildingName + "</td>";
                string szDetail = vrResult[i].szMemo;
                if (szDetail.Length > 10)
                {
                    szDetail = szDetail.Substring(0, 10) + "...";
                }
                m_szOut += "<td title='" + vrResult[i].szMemo + "'>" + szDetail + "</td>";
                szOp     = "OPTD";
                m_szOut += "<td><div class=" + szOp + "></div></td>";
                m_szOut += "</tr>";
            }
            UpdatePageCtrl(m_Request.Reserve);
        }
        PutBackValue();
    }