Exemplo n.º 1
0
 public void Update_ips(BCW.Model.Shopkeep model)
 {
     dal.Update_ips(model);
 }
Exemplo n.º 2
0
    private void ChangeGiftPage()
    {
        int meid = new BCW.User.Users().GetUsId();

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

        if (new BCW.BLL.Game.GiftFlows().GetTypesTotal(meid) < 15)//15
        {
            Utils.Error("很遗憾,您的物品量还没有达到兑换所需的条件", "");
        }
        int    NodeId = 27;
        string info   = Utils.GetRequest("info", "get", 1, "", "");

        if (info == "ok")
        {
            int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));
            BCW.Model.Shopgift model = new BCW.BLL.Shopgift().GetShopgift(id);
            int num = 1;
            if (model == null)
            {
                Utils.Error("不存在的商品记录", "");
            }
            if (model.NodeId != NodeId)
            {
                Utils.Error("不存在的记录", "");
            }
            if (model.Total != -1 && model.Total < num)
            {
                Utils.Error("商品库存不足", "");
            }
            //得到昵称
            string             mename = new BCW.BLL.User().GetUsName(meid);
            BCW.Model.Shopkeep keep   = new BCW.Model.Shopkeep();
            keep.GiftId   = id;
            keep.Title    = model.Title.Trim();
            keep.Pic      = model.Pic;
            keep.PrevPic  = model.PrevPic;
            keep.Notes    = model.Notes;
            keep.IsSex    = model.IsSex;
            keep.Para     = model.Para;
            keep.UsID     = meid;
            keep.UsName   = mename;
            keep.Total    = num;
            keep.TopTotal = num;
            keep.AddTime  = DateTime.Now;
            //邵广林 20161128 增加27为空的字段
            keep.MerBillNo   = "";
            keep.NodeId      = NodeId;
            keep.GatewayType = "";
            keep.Attach      = "";
            keep.GoodsName   = "";
            keep.IsCredit    = "";
            keep.BankCode    = "";
            keep.ProductType = "";
            if (!new BCW.BLL.Shopkeep().Exists(id, meid))
            {
                new BCW.BLL.Shopkeep().Add(keep);
            }
            else
            {
                new BCW.BLL.Shopkeep().Update(keep);
            }
            //购买库存与出售数量
            int num2 = -num;
            if (model.Total == -1)
            {
                num2 = 0;
            }
            new BCW.BLL.Shopgift().Update(id, num, num2);
            //更新此分类出售数量
            new BCW.BLL.Shoplist().Update(id, num);

            //扣活动礼物
            int k = 0;
            for (int i = 1; i <= 33; i++)
            {
                int rac = new BCW.BLL.Game.GiftFlows().UpdateTotall(i, meid, -1);
                if (rac > 0)
                {
                    k++;
                }

                if (k == 15)
                {
                    break;
                }
            }
            //写入兑换记录
            BCW.Model.Game.GiftChange change = new BCW.Model.Game.GiftChange();
            change.UsID    = meid;
            change.UsName  = mename;
            change.Types   = 8;
            change.State   = 1;
            change.Notes   = "兑换了" + model.Title.Trim() + "";
            change.AddTime = DateTime.Now;
            new BCW.BLL.Game.GiftChange().Add(change);

            string wText = "在[url=/bbs/game/flows.aspx]活动礼品[/url]兑换了[url=/bbs/bbsshop.aspx?act=giftview&amp;id=" + id + "]" + model.Title.Trim() + "[img]" + model.PrevPic + "[/img][/url]";
            new BCW.BLL.Action().Add(12, id, meid, mename, wText);

            Utils.Success("兑换商城礼物", "兑换商城礼物成功<br /><a href=\"" + Utils.getUrl("/bbs/bbsshop.aspx?act=store") + "\">&gt;我的储物箱</a>", Utils.getUrl("flows.aspx"), "3");
        }
        Master.Title = "活动礼品";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("bbsshop.aspx") + "\">商城</a>&gt;活动礼品");
        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        string strWhere = string.Empty;
        string strOrder = string.Empty;
        int    pageSize = 5;

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

        strWhere = "NodeId=" + NodeId + "";
        strOrder = "ID DESC";

        // 开始读取专题
        IList <BCW.Model.Shopgift> listShopgift = new BCW.BLL.Shopgift().GetShopgifts(pageIndex, pageSize, strWhere, strOrder, out recordCount);

        if (listShopgift.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Shopgift n in listShopgift)
            {
                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("<img src=\"" + n.Pic + "\" alt=\"load\"/>");
                builder.Append("<br /><a href=\"" + Utils.getUrl("/bbs/bbsshop.aspx?act=giftview&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.Title + "</a>");
                builder.Append("<a href=\"" + Utils.getUrl("flows.aspx?act=changegift&amp;info=ok&amp;&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[兑换]</a>");

                builder.Append("<br />" + OutMei(n.Para));

                //builder.Append(" 售价:" + n.Price + "");
                if (n.BzType == 0)
                {
                    builder.Append(ub.Get("SiteBz"));
                }
                else
                {
                    builder.Append(ub.Get("SiteBz2"));
                }

                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=\"text\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("flows.aspx?act=change") + "\">&gt;&gt;重新选择兑换</a>");
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("flows.aspx") + "\">上级</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx") + "\">空间</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BCW.Model.Shopkeep model)
 {
     return(dal.Add(model));
 }