Example #1
0
        /// <summary>
        /// BasePage类构造函数
        /// </summary>
        public PageBase()
        {
            System.Web.HttpContext.Current.Response.ClearContent();
            System.Web.HttpContext.Current.Response.Buffer          = true;
            System.Web.HttpContext.Current.Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);

            System.Web.HttpContext.Current.Response.Expires = 0;

            //清理缓存
            if (HTTPRequest.GetInt("CachesClear", 0) == 1)
            {
                Caches.ReSet();
                System.Web.HttpContext.Current.Response.End();
            }



            string cookietag = GeneralConfigs.GetConfig().CookieTag.Trim();

            config      = GeneralConfigs.GetConfig();
            MConfigList = Caches.GetMConfigList();//网店列表

            //取当前网店信息
            int mconfigid = HTTPRequest.GetInt("mconfigid", 0);

            if (mconfigid > 0)
            {
                M_Config = Caches.GetMConfig(mconfigid);

                //是否沙箱模式
                if (config.Taobao_SandBox == 1)
                {
                    //SessioKey是否超过30分钟
                    if (DateTime.Now.Subtract(M_Config.m_UpdateTime).TotalMinutes >= 30)
                    {
                        ShowMSign = true;//弹出授权框
                    }
                }
            }

            if (CheckUser())
            {
                userinfo    = Yannyo.BLL.tbUserInfo.GetUserInfoModel(userid);
                userpopedom = userinfo.uPermissions;
                username    = userinfo.uName;
            }

            //清空当前页面查询统计
            Yannyo.Data.DbHelper.QueryCount = 0;
#if NET1
#else
#if DEBUG
            Yannyo.Data.DbHelper.QueryDetail = "";
#endif
#endif

            AddMetaInfo(config.Seokeywords, config.Seodescription, config.Seohead);


            System.Web.HttpContext.Current.Response.BufferOutput    = false;
            System.Web.HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            System.Web.HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
            System.Web.HttpContext.Current.Response.Expires      = 0;
            System.Web.HttpContext.Current.Response.CacheControl = "no-cache";
            System.Web.HttpContext.Current.Response.Cache.SetNoStore();

            try
            {
                oluserinfo = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout);
            }
            catch
            {
                System.Threading.Thread.Sleep(2000);
                oluserinfo = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout);
            }

            olid = oluserinfo.olID;

            if (config.Onlinetimeout > 0 && userid != -1)
            {
                onlineusercount = OnlineUsers.GetOnlineAllUserCount();
            }
            else
            {
                onlineusercount = OnlineUsers.GetCacheOnlineAllUserCount();
            }

            if (userid != -1)
            {
                //更新用户在线时长
                OnlineUsers.UpdateOnlineTime(config.Oltimespan, userid);

                string ignore = HTTPRequest.GetString("ignore");
            }

            templateid   = 1;
            templatepath = Templates.GetTemplateItem(templateid).Directory;

            nowdate     = Utils.GetDate();
            nowtime     = Utils.GetTime();
            nowdatetime = Utils.GetDateTime();


            ispost = HTTPRequest.IsPost();
            isget  = HTTPRequest.IsGet();

            link = "";

            script = "";

            m_starttick = DateTime.Now;

            ShowPage();

            //m_processtime = //(System.Environment.TickCount - m_starttick) / 1000;
            m_processtime = DateTime.Now.Subtract(m_starttick).TotalMilliseconds / 1000;

            querycount = Yannyo.Data.DbHelper.QueryCount;
            Yannyo.Data.DbHelper.QueryCount = 0;
#if NET1
#else
#if DEBUG
            querydetail = Yannyo.Data.DbHelper.QueryDetail;
            Yannyo.Data.DbHelper.QueryDetail = "";
#endif
#endif
        }