Exemplo n.º 1
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            headerad = "";
            footerad = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid   = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
                forum     = Forums.GetForumInfo(forumid);
                forumname = forum.Name;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                forumid = 0;
            }

            ///得到广告列表
            ///头部
            headerad = Advertisements.GetOneHeaderAd("", forumid);
            footerad = Advertisements.GetOneFooterAd("", forumid);
            doublead = Advertisements.GetDoubleAd("", forumid);
            floatad  = Advertisements.GetFloatAd("", forumid);

            pagetitle   = goodstradelog.Subject;
            navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

            if (useradminid != 0)
            {
                if (config.Enablemall == 1) //开启普通模式
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                }

                //得到管理组信息
                admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }
            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            goodsleavewordlist = GoodsLeaveWords.GetLeaveWordList(goodstradelog.Id);

            if (goodstradelog.Status == 7 || goodstradelog.Status == 17)
            {
                israted = GoodsRates.CanRate(goodstradelog.Id, userid) ? false : true; //如果当前用户已评价过则不允许再评价
            }
            //如果是提交则更新商品交易日志
            if (ispost && goodstradelog.Status >= 0)
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                //当要验证密码时
                if (DNTRequest.GetInt("status", -1) > 0 && IsVerifyPassWord(goodstradelog.Status))
                {
                    if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("password")))
                    {
                        AddErrLine("密码不能为空, 请返回填写.");
                        return;
                    }

                    int uid = -1;
                    if (config.Passwordmode == 1)
                    {
                        uid = Users.CheckDvBbsPassword(base.username, DNTRequest.GetString("password"));
                    }
                    else
                    {
                        uid = Users.CheckPassword(username, DNTRequest.GetString("password"), true);
                    }

                    if (uid < 0)
                    {
                        AddErrLine("您输入的密码不正确, 不能修改订单状态, 请返回修改.");
                        return;
                    }

                    //当验证密码正确后,则发送相应留言
                    Goodsleavewordinfo goodsleavewordinfo = new Goodsleavewordinfo();
                    goodsleavewordinfo.Ip         = DNTRequest.GetIP();
                    goodsleavewordinfo.Goodsid    = goodstradelog.Goodsid;
                    goodsleavewordinfo.Tradelogid = goodstradelog.Id;
                    goodsleavewordinfo.Uid        = userid;
                    goodsleavewordinfo.Username   = username;
                    goodsleavewordinfo.Message    = DNTRequest.GetString("message");
                    goodsleavewordinfo.Isbuyer    = buyerleaveword;
                    GoodsLeaveWords.CreateLeaveWord(goodsleavewordinfo, goodsinfo.Selleruid);
                }

                goodstradelog.Status = DNTRequest.GetInt("status", -1);

                if (goodstradelog.Status == 0)
                {
                    //当为买家时
                    if (isbuyer)
                    {
                        goodstradelog.Quality       = goodsinfo.Quality;
                        goodstradelog.Categoryid    = goodsinfo.Categoryid;
                        goodstradelog.Tax           = 0;
                        goodstradelog.Locus         = goodsinfo.Locus;
                        goodstradelog.Seller        = goodsinfo.Seller;
                        goodstradelog.Sellerid      = goodsinfo.Selleruid;
                        goodstradelog.Selleraccount = goodsinfo.Account;
                        goodstradelog.Buyerid       = userid;
                        goodstradelog.Buyer         = username;
                        goodstradelog.Buyercontact  = DNTRequest.GetString("buyercontact");
                        goodstradelog.Buyercredit   = 0;
                        goodstradelog.Buyermsg      = DNTRequest.GetString("buyermsg");
                        goodstradelog.Lastupdate    = DateTime.Now;
                        goodstradelog.Buyername     = DNTRequest.GetString("buyername");
                        goodstradelog.Buyerzip      = DNTRequest.GetString("buyerzip");
                        goodstradelog.Buyerphone    = DNTRequest.GetString("buyerphone");
                        goodstradelog.Buyermobile   = DNTRequest.GetString("buyermobile");
                        goodstradelog.Transport     = goodsinfo.Transport;
                        goodstradelog.Baseprice     = goodsinfo.Costprice;
                        goodstradelog.Discount      = goodsinfo.Discount;
                        goodstradelog.Ratestatus    = 0;
                        goodstradelog.Message       = "";
                    }

                    if (isseller) //当为卖家时
                    {
                        goodstradelog.Transportfee = DNTRequest.GetInt("fee", 0);
                    }
                }

                if (TradeLogs.UpdateTradeLog(goodstradelog, oldstatus, true))
                {
                    SetUrl("offlinetrade.aspx?goodstradelogid=" + goodstradelogid);
                    SetMetaRefresh();
                    AddMsgLine("交易单已更新, 现在转入交易单页面<br />(<a href=\"" + "offlinetrade.aspx?goodstradelogid=" + goodstradelogid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
            }
        }
