protected void Page_Load(object sender, EventArgs e) { base.Response.Expires = 0; this.m_ClientIP = Counter.GetIP(base.Request); this.InitApp(); if (this.m_RegFieldsFillTmp.Contains("IsCountOnline")) { StatOnlineInfo onlineByIP = OtherReport.GetOnlineByIP(this.m_ClientIP); if (onlineByIP.IsNull) { this.Update(); } else if (onlineByIP.LastTime == onlineByIP.OnTime) { this.Update(); } else { Counter.StatInfoListAddView(); } } else if (base.Application["EasyOne_LastIP"].ToString().Contains(this.m_ClientIP)) { Counter.StatInfoListAddView(); } else { this.SaveIP(this.m_ClientIP); this.Update(); } this.ShowInfo(); }
protected void EgvOnLine_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { StatOnlineInfo dataItem = e.Row.DataItem as StatOnlineInfo; if (dataItem != null) { string str = string.Empty; TimeSpan span = (TimeSpan)(DateTime.Now - dataItem.OnTime); int num = (span.Hours * 60) + span.Minutes; if (num != 0) { str = str + num.ToString() + "'"; } if (span.Seconds < 10) { str = str + "0"; } str = str + span.Seconds.ToString() + "\""; e.Row.Cells[0].Text = e.Row.RowIndex.ToString(); e.Row.Cells[4].Text = str; HyperLink link = e.Row.FindControl("HlnkUrl") as HyperLink; if (dataItem.UserPage.Length >= 40) { link.Text = dataItem.UserPage.Substring(0, 40) + "..."; } else { link.Text = dataItem.UserPage; } link.ToolTip = dataItem.UserPage; } } }
public void StatOnlineAdd(StatOnlineInfo info) { Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@UserIP", DbType.String, info.UserIP); cmdParams.AddInParameter("@UserAgent", DbType.String, info.UserAgent); cmdParams.AddInParameter("@UserPage", DbType.String, info.UserPage); DBHelper.ExecuteNonQueryProc("PR_Analytics_StatOnline_Add", cmdParams); }
protected void Page_Load(object sender, EventArgs e) { base.Response.Expires = 0; StatOnlineInfo info = new StatOnlineInfo(); info.UserIP = PEContext.Current.UserHostAddress; info.UserAgent = base.Request.UserAgent.Replace("'", ""); info.UserPage = (base.Request.UrlReferrer == null) ? string.Empty : base.Request.UrlReferrer.ToString().Replace("'", ""); Counter.StatOnlineAdd(info); }
private static StatOnlineInfo StatOnlineInfoFromrdr(NullableDataReader rdr) { StatOnlineInfo info = new StatOnlineInfo(); info.Id = rdr.GetInt32("id"); info.UserIP = rdr.GetString("UserIP"); info.UserPage = rdr.GetString("UserPage"); info.UserAgent = rdr.GetString("UserAgent"); info.OnTime = rdr.GetDateTime("OnTime"); info.LastTime = rdr.GetDateTime("LastTime"); return(info); }
public static void StatOnlineAdd(StatOnlineInfo info) { dal.StatOnlineAdd(info); }