Пример #1
0
        public void Application_OnError(Object sender, EventArgs e)
        {
            string          requestUrl  = DNTRequest.GetUrl();
            HttpApplication application = (HttpApplication)sender;
            HttpContext     context     = application.Context;

            if (GeneralConfigs.GetConfig().Installation == 0 && requestUrl.IndexOf("install") == -1) //当该站点未运行过安装并且当前页面不是安装程序目录下的页面时
            {
                context.Server.ClearError();                                                         //清除程序异常
                HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + "install/index.aspx");
                return;
            }
#if EntLib
            if (RabbitMQConfigs.GetConfig() != null && RabbitMQConfigs.GetConfig().HttpModuleErrLog.Enable)//当开启errlog错误日志记录功能时
            {
                Discuz.EntLib.ServiceBus.HttpModuleErrLogClientHelper.GetHttpModuleErrLogClient().AsyncAddLog(
                    new Discuz.EntLib.ServiceBus.HttpModuleErrLogData(
                        Discuz.EntLib.ServiceBus.LogLevel.High,
                        context.Server.GetLastError().ToString()
                        ));
                return;
            }
#endif
            //context.Response.Write("<html><body style=\"font-size:14px;\">");
            //context.Response.Write("Discuz!NT Error:<br />");
            //context.Response.Write("<textarea name=\"errormessage\" style=\"width:80%; height:200px; word-break:break-all\">");
            //context.Response.Write(System.Web.HttpUtility.HtmlEncode(context.Server.GetLastError().ToString()));
            //context.Response.Write("</textarea>");
            //context.Response.Write("</body></html>");
            //context.Response.End();

            //context.Server.ClearError();//清除程序异常
        }
Пример #2
0
 /// <summary>
 /// 获取收藏夹的状态
 /// </summary>
 /// <returns></returns>
 private FavoriteStatus GetFavoriteStatus()
 {
     string configPath = Utils.GetMapPath(BaseConfigs.GetForumPath.ToLower() + "admin/xml/navmenu.config");
     //string pagename = DNTRequest.GetPageName().ToLower() + DNTRequest.GetUrl().Substring(DNTRequest.GetUrl().IndexOf('?')).ToLower();
     string url = DNTRequest.GetUrl().ToLower();
     string pagename = url.Substring(url.LastIndexOf('/') + 1);
     XmlDocument doc = new XmlDocument();
     doc.Load(configPath);
     XmlNodeList submains = doc.SelectNodes("/dataset/submain");
     bool findmenu = false;
     foreach (XmlNode submain in submains)
     {
         if (submain.SelectSingleNode("link").InnerText.IndexOf('/') == -1) continue;
         if (submain.SelectSingleNode("link").InnerText.Split('/')[1].ToLower() == pagename)
             findmenu = true;                   
     }
     //当前链接不在菜单文件中,则不允许显示
     if(!findmenu)
         return FavoriteStatus.Hidden;   //不允许收藏
     XmlNodeList shortcuts = doc.SelectNodes("/dataset/shortcut");
     foreach (XmlNode singleshortcut in shortcuts)
     {
         if (singleshortcut.SelectSingleNode("link").InnerText.IndexOf(pagename) != -1) return FavoriteStatus.Exist; //在收藏夹中已存在
     }
     if (shortcuts.Count >= MaxShortcutMenuCount) return FavoriteStatus.Full;  //快捷菜单收藏最多收藏15条
     return FavoriteStatus.Show; //正常收藏
 }
Пример #3
0
        public AjaxAlbumList()
        {
            //获取查询信息
            description  = DNTRequest.GetString("albumdescription");
            postusername = DNTRequest.GetString("albumusername");
            title        = DNTRequest.GetString("albumtitle");
            startdate    = DNTRequest.GetString("albumdatetimeStart");
            enddate      = DNTRequest.GetString("albumdatetimeEnd");
            currentpage  = DNTRequest.GetInt("currentpage", 1);
            //获取分页数
            if (DNTRequest.GetInt("postnumber", 0) > 0)
            {
                pagesize = DNTRequest.GetInt("postnumber", 0);
            }
            if (DNTRequest.GetUrl().ToLower().IndexOf("album_manage.aspx") != -1 || DNTRequest.GetUrl().ToLower().IndexOf("album_config.aspx") != -1)
            {
                isShowPrivateAlbum = true;
            }
            //获取总页数
            int recordcount = DbProvider.GetInstance().GetAlbumListCountByCondition(postusername, title, description, startdate, enddate, isShowPrivateAlbum);

            dt       = DbProvider.GetInstance().GetAlbumListByCondition(postusername, title, description, startdate, enddate, 12, currentpage, isShowPrivateAlbum);
            pagelink = AjaxPagination(recordcount, 12, currentpage);
        }
