Exemplo n.º 1
0
        public int GetAssociatedSite(string ticketBody)
        {
            string folder = ExtendedInformationHelper.StripText(ticketBody, "folder :");

            if (!string.IsNullOrWhiteSpace(folder) &&
                !SiteAssociation.ContainsKey(folder.ToLower()))
            {
                return(SiteAssociation[folder.ToLower()]);
            }
            return(-1);
        }
Exemplo n.º 2
0
 public AssociationHelper(IEnumerable <SiteForExtendedTicketDto> sites, ILogger logger)
 {
     _logger         = logger;
     SiteAssociation = new Dictionary <string, int>();
     foreach (SiteForExtendedTicketDto site in sites)
     {
         string folder = ExtendedInformationHelper.StripText(site.Description, "folder :");
         if (!string.IsNullOrWhiteSpace(folder))
         {
             if (SiteAssociation.ContainsKey(folder.ToLower()))
             {
                 _logger.Warning($"Folder : {folder} is already associated with siteId {SiteAssociation[folder.ToLower()]} and cannot be associated with {site.Id}");
                 continue;
             }
             SiteAssociation.Add(folder.ToLower(), site.Id);
         }
     }
 }