using System;
using System.Web;
using System.Web.Services;

namespace Stat.web.MyAJAX
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class HdfDayRank : IHttpHandler
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            int webid = Plugin.Common.Rq_Int("webid");
            if (webid > 0)
            {
                string cName = "Ajax_DayRank_" + DateTime.Now.ToShortDateString() + "_" + webid;
                if (HttpContext.Current.Cache.Get(cName) == null)
                {
                    int rank = BLL.WebSites.GetDayRank(webid);
                    HttpContext.Current.Cache.Insert(cName, rank);
                }
                context.Response.Write(HttpContext.Current.Cache.Get(cName));
            }
            context.Response.End();
        }
        /// <summary>
        /// 
        /// </summary>
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
