protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { Literal child = new Literal(); StringBuilder builder = new StringBuilder(""); StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); if ((statInfoListInfo != null) && !string.IsNullOrEmpty(statInfoListInfo.RegFieldsFill)) { string[] strArray = statInfoListInfo.RegFieldsFill.Split(new char[] { ',' }); if (strArray != null) { foreach (string str in strArray) { switch (str) { case "FVisit": case "IsCountOnline": builder.Append("<li><a href='StatOtherReport.aspx?Action=" + str.Trim() + "' target='main_right'>" + Counter.GetItemName(str.Trim()) + "</a></li>"); break; default: builder.Append("<li><a href='StatUserDataReport.aspx?Action=" + ConvertAction(str.Trim()) + "' target='main_right'>" + Counter.GetItemName(str.Trim()) + "</a></li>"); break; } } } } child.Text = builder.ToString(); this.PlhCounter.Controls.Add(child); } }
private static StatInfoListInfo StatInfoListFromrdr(NullableDataReader rdr) { StatInfoListInfo info = new StatInfoListInfo(); info.StartDate = rdr.GetString("StartDate"); info.TotalNum = rdr.GetInt32("TotalNum"); info.TotalView = rdr.GetInt32("TotalView"); info.MonthNum = rdr.GetInt32("MonthNum"); info.MonthMaxNum = rdr.GetInt32("MonthMaxNum"); info.OldMonth = rdr.GetString("OldMonth"); info.MonthMaxDate = rdr.GetString("MonthMaxDate"); info.DayNum = rdr.GetInt32("DayNum"); info.DayMaxNum = rdr.GetInt32("DayMaxNum"); info.OldDay = rdr.GetString("OldDay"); info.DayMaxDate = rdr.GetString("DayMaxDate"); info.HourNum = rdr.GetInt32("HourNum"); info.HourMaxNum = rdr.GetInt32("HourMaxNum"); info.OldHour = rdr.GetString("OldHour"); info.HourMaxTime = rdr.GetString("HourMaxTime"); info.ChinaNum = rdr.GetInt32("ChinaNum"); info.OtherNum = rdr.GetInt32("OtherNum"); info.MasterTimeZone = rdr.GetInt32("MasterTimeZone"); info.Interval = rdr.GetInt32("Interval"); info.IntervalNum = rdr.GetInt32("IntervalNum"); info.OnlineTime = rdr.GetInt32("OnlineTime"); info.VisitRecord = rdr.GetInt32("VisitRecord"); info.KillRefresh = rdr.GetInt32("KillRefresh"); info.RegFieldsFill = rdr.GetString("RegFields_Fill"); info.OldTotalNum = rdr.GetInt32("OldTotalNum"); info.OldTotalView = rdr.GetInt32("OldTotalView"); return(info); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); if (statInfoListInfo != null) { this.DropTimezone.SelectedValue = statInfoListInfo.MasterTimeZone.ToString(); this.TxtOnlineTime.Text = statInfoListInfo.OnlineTime.ToString(); this.TxtInterval.Text = statInfoListInfo.Interval.ToString(); this.TxtIntervalNum.Text = statInfoListInfo.IntervalNum.ToString(); this.TxtVisitRecord.Text = statInfoListInfo.VisitRecord.ToString(); this.TxtKillRefresh.Text = statInfoListInfo.KillRefresh.ToString(); this.TxtOldTotalNum.Text = statInfoListInfo.OldTotalNum.ToString(); this.TxtOldTotalView.Text = statInfoListInfo.OldTotalView.ToString(); this.DpkStartDate.Text = DataConverter.CDate(statInfoListInfo.StartDate).ToString("yyyy-MM-dd"); if (!string.IsNullOrEmpty(statInfoListInfo.RegFieldsFill)) { foreach (string str in statInfoListInfo.RegFieldsFill.Split(new char[] { ',' })) { this.ChklRegFields.Items.FindByValue(str.Trim()).Selected = true; } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); this.HdnTimezone.Value = Convert.ToString((int)(statInfoListInfo.MasterTimeZone / 60)); } }
protected void BtnSave_Click(object sender, EventArgs e) { if (base.IsValid) { StatInfoListInfo info = new StatInfoListInfo(); info.MasterTimeZone = DataConverter.CLng(this.DropTimezone.SelectedValue); info.OnlineTime = DataConverter.CLng(this.TxtOnlineTime.Text); info.Interval = DataConverter.CLng(this.TxtInterval.Text); info.IntervalNum = DataConverter.CLng(this.TxtIntervalNum.Text); info.VisitRecord = DataConverter.CLng(this.TxtVisitRecord.Text); info.KillRefresh = DataConverter.CLng(this.TxtKillRefresh.Text); info.OldTotalNum = DataConverter.CLng(this.TxtOldTotalNum.Text); info.OldTotalView = DataConverter.CLng(this.TxtOldTotalView.Text); info.StartDate = this.DpkStartDate.Date.ToString("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(""); foreach (ListItem item in this.ChklRegFields.Items) { if (item.Selected) { builder.Append(item.Value + ","); } } info.RegFieldsFill = builder.ToString().TrimEnd(new char[] { ',' }); if (Counter.SaveConfig(info)) { base.Application.Lock(); if (base.Application["Interval"] != null) { base.Application["Interval"] = info.Interval; } if (base.Application["IntervalNum"] != null) { base.Application["IntervalNum"] = info.IntervalNum; } if (base.Application["RegFields_Fill"] != null) { base.Application["RegFields_Fill"] = info.RegFieldsFill; } if (base.Application["KillRefresh"] != null) { base.Application["KillRefresh"] = info.KillRefresh; } base.Application.UnLock(); AdminPage.WriteSuccessMsg("网站统计配置保存成功!", base.Request.UrlReferrer.ToString()); } } else { AdminPage.WriteErrMsg("输入的不是有效的数值,请认真检查!", "StatConfig.aspx"); } }
private void init() { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); this.LblStartDate.Text = statInfoListInfo.StartDate; int num = 0; if (!string.IsNullOrEmpty(statInfoListInfo.StartDate)) { TimeSpan span = (TimeSpan)(DateTime.Today - Convert.ToDateTime(statInfoListInfo.StartDate)); num = span.Days + 1; } int num2 = 0; if (num <= 0) { num2 = num; } else { num2 = statInfoListInfo.TotalNum / num; if ((statInfoListInfo.TotalNum % num) != 0) { num2++; } } this.TblcStatDayNum.InnerText = num.ToString(); this.TdlcMonthMaxNum.InnerText = statInfoListInfo.MonthMaxNum.ToString(); this.TdlcTotalNum.InnerText = statInfoListInfo.TotalNum.ToString(); this.TdlcMonthMaxDate.InnerText = statInfoListInfo.MonthMaxDate; this.TdlcTotalView.InnerText = statInfoListInfo.TotalView.ToString(); this.TdlcDayMaxDate.InnerText = statInfoListInfo.DayMaxDate; this.TdlcDayMaxNum.InnerText = statInfoListInfo.DayMaxNum.ToString(); this.TdlcAveDayNum.InnerText = num2.ToString(); this.TdlcHourMaxNum.InnerText = statInfoListInfo.HourMaxNum.ToString(); this.TdlcDayNum.InnerText = statInfoListInfo.DayNum.ToString(); this.TdlcHourMaxTime.InnerText = statInfoListInfo.HourMaxTime; this.TdlcPreDayNum.InnerText = Convert.ToString((int)((statInfoListInfo.DayNum * 0x5a0) / ((DateTime.Now.Hour * 60) + DateTime.Now.Minute))); this.TdlcChinaNum.InnerText = statInfoListInfo.ChinaNum.ToString(); this.TdlcOtherNum.InnerText = statInfoListInfo.OtherNum.ToString(); this.TdlcSystem.InnerText = UserDataReport.MaxValue(StatName.UserSystem); this.TdlcBrowser.InnerText = UserDataReport.MaxValue(StatName.UserBrowser); this.TdlcMaxAreNum.InnerText = UserDataReport.MaxValue(StatName.UserAddress); this.TdlcMaxWebNum.InnerText = UserDataReport.MaxValue(StatName.UserWeburl); this.TdlcMaxScrNum.InnerText = UserDataReport.MaxValue(StatName.UserScreen); this.TdlcMaxColorNum.InnerText = UserDataReport.MaxValue(StatName.UserColor); this.TdlcCountNum.InnerText = OtherReport.GetVisitorCount().ToString(); }
public bool SaveConfig(StatInfoListInfo info) { Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@MasterTimeZone", DbType.Int32, info.MasterTimeZone); cmdParams.AddInParameter("@Interval", DbType.Int32, info.Interval); cmdParams.AddInParameter("@IntervalNum", DbType.Int32, info.IntervalNum); cmdParams.AddInParameter("@OnlineTime", DbType.Int32, info.OnlineTime); cmdParams.AddInParameter("@VisitRecord", DbType.Int32, info.VisitRecord); cmdParams.AddInParameter("@KillRefresh", DbType.Int32, info.KillRefresh); cmdParams.AddInParameter("@RegFields_Fill", DbType.String, info.RegFieldsFill); cmdParams.AddInParameter("@OldTotalNum", DbType.Int32, info.OldTotalNum); cmdParams.AddInParameter("@OldTotalView", DbType.Int32, info.OldTotalView); cmdParams.AddInParameter("@StartDate", DbType.String, info.StartDate); return(DBHelper.ExecuteNonQueryProc("PR_Analytics_SaveConfig", cmdParams) > 0); }
protected void Page_Load(object sender, EventArgs e) { int interval; int intervalNum; string str = string.Empty; if (((base.Application["RegFields_Fill"] == null) || (base.Application["Interval"] == null)) || (base.Application["IntervalNum"] == null)) { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); base.Application.Lock(); base.Application["Interval"] = statInfoListInfo.Interval; base.Application["IntervalNum"] = statInfoListInfo.IntervalNum; base.Application.UnLock(); str = string.IsNullOrEmpty(statInfoListInfo.RegFieldsFill) ? string.Empty : statInfoListInfo.RegFieldsFill; base.Application["RegFields_Fill"] = str; interval = statInfoListInfo.Interval; intervalNum = statInfoListInfo.IntervalNum; } else { str = base.Application["RegFields_Fill"].ToString(); interval = DataConverter.CLng(base.Application["Interval"]); intervalNum = DataConverter.CLng(base.Application["IntervalNum"]); } string str2 = BasePage.RequestString("Style"); StringBuilder builder = new StringBuilder(); builder.Append("var i = 0;"); builder.Append("function EasyOneRef(){"); builder.Append(" if(i <= " + intervalNum.ToString() + "){"); builder.Append("var EasyOneImg=new Image();"); builder.Append("EasyOneImg.src='" + base.FullBasePath + "Analytics/StatOnline.aspx';"); builder.Append("setTimeout('EasyOneRef()'," + Convert.ToString((int)(interval * 0x3e8)) + ");}"); builder.Append("i+=1;}"); if (str.Contains("IsCountOnline")) { builder.Append("EasyOneRef();"); } builder.Append("var referrer = escape(document.referrer);"); builder.Append("var timezone = (new Date()).getTimezoneOffset();"); builder.Append("var width = screen.width;"); builder.Append("var height = screen.height;"); builder.Append("var color = screen.colorDepth;"); builder.Append("document.write('<'+'script type=\"text/javascript\" src=" + base.FullBasePath + "Analytics/Counter.aspx?style=" + str2 + "&Referer='+referrer+'&Timezone='+timezone+'&Width='+width+'&Height='+height+'&Color='+color+'><'+'/script>');"); base.Response.Write(builder.ToString()); base.Response.End(); }
private void InitApp() { if ((base.Application["RegFields_Fill"] != null) && (base.Application["KillRefresh"] != null)) { this.m_RegFieldsFillTmp = base.Application["RegFields_Fill"].ToString(); this.m_KillRefreshTmp = DataConverter.CLng(base.Application["KillRefresh"]); } else { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); this.m_RegFieldsFillTmp = string.IsNullOrEmpty(statInfoListInfo.RegFieldsFill) ? string.Empty : statInfoListInfo.RegFieldsFill; this.m_KillRefreshTmp = statInfoListInfo.KillRefresh; base.Application.Lock(); base.Application["RegFields_Fill"] = this.m_RegFieldsFillTmp; base.Application["KillRefresh"] = this.m_KillRefreshTmp; base.Application["Interval"] = statInfoListInfo.Interval; base.Application["IntervalNum"] = statInfoListInfo.IntervalNum; base.Application.UnLock(); } if (base.Application["EasyOne_LastIP"] == null) { base.Application["EasyOne_LastIP"] = "#0.0.0.0#"; } }
private void ShowInfo() { string str = BasePage.RequestString("Style"); if (!string.IsNullOrEmpty(str) || (string.Compare(str, "none", StringComparison.OrdinalIgnoreCase) != 0)) { StatInfoListInfo statInfoListInfo = OtherReport.GetStatInfoListInfo(); int num = statInfoListInfo.TotalNum + statInfoListInfo.OldTotalNum; int num2 = statInfoListInfo.TotalView + statInfoListInfo.OldTotalView; TimeSpan span = (TimeSpan)(DateTime.Today - DataConverter.CDate(statInfoListInfo.StartDate)); int days = 0; if (span.Days <= 0) { days = span.Days; } else { days = num / span.Days; if ((num % span.Days) != 0) { days++; } } StringBuilder builder = new StringBuilder(); string str2 = str.ToLower().ToString(); if (str2 != null) { if (!(str2 == "simple")) { if (str2 == "all") { builder.Append("总访问量:" + num.ToString() + "人次<br>"); builder.Append("总浏览量:" + num2.ToString() + "人次<br>"); if (this.m_RegFieldsFillTmp.Contains("IsCountOnline")) { builder.Append("当前在线:" + OtherReport.GetCurrentOnlineCount().ToString() + "人次<br>"); } if (this.m_RegFieldsFillTmp.Contains("FYesterDay")) { int num4 = 0; if (base.Application["nYesterDayVisitorNum"] != null) { num4 = DataConverter.CLng(base.Application["nYesterDayVisitorNum"]); } else { int[] list = TimeReport.GetList(StatName.Day, DateTime.Today.AddDays(-1.0).ToString("yyyy-MM-dd")); if (list != null) { foreach (int num5 in list) { num4 += num5; } } base.Application["nYesterDayVisitorNum"] = num4; } builder.Append("昨日访问:" + num4.ToString() + "人次<br>"); } builder.Append("今日访问:" + statInfoListInfo.DayNum.ToString() + "人次<br>"); builder.Append("日均访问:" + days.ToString() + "人次<br>"); } else if (str2 == "common") { builder.Append("总访问量:" + num.ToString() + "人次<br>"); builder.Append("总浏览量:" + num2.ToString() + "人次<br>"); if (this.m_RegFieldsFillTmp.Contains("IsCountOnline")) { builder.Append("当前在线:" + OtherReport.GetCurrentOnlineCount().ToString() + "人次<br>"); } } } else { builder.Append("总访问量:" + num.ToString() + "人次<br>"); if (this.m_RegFieldsFillTmp.Contains("IsCountOnline")) { builder.Append("当前在线:" + OtherReport.GetCurrentOnlineCount().ToString() + "人次<br>"); } } } base.Response.Write("document.write('" + builder.ToString() + "');"); base.Response.End(); } }
public static bool SaveConfig(StatInfoListInfo info) { return(dal.SaveConfig(info)); }