Пример #1
0
        public ActionResult Add(string url = "", int sourceId = 0, string mobile = "", string modulName = "")
        {
            string reJson  = "";
            string logName = "页面浏览统计";

            try
            {
                #region 获得参数信息

                if (sourceId > 0)
                {
                    PageTools.CookieSourceId = sourceId.ToString();
                }
                else
                {
                    int.TryParse(PageTools.CookieSourceId, out sourceId);
                }
                //if (!string.IsNullOrEmpty(mobile))
                //{
                //    PageTools.CookieMobile = mobile;
                //}
                //else
                //{
                //    mobile = PageTools.CookieMobile;
                //}

                //var openid = PageTools.CookieOpenId;


                string guid       = Guid.NewGuid().ToString("N");
                string uniqueUser = PageTools.CookieUniqueUser;
                if (string.IsNullOrEmpty(uniqueUser))
                {
                    uniqueUser = Guid.NewGuid().ToString("N");
                    PageTools.CookieUniqueUser = uniqueUser;
                }

                #endregion

                #region 添加日志

                FarmMonitor.BLL.LogTrackMan ltMan = new FarmMonitor.BLL.LogTrackMan();
                //LogTrack message = new LogTrack();
                ltMan.AddLog("volvo_ebook_view", sourceId, 0, 0, uniqueUser, modulName, 0, 0, 0, "", "", guid, Session.SessionID);
                LogTrack lt = ltMan.GetEntity(guid);
                reJson = string.Format(json, "1", "success", guid, lt.Id);

                #endregion
            }
            catch (Exception ex)
            {
                LogExceptionMan.AddLog(logName, WeDo.Log.Model.EnumListLog.LogLevel.ERROR, ex);
                reJson = string.Format(json, "2", "error", "", 0);
            }

            return(Content(reJson));
        }
Пример #2
0
        public ActionResult ShareTrack(string url = "", string modulName = "")
        {
            string reJson  = "";
            string logName = "分享统计";

            try
            {
                #region 获得参数信息

                int sourceId = 0;
                int.TryParse(PageTools.CookieSourceId, out sourceId);
                string mobile     = PageTools.CookieMobile;
                string guid       = Guid.NewGuid().ToString("N");
                string uniqueUser = PageTools.CookieUniqueUser;
                if (string.IsNullOrEmpty(uniqueUser))
                {
                    uniqueUser = Guid.NewGuid().ToString("N");
                    PageTools.CookieUniqueUser = uniqueUser;
                }

                #endregion

                #region 添加日志

                FarmMonitor.BLL.LogTrackMan ltMan = new FarmMonitor.BLL.LogTrackMan();
                ltMan.AddLog("volvo_ebook_share", sourceId, 0, 0, uniqueUser, modulName, 0, 0, 0, "", "", guid, Session.SessionID);


                //WeDo.Log.LogTrackMan.AddLog(message, WeDo.Log.Model.EnumListLog.LogLevel.INFO);
                reJson = string.Format(json, "1", "success", "", 0);

                #endregion
            }
            catch (Exception ex)
            {
                LogExceptionMan.AddLog(logName, WeDo.Log.Model.EnumListLog.LogLevel.ERROR, ex);
                reJson = string.Format(json, "2", "error", "", 0);
            }

            return(Content(reJson));
        }