Esempio n. 1
0
    private void OkPage()
    {
        int id = int.Parse(Utils.GetRequest("id", "all", 2, @"^[1-9]\d*$", "ID错误"));

        BCW.Model.Game.GiftChange model = new BCW.BLL.Game.GiftChange().GetGiftChange(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        string info = Utils.GetRequest("info", "post", 1, "", "");

        if (info == "ok")
        {
            string Message = Utils.GetRequest("Message", "post", 3, @"^[\s\S]{1,300}$", "内线内容最多300字");
            int    State   = int.Parse(Utils.GetRequest("State", "post", 2, @"^[0-1]\d*$", "选择状态错误"));
            if (Message != "")
            {
                //发送内线
                new BCW.BLL.Guest().Add(model.UsID, model.UsName, Message);
            }
            //更新状态
            new BCW.BLL.Game.GiftChange().UpdateState(id, State);

            Utils.Success("完成兑换操作", "完成兑换操作成功..", Utils.getUrl("flows.aspx?act=ok&id=" + id + ""), "1");
        }
        else
        {
            Master.Title = "完成兑换";
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("完成兑换");
            builder.Append(Out.Tab("</div>", ""));

            string strText = "发送内线(留空则不发送内线):/,兑换状态:/,,,";
            string strName = "Message,State,id,act,info";
            string strType = "text,select,hidden,hidden,hidden";
            string strValu = "'" + model.State + "'" + id + "'ok'ok'";
            string strEmpt = "true,0|未完成|1|已完成,false,false,false";
            string strIdea = "/";
            string strOthe = "确定,flows.aspx,post,1,red";

            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<a href=\"" + Utils.getUrl("flows.aspx") + "\">返回上一级</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
    }
Esempio n. 2
0
    private void ViewPage()
    {
        Master.Title = "日志列表";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("日志列表");
        builder.Append(Out.Tab("</div>", "<br />"));
        int    ptype = int.Parse(Utils.GetRequest("ptype", "get", 2, @"^[1-9]\d*$", "类型错误"));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;

        strWhere = "Types=" + ptype + "";
        string[] pageValUrl = { "act", "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        // 开始读取列表
        IList <BCW.Model.Game.GiftChange> listGiftChange = new BCW.BLL.Game.GiftChange().GetGiftChanges(pageIndex, pageSize, strWhere, out recordCount);

        if (listGiftChange.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Game.GiftChange n in listGiftChange)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }

                builder.Append("兑换人:<a href=\"" + Utils.getUrl("../uinfo.aspx?uid=" + n.UsID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "(" + n.UsID + ")</a>");
                builder.Append("<br />描述:" + ((n.Notes == "") ? "无" : n.Notes) + "(" + DT.FormatDate(n.AddTime, 0) + ")");
                if (n.Types == 1 || n.Types == 2 || n.Types == 10 || n.Types == 11)
                {
                    if (n.State == 0)
                    {
                        builder.Append("<br />兑换状态:<a href=\"" + Utils.getUrl("flows.aspx?act=ok&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">未完成</a>");
                    }
                    else
                    {
                        builder.Append("<br />兑换状态:<a href=\"" + Utils.getUrl("flows.aspx?act=ok&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">已完成</a>");
                    }
                }
                k++;
                builder.Append(Out.Tab("</div>", ""));
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("flows.aspx") + "\">返回上一级</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }