Exemplo n.º 1
0
        public void UpdateUrlTracking(int PortalID, string Url, int ModuleId, int UserID)
        {
            TabType UrlType = Globals.GetURLType(Url);

            if (UrlType == TabType.File && Url.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase) == false)
            {
                //to handle legacy scenarios before the introduction of the FileServerHandler
                var fileName = Path.GetFileName(Url);

                var folderPath = Url.Substring(0, Url.LastIndexOf(fileName));
                var folder     = FolderManager.Instance.GetFolder(PortalID, folderPath);

                var file = FileManager.Instance.GetFile(folder, fileName);

                Url = "FileID=" + file.FileId;
            }
            UrlTrackingInfo objUrlTracking = GetUrlTracking(PortalID, Url, ModuleId);

            if (objUrlTracking != null)
            {
                if (objUrlTracking.TrackClicks)
                {
                    DataProvider.Instance().UpdateUrlTrackingStats(PortalID, Url, ModuleId);
                    if (objUrlTracking.LogActivity)
                    {
                        if (UserID == -1)
                        {
                            UserID = UserController.Instance.GetCurrentUserInfo().UserID;
                        }
                        DataProvider.Instance().AddUrlLog(objUrlTracking.UrlTrackingID, UserID);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void UpdateUrlTracking(int PortalID, string Url, int ModuleId, int UserID)
        {
            TabType UrlType = Globals.GetURLType(Url);

            if (UrlType == TabType.File & Url.ToLower().StartsWith("fileid=") == false)
            {
                // to handle legacy scenarios before the introduction of the FileServerHandler
                FileController objFiles = new FileController();
                Url = "FileID=" + objFiles.ConvertFilePathToFileId(Url, PortalID);
            }

            UrlTrackingInfo objUrlTracking = GetUrlTracking(PortalID, Url, ModuleId);

            if (objUrlTracking != null)
            {
                if (objUrlTracking.TrackClicks)
                {
                    DataProvider.Instance().UpdateUrlTrackingStats(PortalID, Url, ModuleId);
                    if (objUrlTracking.LogActivity)
                    {
                        if (UserID == -1)
                        {
                            UserID = UserController.GetCurrentUserInfo().UserID;
                        }
                        DataProvider.Instance().AddUrlLog(objUrlTracking.UrlTrackingID, UserID);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public ArrayList GetUrlLog(int PortalID, string Url, int ModuleId, DateTime StartDate, DateTime EndDate)
        {
            ArrayList       arrUrlLog      = null;
            UrlTrackingInfo objUrlTracking = GetUrlTracking(PortalID, Url, ModuleId);

            if (objUrlTracking != null)
            {
                arrUrlLog = CBO.FillCollection(DataProvider.Instance().GetUrlLog(objUrlTracking.UrlTrackingID, StartDate, EndDate), typeof(UrlLogInfo));
            }
            return(arrUrlLog);
        }
Exemplo n.º 4
0
 public void UpdateUrl(int PortalID, string Url, string UrlType, int Clicks, DateTime LastClick, DateTime CreatedDate, bool LogActivity, bool TrackClicks, int ModuleID, bool NewWindow)
 {
     if (!String.IsNullOrEmpty(Url))
     {
         if (UrlType == "U")
         {
             if (GetUrl(PortalID, Url) == null)
             {
                 DataProvider.Instance().AddUrl(PortalID, Url.Replace(@"\", @"/"));
             }
         }
         UrlTrackingInfo objURLTracking = GetUrlTracking(PortalID, Url, ModuleID);
         if (objURLTracking == null)
         {
             DataProvider.Instance().AddUrlTracking(PortalID, Url, UrlType, LogActivity, TrackClicks, ModuleID, NewWindow);
         }
         else
         {
             DataProvider.Instance().UpdateUrlTracking(PortalID, Url, LogActivity, TrackClicks, ModuleID, NewWindow);
         }
     }
 }