Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        POLLONLINEREQ vrGet = new POLLONLINEREQ();

        vrGet.dwPollID = Parse(Request["ID"]);

        POLLONLINE[] vtRes;
        if (m_Request.Admin.GetPollOnLine(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
            {
                POLLITEM[] itemList = vtRes[0].PollItems;
                for (int i = 0; itemList != null && i < itemList.Length; i++)
                {
                    sz_Out += "<tr><td>" + itemList[i].szItemName + "</td><td>" + itemList[i].dwVotes.ToString() + "</td></tr>";
                }
            }
            m_Title = "查看投票信息";
        }
    }
Exemplo n.º 2
0
    private void GetCastVote()
    {
        POLLONLINEREQ req = new POLLONLINEREQ();

        req.dwBeginDate = ToUInt(DateTime.Now.AddYears(-1).ToString("yyyyMMdd"));
        req.dwEndDate   = ToUInt(DateTime.Now.AddYears(1).ToString("yyyyMMdd"));
        req.dwVoteStat  = (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_OPENING | (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_DONE;
        POLLONLINE[] rlt;
        if (m_Request.Admin.GetPollOnLine(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            voteList = "";
            for (int i = 0; i < rlt.Length; i++)
            {
                POLLONLINE vote   = rlt[i];
                bool       isDone = (vote.dwVoteStat & (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_DONE) > 0;
                voteList += "<tr class='it'><td style='padding:10px 5px;'>" + vote.szPollSubject + "</td>" +
                            "<td style='font-size:12px;vertical-align:top;'>" + vote.szMemo + "</td>" +
                            "<td class='text-center'>" + ToDate(vote.dwEndDate) + "</td>" +
                            "<td class='text-center'>" + vote.dwTotalUsers + "</td>" +
                            "<td class='text-center'>" + ToState(vote.dwVoteStat) + "</td>" +
                            "<td class='text-center'><a class='to-cast' url='../a/votedetail.aspx?back=true&type=poll&id=" + vote.dwPollID + "' cache='#cache_con'>" + (isDone?"查看":"投票") + "</a></td></tr>";
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        REQUESTCODE   uResponse = REQUESTCODE.EXECUTE_FAIL;
        POLLONLINEREQ vrPar     = new POLLONLINEREQ();

        GetHTTPObj(out vrPar);
        if (!IsPostBack)
        {
            vrPar.dwBeginDate = GetDate(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
            vrPar.dwEndDate   = GetDate(DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"));

            dwStartDate.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            dwEndDate.Value   = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd");
        }
        if (dwStartDate.Value != "" && dwEndDate.Value != "")
        {
            vrPar.dwBeginDate = GetDate(dwStartDate.Value);
            vrPar.dwEndDate   = GetDate(dwEndDate.Value);
        }
        if (vrPar.dwVoteStat == null || ((uint)vrPar.dwVoteStat) == 0)
        {
            vrPar.dwVoteStat = null;// (uint)USERFEEDBACK.DWFEEDSTAT.FEEDSTAT_REPLIED;
        }
        string[]     szCon = { "", "★", "★★", "★★★", "★★★★", "★★★★★" };
        POLLONLINE[] vtRes;
        if (vrPar.dwVoteStat == 0)
        {
            vrPar.dwVoteStat = null;
        }
        uResponse = m_Request.Admin.GetPollOnLine(vrPar, out vtRes);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            for (int i = 0; i < vtRes.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td data-id=" + vtRes[i].dwPollID.ToString() + ">" + vtRes[i].szPollSubject + "</td>";
                m_szOut += "<td>" + GetDateStr(vtRes[i].dwBeginDate) + "到" + GetDateStr(vtRes[i].dwEndDate) + "</td>";
                m_szOut += "<td>" + vtRes[i].dwTotalUsers + "</td>";
                m_szOut += "<td>" + GetJustName(vtRes[i].dwVoteStat, "PollLine_State") + "</td>";
                m_szOut += "<td>" + "<a class='getPollInfo' id=" + vtRes[i].dwPollID.ToString() + " >查看投票信息</a>" + "</td>";
                string szOp = "OPTD";
                m_szOut += "<td><div class='" + szOp + "'></div></td>";
                m_szOut += "</tr>";
            }
            UpdatePageCtrl(m_Request.Admin);
        }
        PutBackValue();
    }
Exemplo n.º 4
0
    private void GetCastVote()
    {
        POLLONLINEREQ req = new POLLONLINEREQ();

        req.dwPollID = ToUInt(Request["id"]);
        POLLONLINE[] rlt;
        if (m_Request.Admin.GetPollOnLine(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                POLLONLINE vote = rlt[0];
                voteHeader = "<h1 class='h_title'>投票信息</h1><div class='line'></div><h3 class='text-center'>" + vote.szPollSubject + "</h3>";
                uint done   = (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_DONE | (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_CLOSED | (uint)POLLONLINE.DWVOTESTAT.VOTESTAT_UNOPEN;
                bool isDone = (vote.dwVoteStat & done) > 0;
                voteItems = "<a class='click' onclick='castVote(" + vote.dwPollID + ")'>" + (isDone ? "查看" : "投票") + "</a>";
                POLLITEM[] list = vote.PollItems;
                if (list != null && list.Length > 0)
                {
                    voteItems = "<div id='vote_" + vote.dwPollID + "'><div class='vote_items'>" +
                                "<p class='grey'>" + vote.szMemo + "</p><ul vote='" + vote.dwPollID + "'>";
                    for (int i = 0; i < list.Length; i++)
                    {
                        POLLITEM item = list[i];
                        uint?    max  = vote.dwTotalUsers * item.dwMaxTickItems;
                        double   rate = (double)item.dwVotes / (double)max * 100;
                        voteItems += "<li><label class='" + (isDone ? "grey" : "avail") + "'><input name='vote_" + vote.dwPollID + "' class='vote_item' type='radio' value='" + item.dwItemID + "' style='display:" + (isDone ? "none" : "") + "'/>"
                                     + item.szItemName + "</label><div class='progress'><div class='progress-bar  progress-bar-success' role='progressbar' aria-valuenow='"
                                     + item.dwVotes + "' aria-valuemin='0' aria-valuemax='" + max + "' style='width: " + rate + "%;'>"
                                     + item.dwVotes + "</div></div></li>";
                    }
                    string dt = ToDate(vote.dwBeginDate) + " - " + ToDate(vote.dwEndDate);
                    voteItems += "</ul><div class='grey text-right'>投票日期:" + dt + "</div><div class='text-center'>" + (isDone ? "" : "<input type='button'' class='btn btn-info' value='提交' onclick='castVote(" + vote.dwPollID + ")'/>") + "</div></div></div>";
                }
            }
        }
        else
        {
            MsgBoxH(m_Request.szErrMsg);
        }
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string     szPid    = Request["dwPollID"];
            uint       uPID     = Parse(szPid);
            POLLONLINE newValue = new POLLONLINE();
            GetHTTPObj(out newValue);
            newValue.dwPollKind  = (uint)POLLONLINE.DWPOLLKIND.POLLKIND_MTICKS;
            newValue.dwPollScope = (uint)POLLONLINE.DWPOLLSCOPE.POLLSCOPE_MEMBER_LOOK + (uint)POLLONLINE.DWPOLLSCOPE.POLLSCOPE_MEMBER_VOTE;
            POLLITEM[] itemList = (POLLITEM[])Session["POLLITEM"];
            if (itemList != null)
            {
                uint uGroupID = 1;
                for (uint i = 0; i < itemList.Length; i++)
                {
                    itemList[i].dwGroupID = uGroupID;
                    uGroupID = uGroupID + 1;
                    if (itemList[i].dwItemID == null)
                    {
                        itemList[i].dwPollKind     = (uint)POLLONLINE.DWPOLLKIND.POLLKIND_MTICKS;
                        itemList[i].dwMaxTickItems = 1;
                    }
                }
            }
            newValue.PollItems = itemList;

            ADMINLOGINRES vrAccInfo = (ADMINLOGINRES)Session["LoginResult"];

            newValue.dwAccNo = vrAccInfo.AdminInfo.dwAccNo;
            //return;
            if (m_Request.Admin.SetPollOnLine(newValue, out newValue) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "设置失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox("设置成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                Session["POLLITEM"] = null;
                return;
            }
        }
        if (Request["op"] == "set")
        {
            bSet = true;

            POLLONLINEREQ vrGet = new POLLONLINEREQ();
            vrGet.dwPollID = Parse(Request["ID"]);

            POLLONLINE[] vtRes;
            if (m_Request.Admin.GetPollOnLine(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
                {
                    PutJSObj(vtRes[0]);
                    m_Title             = "修改投票";
                    Session["POLLITEM"] = vtRes[0].PollItems;
                }
            }
        }
        else
        {
            m_Title = "新建投票";
        }
    }