Пример #4
0
        /// <summary>
        /// 获取在线支付的URL字符串
        /// </summary>
        /// <returns></returns>
        private string GetAliPayUrl()
        {
            string current_url = DNTRequest.GetUrl();

            //forumurl = "http://124.207.144.194:8081/";
            if (forumurl.ToLower().StartsWith("http://"))
            {
                current_url = forumurl + "tradenotify.aspx";
            }
            else
            {
                if (current_url.IndexOf("/aspx/") > 0)
                {
                    current_url = current_url.Substring(0, current_url.IndexOf("/aspx/") + 1) + "tradenotify.aspx";
                }
                else
                {
                    current_url = current_url.Substring(0, current_url.LastIndexOf("/") + 1) + "tradenotify.aspx";
                }
            }

            IPayment _payment = AliPayment.GetService();

            if (goodstradelog.Transport > 0)
            {
                //普通(实物)交易
                NormalTrade normalTrade = new NormalTrade();
                normalTrade.Body         = goodstradelog.Subject; //goodsinfo.Message;
                normalTrade.Out_Trade_No = goodstradelog.Tradeno;

                string transportpay = "";
                switch (goodstradelog.Transportpay)
                {
                case 1: transportpay = "SELLER_PAY"; break;              //卖家承担运费

                case 2: transportpay = "BUYER_PAY"; break;               //买家承担运费

                case 3: transportpay = "BUYER_PAY_AFTER_RECEIVE"; break; //买家收到货后直接支付给物流公司,费用不用计到总价中
                }

                string transport = "";
                switch (goodstradelog.Transport)
                {
                case 0: transport = "VIRTUAL"; break; //虚拟物品

                case 1: transport = "POST"; break;    //平邮

                case 2: transport = "EMS"; break;     //EMS

                case 3: transport = "EXPRESS"; break; //其他快递公司
                }
                normalTrade.Logistics_Info = new LogisticsInfo[1] {
                    new LogisticsInfo(transport, goodstradelog.Transportfee, transportpay)
                };
                normalTrade.Notify_Url   = current_url;
                normalTrade.Payment_Type = goodsinfo.Itemtype;
                normalTrade.Price        = goodstradelog.Price;
                normalTrade.Quantity     = goodstradelog.Number;
                normalTrade.Seller_Email = goodstradelog.Selleraccount;
                normalTrade.Show_Url     = current_url.Replace("tradenotify.aspx", base.ShowGoodsAspxRewrite(goodstradelog.Goodsid));
                normalTrade.Subject      = goodstradelog.Subject;
                normalTrade.Buyer_Email  = Users.GetShortUserInfo(goodstradelog.Buyerid).Email;

                return(_payment.CreateNormalGoodsTradeUrl((ITrade)normalTrade));
            }
            else
            {
                //虚拟商品交易
                DigitalTrade digitalTrade = new DigitalTrade();
                digitalTrade.Body         = goodstradelog.Subject;
                digitalTrade.Out_Trade_No = goodstradelog.Tradeno;

                digitalTrade.Notify_Url   = current_url;
                digitalTrade.Payment_Type = goodsinfo.Itemtype;
                digitalTrade.Price        = goodstradelog.Price;
                digitalTrade.Quantity     = goodstradelog.Number;
                digitalTrade.Seller_Email = goodstradelog.Selleraccount;
                digitalTrade.Show_Url     = current_url.Replace("tradenotify.aspx", base.ShowGoodsAspxRewrite(goodstradelog.Goodsid));
                digitalTrade.Subject      = goodstradelog.Subject;
                digitalTrade.Buyer_Email  = Users.GetShortUserInfo(goodstradelog.Buyerid).Email;

                return(_payment.CreateDigitalGoodsTradeUrl((ITrade)digitalTrade));
            }
        }