示例#1
0
 public static string GetRedirectUrl(string returnUrl)
 {
     return(PageUtils.GetAnalysisUrl(nameof(PageAnalysisSite), new NameValueCollection
     {
         { "returnUrl", StringUtils.ValueToUrl(returnUrl) }
     }));
 }
示例#2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            SpContents.ControlToPaginate = RptContents;
            RptContents.ItemDataBound   += RptContents_ItemDataBound;
            SpContents.ItemsPerPage      = PublishmentSystemInfo.Additional.PageSize;

            SpContents.SelectCommand = BaiRongDataProvider.ContentDao.GetSelectCommendByHitsAnalysis(PublishmentSystemInfo.AuxiliaryTableForContent, PublishmentSystemId);

            SpContents.SortField = ContentAttribute.Hits;
            SpContents.SortMode  = SortMode.DESC;

            _pageUrl = PageUtils.GetAnalysisUrl(nameof(PageAnalysisContentHits), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() }
            });

            if (IsPostBack)
            {
                return;
            }

            if (PublishmentSystemId > 0)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdSiteAnalysis, "内容点击量排名", AppManager.Cms.Permission.WebSite.SiteAnalysis);
            }
            else
            {
                BreadCrumbAnalysis(AppManager.Analysis.LeftMenu.Chart, "内容点击量排名", AppManager.Analysis.Permission.AnalysisChart);
            }

            SpContents.DataBind();

            foreach (var contentId in _contentIdList)
            {
                var yValueHits      = GetYHashtable(contentId, YTypeHits);
                var yValueHitsDay   = GetYHashtable(contentId, YTypeHitsDay);
                var yValueHitsWeek  = GetYHashtable(contentId, YTypeHitsWeek);
                var yValueHitsMonth = GetYHashtable(contentId, YTypeHitsMonth);
                var xValue          = GetXHashtable(contentId);
                if (xValue.Length > 10)
                {
                    xValue = xValue.Substring(0, 10);
                }

                LtlArray.Text += $@"
xArrayHits.push('{xValue}');
yArrayHits.push('{yValueHits}');
yArrayHitsDay.push('{yValueHitsDay}');
yArrayHitsWeek.push('{yValueHitsWeek}');
yArrayHitsMonth.push('{yValueHitsMonth}');
";
            }
        }
示例#3
0
 public static string GetRedirectUrl(int publishmentSystemId, string returnUrl)
 {
     return(PageUtils.GetAnalysisUrl(nameof(PageAnalysisContentHits), new NameValueCollection
     {
         { "returnUrl", StringUtils.ValueToUrl(returnUrl) },
         { "publishmentSystemID", publishmentSystemId.ToString() }
     }));
 }
        public void Analysis_OnClick(object sender, EventArgs e)
        {
            var pageUrl = PageUtils.GetAnalysisUrl(nameof(PageAnalysisAdminWork), new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                { "StartDate", TbStartDate.Text },
                { "EndDate", TbEndDate.Text }
            });

            PageUtils.Redirect(pageUrl);
        }
示例#5
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (Body.IsQueryExists("Delete"))
            {
                var list = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("IDCollection"));
                try
                {
                    BaiRongDataProvider.ErrorLogDao.Delete(list);
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }
            else if (Body.IsQueryExists("DeleteAll"))
            {
                try
                {
                    BaiRongDataProvider.ErrorLogDao.DeleteAll();
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = StringUtils.Constants.PageSize;

            if (!Body.IsQueryExists("Keyword"))
            {
                spContents.SelectCommand = BaiRongDataProvider.ErrorLogDao.GetSelectCommend();
            }
            else
            {
                spContents.SelectCommand = BaiRongDataProvider.ErrorLogDao.GetSelectCommend(Body.GetQueryString("Keyword"), Body.GetQueryString("DateFrom"), Body.GetQueryString("DateTo"));
            }

            spContents.SortField       = "ID";
            spContents.SortMode        = SortMode.DESC;
            rptContents.ItemDataBound += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                BreadCrumbAnalysis(AppManager.Analysis.LeftMenu.Log, "系统错误日志", AppManager.Analysis.Permission.AnalysisLog);

                if (Body.IsQueryExists("Keyword"))
                {
                    Keyword.Text  = Body.GetQueryString("Keyword");
                    DateFrom.Text = Body.GetQueryString("DateFrom");
                    DateTo.Text   = Body.GetQueryString("DateTo");
                }

                Delete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUtils.GetAnalysisUrl(nameof(PageLogError), new NameValueCollection
                {
                    { "Delete", "True" }
                }), "IDCollection", "IDCollection", "请选择需要删除的日志!", "此操作将删除所选日志,确认吗?"));

                DeleteAll.Attributes.Add("onclick", PageUtils.GetRedirectStringWithConfirm(PageUtils.GetAnalysisUrl(nameof(PageLogError), new NameValueCollection
                {
                    { "DeleteAll", "True" }
                }), "此操作将删除所有日志信息,确定吗?"));

                spContents.DataBind();
            }
        }