Exemplo n.º 2
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            headerad = "";
            footerad = "";
            floatad  = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid   = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
                forum     = Forums.GetForumInfo(forumid);
                forumname = forum.Name;
                forumnav  = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
            }
            else if (config.Enablemall == 2) //当为高级模式时
            {
                forumid = 0;
            }

            ///得到广告列表
            ///头部
            headerad = Advertisements.GetOneHeaderAd("", forumid);
            footerad = Advertisements.GetOneFooterAd("", forumid);
            doublead = Advertisements.GetDoubleAd("", forumid);
            floatad  = Advertisements.GetFloatAd("", forumid);

            pagetitle   = goodstradelog.Subject;
            navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

            if (useradminid != 0)
            {
                if (config.Enablemall == 1) //开启普通模式
                {
                    ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0;
                }

                //得到管理组信息
                admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }
            //验证不通过则返回
            if (!IsConditionsValid())
            {
                return;
            }

            if (goodstradelog.Status == 7 || goodstradelog.Status == 17)
            {
                israted = GoodsRates.CanRate(goodstradelog.Id, userid) ? false : true; //如果当前用户已评价过则不允许再评价
            }
            if (DNTRequest.GetString("pay") == "yes")
            {
                ispay = true;
                string alipayurl = GetAliPayUrl();
                SetUrl(alipayurl);
                SetMetaRefresh();
                AddMsgLine("正在提交编号为 " + goodstradelog.Tradeno + " 的订单<br />(<a href=\"" + alipayurl + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                return;
            }


            //如果是提交则更新商品交易日志
            if (ispost)
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                //当为买家时
                if (isbuyer)
                {
                    goodstradelog.Quality       = goodsinfo.Quality;
                    goodstradelog.Categoryid    = goodsinfo.Categoryid;
                    goodstradelog.Tax           = 0;
                    goodstradelog.Locus         = goodsinfo.Locus;
                    goodstradelog.Seller        = goodsinfo.Seller;
                    goodstradelog.Sellerid      = goodsinfo.Selleruid;
                    goodstradelog.Selleraccount = goodsinfo.Account;
                    goodstradelog.Buyerid       = userid;
                    goodstradelog.Buyer         = username;
                    goodstradelog.Buyercontact  = DNTRequest.GetString("buyercontact");
                    goodstradelog.Buyercredit   = 0;
                    goodstradelog.Buyermsg      = DNTRequest.GetString("buyermsg");
                    goodstradelog.Status        = 0;
                    goodstradelog.Lastupdate    = DateTime.Now;
                    goodstradelog.Buyername     = DNTRequest.GetString("buyername");
                    goodstradelog.Buyerzip      = DNTRequest.GetString("buyerzip");
                    goodstradelog.Buyerphone    = DNTRequest.GetString("buyerphone");
                    goodstradelog.Buyermobile   = DNTRequest.GetString("buyermobile");
                    goodstradelog.Transport     = goodsinfo.Transport;
                    goodstradelog.Baseprice     = goodsinfo.Costprice;
                    goodstradelog.Discount      = goodsinfo.Discount;
                    goodstradelog.Ratestatus    = 0;
                    goodstradelog.Message       = "";
                }
                else //当为卖家时
                {
                    goodstradelog.Transportfee = DNTRequest.GetInt("fee", 0);
                }

                if (TradeLogs.UpdateTradeLog(goodstradelog, oldstatus))
                {
                    SetUrl("onlinetrade.aspx?goodstradelogid=" + goodstradelogid);
                    SetMetaRefresh();
                    AddMsgLine("交易单已更新, 现在转入交易单页面<br />(<a href=\"" + "onlinetrade.aspx?goodstradelogid=" + goodstradelogid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />");
                }
            }
        }
