Ejemplo n.º 1
0
    private void ListPage()
    {
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

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

        BCW.Model.Game.Race model = new BCW.BLL.Game.Race().GetRace(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        if (model.paytype < 1)
        {
            Utils.Error("此竞拍还没有通过审核", "");
        }
        string bzText = string.Empty;

        if (model.Types == 0)
        {
            bzText = ub.Get("SiteBz");
        }
        else
        {
            bzText = ub.Get("SiteBz2");
        }

        Master.Title = "查看出价记录";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("race.aspx?act=view&amp;id=" + id + "") + "\">返回上一级</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;

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

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

        if (listRacelist.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Game.Racelist n in listRacelist)
            {
                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("/bbs/uinfo.aspx?uid=" + n.payusid + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[" + DT.FormatDate(n.paytime, 6) + "]" + n.payname + "</a>(出价" + n.payCent + "" + bzText + ")");

                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>", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("race.aspx?act=view&amp;id=" + id + "") + "\">返回查看竞拍</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("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("race.aspx") + "\">竞拍</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Ejemplo n.º 2
0
    private void ViewPage()
    {
        int meid = new BCW.User.Users().GetUsId();

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

        BCW.Model.Game.Race model = new BCW.BLL.Game.Race().GetRace(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        string bzText = string.Empty;

        if (model.Types == 0)
        {
            bzText = ub.Get("SiteBz");
        }
        else
        {
            bzText = ub.Get("SiteBz2");
        }

        Master.Title = "查看竞拍";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(model.title);
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("" + Out.SysUBB(model.content) + "");
        if (meid > 0)
        {
            if (model.paytype == 2 && model.winID == meid)
            {
                builder.Append("<br />=保密内容=<br />" + model.pcontent + "");
            }
        }
        builder.Append(Out.Tab("</div>", "<br />"));
        if (!string.IsNullOrEmpty(model.fileurl))
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<img src=\"" + model.fileurl + "\" alt=\"load\"/>");
            builder.Append("<br /><a href=\"" + Utils.getUrl(model.fileurl) + "\">下载截图</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }

        builder.Append(Out.Tab("<div>", ""));
        builder.Append("发布时间:" + model.writetime + "");
        if (model.totime < DateTime.Now)
        {
            builder.Append("<br />剩余时间:已截止");
        }
        else
        {
            builder.Append("<br />剩余时间:" + DT.DateDiff(DateTime.Now, model.totime) + "");
        }
        builder.Append("<br />截止时间:" + model.totime + "");
        builder.Append("<br />起拍价:" + model.price + "" + bzText + "");
        builder.Append("<br />发布会员:<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=" + model.userid + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + model.username + "</a>");
        if (meid > 0)
        {
            if (model.payCount == 0 && model.userid == meid)
            {
                builder.Append("<br /><a href=\"" + Utils.getUrl("race.aspx?act=del&amp;id=" + id + "") + "\">删除竞拍</a>");
            }
        }
        if (model.paytype == 2 && model.winID != 0)
        {
            builder.Append("<br /><b>竞拍最后得主:</b><a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=" + model.winID + "") + "\">" + model.winName + "</a>");
        }
        else
        {
            if (model.winID > 0)
            {
                builder.Append("<br /><b>当前最高价:</b>" + model.topPrice + "" + bzText + ",<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=" + model.winID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + model.winName + "</a>");
            }
        }
        builder.Append(Out.Tab("</div>", "<br />"));
        if (model.paytype > 0)
        {
            if (model.paytype == 1 && model.totime > DateTime.Now)
            {
                //增幅
                long paycents = 0;
                if (model.Types == 0)
                {
                    paycents = model.topPrice + Convert.ToInt64(ub.GetSub("RaceZfPrice", xmlPath));
                }
                else
                {
                    paycents = model.topPrice + Convert.ToInt64(ub.GetSub("RaceZfPrice2", xmlPath));
                }

                builder.Append(Out.Tab("<div>", ""));
                long gold  = new BCW.BLL.User().GetGold(meid);
                long money = new BCW.BLL.User().GetMoney(meid);
                builder.Append("您目前共有" + Utils.ConvertGold(gold) + "" + ub.Get("SiteBz") + "/" + Utils.ConvertGold(money) + "" + ub.Get("SiteBz2") + "");
                builder.Append(Out.Tab("</div>", "<br />"));
                strText = "出价(须高于最高价和起拍价):/,,";
                strName = "payCent,id,act";
                strType = "stext,hidden,hidden";
                strValu = "" + paycents + "'" + id + "'pay";
                strEmpt = "false,false,false";
                strIdea = "";
                strOthe = "我拍,race.aspx,post,3,red";
                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("增幅至少" + (paycents - model.topPrice) + "" + bzText + ",即" + paycents + "" + bzText + "");
                builder.Append(Out.Tab("</div>", "<br />"));
            }
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("=最新出价=");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            IList <BCW.Model.Game.Racelist> listRacelist = new BCW.BLL.Game.Racelist().GetRacelists(5, "raceid=" + id + "");
            if (listRacelist.Count > 0)
            {
                foreach (BCW.Model.Game.Racelist n in listRacelist)
                {
                    builder.Append("<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=" + n.payusid + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.payname + "出价" + n.payCent + "" + bzText + "</a>" + DT.DateDiff(DateTime.Now, n.paytime) + "前<br />");
                }
                builder.Append("<a href=\"" + Utils.getUrl("race.aspx?act=list&amp;id=" + id + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">&gt;&gt;更多出价记录</a>");
            }
            else
            {
                builder.Append("没有出价记录..");
            }
            builder.Append(Out.Tab("</div>", ""));
            //显示闲聊
            builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
            builder.Append("=最新留言=");
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(BCW.User.Users.ShowSpeak(4, "race.aspx", 5, meid, "view", id));
            builder.Append(Out.Tab("", "<br />"));
        }
        builder.Append(Out.Tab("<div>", Out.RHr()));
        builder.Append("<a href=\"" + Utils.getPage("race.aspx?act=my") + "\">返回上一级</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("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("race.aspx") + "\">竞拍</a>");
        builder.Append(Out.Tab("</div>", ""));
    }