示例#6
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = StringUtils.Constants.PageSize;

            if (!Body.IsQueryExists("Keyword"))
            {
                spContents.SelectCommand = BaiRongDataProvider.LogDao.GetSelectCommend();
            }
            else
            {
                spContents.SelectCommand = BaiRongDataProvider.LogDao.GetSelectCommend(Body.GetQueryString("UserName"), Body.GetQueryString("Keyword"), Body.GetQueryString("DateFrom"), Body.GetQueryString("DateTo"));
            }

            spContents.SortField       = "ID";
            spContents.SortMode        = SortMode.DESC;
            rptContents.ItemDataBound += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                BreadCrumbAnalysis(AppManager.Analysis.LeftMenu.Log, "管理员日志", AppManager.Analysis.Permission.AnalysisLog);

                if (Body.IsQueryExists("Keyword"))
                {
                    UserName.Text = Body.GetQueryString("UserName");
                    Keyword.Text  = Body.GetQueryString("Keyword");
                    DateFrom.Text = Body.GetQueryString("DateFrom");
                    DateTo.Text   = Body.GetQueryString("DateTo");
                }

                if (Body.IsQueryExists("Delete"))
                {
                    var arraylist = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("IDCollection"));
                    try
                    {
                        BaiRongDataProvider.LogDao.Delete(arraylist);
                        SuccessDeleteMessage();
                    }
                    catch (Exception ex)
                    {
                        FailDeleteMessage(ex);
                    }
                }
                else if (Body.IsQueryExists("DeleteAll"))
                {
                    try
                    {
                        BaiRongDataProvider.LogDao.DeleteAll();
                        SuccessDeleteMessage();
                    }
                    catch (Exception ex)
                    {
                        FailDeleteMessage(ex);
                    }
                }
                else if (Body.IsQueryExists("Setting"))
                {
                    try
                    {
                        ConfigManager.SystemConfigInfo.IsLogAdmin = !ConfigManager.SystemConfigInfo.IsLogAdmin;
                        BaiRongDataProvider.ConfigDao.Update(ConfigManager.Instance);
                        SuccessMessage($"成功{(ConfigManager.SystemConfigInfo.IsLogAdmin ? "启用" : "禁用")}日志记录");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, $"{(ConfigManager.SystemConfigInfo.IsLogAdmin ? "启用" : "禁用")}日志记录失败");
                    }
                }

                Delete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUtils.GetAnalysisUrl(nameof(PageLogAdmin), new NameValueCollection
                {
                    { "Delete", "True" }
                }), "IDCollection", "IDCollection", "请选择需要删除的日志!", "此操作将删除所选日志,确认吗?"));

                DeleteAll.Attributes.Add("onclick", PageUtils.GetRedirectStringWithConfirm(PageUtils.GetAnalysisUrl(nameof(PageLogAdmin), new NameValueCollection
                {
                    { "DeleteAll", "True" }
                }), "此操作将删除所有日志信息,确定吗?"));

                if (ConfigManager.SystemConfigInfo.IsLogAdmin)
                {
                    Setting.Text = "禁用记录日志功能";
                    Setting.Attributes.Add("onclick",
                                           PageUtils.GetRedirectStringWithConfirm(
                                               PageUtils.GetAnalysisUrl(nameof(PageLogAdmin), new NameValueCollection
                    {
                        { "Setting", "True" }
                    }), "此操作将禁用管理员日志记录功能,确定吗?"));
                }
                else
                {
                    ltlState.Text = " (管理员日志当前处于禁用状态,将不会记录相关操作!)";
                    Setting.Text  = "启用记录日志功能";
                    Setting.Attributes.Add("onclick",
                                           PageUtils.GetRedirectStringWithConfirm(
                                               PageUtils.GetAnalysisUrl(nameof(PageLogAdmin), new NameValueCollection
                    {
                        { "Setting", "True" }
                    }), "此操作将启用管理员日志记录功能,确定吗?"));
                }

                spContents.DataBind();
            }
        }
