示例#1
0
 public Visitor AddVisitor(Visitor visitor)
 {
     using (var cnn = ActionDb.DbConnection())
     {
         cnn.Execute(visitor.GetSqliteInsertSql(null), visitor);
         return visitor;
     }
 }
示例#2
0
 public Visitor AddVisitor(Visitor visitor)
 {
     return VisitorManager.AddVisitor(visitor);
 }
示例#3
0
 public virtual Visitor AddVisitor(Visitor visitor)
 {
     ClearVisitorCache(visitor.VisitorId);
     return VisitorData.AddVisitor(visitor);
 }
        private Visitor CreateNewVisitor(ActionExecutingContext filterContext)
        {
            Visitor visitor = new Visitor();
            visitor.VisitorId = VisitorService.CreateNewVisitorId();

            VisitorService.AddVisitor(visitor);

            HttpCookie cookie = new HttpCookie("vid",visitor.VisitorId);
            cookie.Expires = DateTime.Now.AddDays(365);
            filterContext.HttpContext.Response.Cookies.Add(cookie);

            return visitor;
        }