Пример #1
0
 public void AddSubscribedWebsite(string userName, string websiteLink, string websiteOwner)
 {
     if (!String.IsNullOrEmpty(websiteLink))
     {
         dal.AddSubscribedWebsite(userName, ParseLink(websiteLink));
         var bl = new MonitoredWebsitesBL();
         var website = new MonitoredWebsite
         {
             Id = websiteLink,
             Title = websiteOwner
         };
         bl.SaveMonitoredWebsite(website);
     }
 }
Пример #2
0
 public string GetAllMonitoredWebsitesAsXml(string username)
 {
     var bl = new MonitoredWebsitesBL();
     return bl.GetAllSubscribedWebsitesAsXml(username);
 }
Пример #3
0
 private void OnWebsiteWorkerDoWork(object sender, DoWorkEventArgs e)
 {
     var monitoredWebsitesBL = new MonitoredWebsitesBL();
     List<MonitoredWebsite> monitoredWebsites = monitoredWebsitesBL.GetAllWebsites();
     var modifiedWebsites = new List<MonitoredWebsite>();
     if (monitoredWebsites != null)
     {
         for (int i = 0; i < monitoredWebsites.Count; i++)
         {
             MonitoredWebsite monitoredWebsite = monitoredWebsites[i];
             string hashedContent = Monitor.GetMD5Hash(monitoredWebsite.Id);
             if (hashedContent != monitoredWebsite.HashedContent)
             {
                 monitoredWebsites[i].HashedContent = hashedContent;
                 monitoredWebsites[i].LastModified = DateTime.Now;
                 modifiedWebsites.Add(monitoredWebsites[i]);
             }
         }
     }
     monitoredWebsitesBL.SaveMonitoredWebsites(modifiedWebsites);
 }