示例#7
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = StringUtils.Constants.PageSize;

            if (!Body.IsQueryExists("LogType"))
            {
                spContents.SelectCommand = DataProvider.LogDao.GetSelectCommend();
            }
            else
            {
                spContents.SelectCommand = DataProvider.LogDao.GetSelectCommend(PublishmentSystemId, Body.GetQueryString("LogType"), Body.GetQueryString("UserName"), Body.GetQueryString("Keyword"), Body.GetQueryString("DateFrom"), Body.GetQueryString("DateTo"));
            }

            spContents.SortField       = "ID";
            spContents.SortMode        = SortMode.DESC;
            rptContents.ItemDataBound += rptContents_ItemDataBound;

            if (IsPostBack)
            {
                return;
            }

            BreadCrumbAnalysis(AppManager.Analysis.LeftMenu.Log, "站点日志", AppManager.Analysis.Permission.AnalysisLog);

            if (PublishmentSystemId == 0)
            {
                ltlPublishmentSystem.Text = @"<td align=""center"" width=""160"">&nbsp;站点名称</td>";
            }

            PublishmentSystem.Items.Add(new ListItem("<<全部站点>>", "0"));

            var publishmentSystemIdList = PublishmentSystemManager.GetPublishmentSystemIdListOrderByLevel();

            foreach (var psId in publishmentSystemIdList)
            {
                PublishmentSystem.Items.Add(new ListItem(PublishmentSystemManager.GetPublishmentSystemInfo(psId).PublishmentSystemName, psId.ToString()));
            }

            LogType.Items.Add(new ListItem("全部记录", "All"));
            LogType.Items.Add(new ListItem("栏目相关记录", "Channel"));
            LogType.Items.Add(new ListItem("内容相关记录", "Content"));

            if (Body.IsQueryExists("LogType"))
            {
                ControlUtils.SelectListItems(PublishmentSystem, PublishmentSystemId.ToString());
                ControlUtils.SelectListItems(LogType, Body.GetQueryString("LogType"));
                UserName.Text = Body.GetQueryString("UserName");
                Keyword.Text  = Body.GetQueryString("Keyword");
                DateFrom.Text = Body.GetQueryString("DateFrom");
                DateTo.Text   = Body.GetQueryString("DateTo");
            }

            if (Body.IsQueryExists("Delete"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("IDCollection"));
                try
                {
                    DataProvider.LogDao.Delete(arraylist);
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }
            else if (Body.IsQueryExists("DeleteAll"))
            {
                try
                {
                    DataProvider.LogDao.DeleteAll();
                    SuccessDeleteMessage();
                }
                catch (Exception ex)
                {
                    FailDeleteMessage(ex);
                }
            }

            Delete.Attributes.Add("onclick",
                                  PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(
                                      PageUtils.GetAnalysisUrl(nameof(PageLogSite), new NameValueCollection
            {
                { "Delete", "True" }
            }), "IDCollection", "IDCollection", "请选择需要删除的日志!", "此操作将删除所选日志,确认吗?"));
            DeleteAll.Attributes.Add("onclick",
                                     PageUtils.GetRedirectStringWithConfirm(
                                         PageUtils.GetAnalysisUrl(nameof(PageLogSite), new NameValueCollection
            {
                { "DeleteAll", "True" }
            }), "此操作将删除所有日志信息,确定吗?"));

            spContents.DataBind();
        }