Exemplo n.º 3
0
        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易服务
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            if (userid == -1)
            {
                AddErrLine("你尚未登录");
                return;
            }

            headerad = "";
            footerad = "";

            // 如果商品交易日志不正确
            if (goodstradelogid <= 0)
            {
                AddErrLine("无效的交易日志信息.");
                return;
            }

            goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid);
            int oldstatus = goodstradelog.Status;

            if (config.Enablemall == 1) //开启普通模式
            {
                forumid = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid);
            }
            else
            {
                forumid = 0;
            }

            ///得到广告列表
            ///头部
            headerad = Advertisements.GetOneHeaderAd("", forumid);
            footerad = Advertisements.GetOneFooterAd("", forumid);
            doublead = Advertisements.GetDoubleAd("", forumid);
            floatad  = Advertisements.GetFloatAd("", forumid);

            if (goodstradelog.Sellerid != userid && goodstradelog.Buyerid != userid)
            {
                AddErrLine("您的身份不是买卖双方, 因为不能评价");
                return;
            }
            if (goodstradelog.Status != 7 && goodstradelog.Status != 17)
            {
                AddErrLine("交易尚未结束, 因为不能评价");
                return;
            }
            if (!GoodsRates.CanRate(goodstradelog.Id, userid)) //如果当前用户已评价过则不允许再评价
            {
                AddErrLine("不能重复评价");
                return;
            }


            //如果是提交...
            if (ispost)
            {
                Goodsrateinfo goodsrateinfo = new Goodsrateinfo();
                goodsrateinfo.Ip              = DNTRequest.GetIP();
                goodsrateinfo.Postdatetime    = DateTime.Now;
                goodsrateinfo.Price           = goodstradelog.Number * goodstradelog.Price + goodstradelog.Transportfee;
                goodsrateinfo.Ratetype        = DNTRequest.GetInt("ratetype", 0);
                goodsrateinfo.Uid             = userid;
                goodsrateinfo.Username        = username;
                goodsrateinfo.Message         = DNTRequest.GetString("message");
                goodsrateinfo.Goodstradelogid = goodstradelog.Id;
                goodsrateinfo.Goodstitle      = goodstradelog.Subject;
                goodsrateinfo.Goodsid         = goodstradelog.Goodsid;
                goodsrateinfo.Explain         = "";

                if (goodstradelog.Buyerid == userid)  //买家
                {
                    goodsrateinfo.Uidtype        = 2;
                    goodsrateinfo.Ratetouid      = goodstradelog.Sellerid;
                    goodsrateinfo.Ratetousername = goodstradelog.Seller;
                    goodstradelog.Ratestatus     = 2;
                }
                else //卖家
                {
                    goodsrateinfo.Uidtype        = 1;
                    goodsrateinfo.Ratetouid      = goodstradelog.Buyerid;
                    goodsrateinfo.Ratetousername = goodstradelog.Buyer;
                    goodstradelog.Ratestatus     = 1;
                }
                if (GoodsRates.CreateGoodsRate(goodsrateinfo) > 0) //如果评价成功
                {
                    if (GoodsRates.RateClosed(goodsrateinfo.Goodstradelogid, goodstradelog.Sellerid, goodstradelog.Buyerid))
                    {
                        goodstradelog.Ratestatus = 3;
                        TradeLogs.UpdateTradeLog(goodstradelog, oldstatus); //更新交易的评价状态
                    }

                    GoodsUserCredits.SetUserCredit(goodsrateinfo, goodsrateinfo.Uidtype == 1 ? goodstradelog.Buyerid : goodstradelog.Sellerid);

                    SetUrl(base.ShowGoodsAspxRewrite(goodsrateinfo.Goodsid));
                    SetMetaRefresh();
                    AddMsgLine("您的评价已经成功<br />(<a href=\"" + base.ShowGoodsAspxRewrite(goodsrateinfo.Goodsid) + "\">点击这里返回商品页面</a>)<br />");
                }
            }
        }