Ejemplo n.º 1
0
        //public string GetTextValue()
        //{
        //    return _currentElement.XPathConcatText(".//td//text()", separator: " ", itemFunc: s => __trimFunc1(__badCharacters.Replace(s, " "))); ;
        //}

        //public string[] GetTextValues()
        //{
        //    return _currentElement.XPathValues(".//td//text()", s => __trimFunc1(__badCharacters.Replace(s, " "))); ;
        //}

        //public static string GetEmail(string html)
        //{
        //    // var lien1 = '<a href="mailto:';
        //    // var email1 = "jeu-ser";
        //    // var lien2 = '">';
        //    // var email2 = "wanadoo.fr";
        //    // var lien3 = '</a>';
        //    // document.write(lien1 + email1 + "@" + email2 + lien2 + email1 + "@" + email2 + lien3);"
        //    if (html == null)
        //        return null;
        //    Match match1 = __email1Regex.Match(html);
        //    Match match2 = __email2Regex.Match(html);
        //    if (match1.Success && match2.Success)
        //        return match1.Groups[1].Value + "@" + match2.Groups[1].Value;
        //    else
        //    {
        //        Trace.WriteLine("warning cant extract email from\r\n{0}", html);
        //        return null;
        //    }
        //}

        //public bool SetActivityValue(Activity activity, string valueName)
        //{
        //    bool ret = true;
        //    switch (valueName.ToLower())
        //    {
        //        // NOTRE OFFRE (html)
        //        case "description":
        //            activity.description = GetTextValue();
        //            break;
        //        case "moyens techniques disponibles":
        //            activity.moyensTechniquesDisponibles = GetTextValue();
        //            break;
        //        case "effectif total mobilisable (etp)":
        //            activity.effectifTotalMobilisable = GetTextValue();
        //            break;
        //        case "modalités pratiques":
        //            activity.modalitésPratiques = GetTextValue();
        //            break;
        //        case "couverture géographique":
        //            activity.couvertureGéographique = GetTextValue();
        //            break;
        //        default:
        //            ret = false;
        //            break;
        //    }
        //    return ret;
        //}

        //public bool SetContactValue(Contact contact, string valueName)
        //{
        //    bool ret = true;
        //    switch (valueName.ToLower())
        //    {
        //        // CONTACTS (html)
        //        case "prénom et nom":
        //            contact.nom = GetTextValue();
        //            break;
        //        case "fonction":
        //            contact.fonction = GetTextValue();
        //            break;
        //        case "téléphone":
        //            contact.tel = GetTextValue();
        //            break;
        //        case "mobile":
        //            contact.mobile = GetTextValue();
        //            break;
        //        case "e-mail":
        //            contact.email = GetEmail(GetTextValue());
        //            break;
        //        default:
        //            ret = false;
        //            break;
        //    }
        //    return ret;
        //}

        //public bool SetValue(Handeco_DetailCompany company, string valueName)
        //{
        //    bool ret = true;
        //    switch (valueName.ToLower())
        //    {
        //        // LES INFOS CLES (html)
        //        case "logo":
        //            company.logo = zurl.GetUrl(Url, _currentElement.XPathValue(".//td//img/@src"));
        //            break;
        //        case "raison sociale":
        //            company.raisonSociale = GetTextValue();
        //            break;
        //        case "date de création":
        //            company.dateCréation = GetTextValue();
        //            break;
        //        case "statut juridique":
        //            company.statutJuridique = GetTextValue();
        //            break;
        //        case "type de structure":
        //            company.typeStructure = GetTextValue();
        //            break;
        //        case "site web":
        //            company.siteWeb = GetTextValue();
        //            break;
        //        case "n° siret":
        //            company.siret = GetTextValue();
        //            break;
        //        case "localisation géographique":
        //            company.localisation = GetTextValue();
        //            break;
        //        case "normes, habilitations et certifications":
        //            company.normes = GetTextValue();
        //            break;
        //        case "chiffre d'affaires annuel":
        //            company.chiffreAffairesAnnuel = GetTextValue();
        //            break;
        //        case "effectif total (etp)":
        //            company.effectifTotal = GetTextValue();
        //            break;
        //        case "effectif de production (etp)":
        //            company.effectifProduction = GetTextValue();
        //            break;
        //        case "effectif d'encadrement (etp)":
        //            company.effectifEncadrement = GetTextValue();
        //            break;
        //        case "nombre de travailleurs handicapés (etp)":
        //            company.nombreTravailleursHandicapés = GetTextValue();
        //            break;
        //        case "nombre de personnes handicapées accompagnées par an":
        //            company.nombreHandicapéAccompagné = GetTextValue();
        //            break;
        //        // RESEAUX ET PARTENAIRES (html)
        //        case "appartenance à un groupe":
        //            company.appartenanceGroupe = GetTextValue();
        //            break;
        //        case "présentation du groupe":
        //            company.présentationGroupe = GetTextValue();
        //            break;
        //        case "site web du groupe":
        //            company.siteWebGroupe = GetTextValue();
        //            break;
        //        case "adhésion à des réseaux du handicap":
        //            company.adhésionRéseauxHandicap = GetTextValue();
        //            break;
        //        case "adhésion à des groupements et fédérations professionnels":
        //            //company.adhésionGroupement = GetTextValue();
        //            company.groupes = GetTextValues();
        //            break;
        //        case "expérience de co-traitance ou de gme avec":
        //            company.cotraitance = GetTextValue();
        //            break;
        //        // NOS COORDONNEES (html)
        //        case "adresse principale":
        //            company.adressePrincipale = GetTextValue();
        //            break;
        //        case "adresse du siège":
        //            company.adresseSiège = GetTextValue();
        //            break;
        //        case "adresse des antennes":
        //            company.adresseAntennes = GetTextValue();
        //            break;
        //        case "e-mail":
        //            company.email = GetEmail(GetTextValue());
        //            break;
        //        case "tél":
        //            company.tel = GetTextValue();
        //            break;
        //        case "fax":
        //            company.fax = GetTextValue();
        //            break;
        //        case "code ape":
        //            company.codeApe = GetTextValue();
        //            break;
        //        case "n° finess":
        //            company.numeroFiness = GetTextValue();
        //            break;
        //        default:
        //            //company.unknowInfos.Add(valueName + " : " + value);
        //            ret = false;
        //            break;
        //    }
        //    return ret;
        //}

        public static TelechargementPlus_PostDetail Load(string url, bool reload = false, bool loadImage = false)
        {
            TelechargementPlus_LoadDetailFromWeb_v2 load = new TelechargementPlus_LoadDetailFromWeb_v2(url, reload, loadImage);

            load.Load();
            return(load.Data);
        }
Ejemplo n.º 2
0
 public static void Init()
 {
     TelechargementPlus_LoadHeaderFromWeb_v2.ClassInit(XmlConfig.CurrentConfig.GetElement("TelechargementPlus/Header"));
     TelechargementPlus_LoadHeader_v2.ClassInit(XmlConfig.CurrentConfig.GetElement("TelechargementPlus/Header"));
     TelechargementPlus_LoadDetailFromWeb_v2.ClassInit(XmlConfig.CurrentConfig.GetElement("TelechargementPlus/Detail"));
     TelechargementPlus_LoadDetail_v2.ClassInit(XmlConfig.CurrentConfig.GetElement("TelechargementPlus/Detail"));
     //__xmlCompanyListFile = XmlConfig.CurrentConfig.GetExplicit("Handeco/Xml/XmlCompanyListFile");
     //__xmlDetailCompanyListFile = XmlConfig.CurrentConfig.GetExplicit("Handeco/Xml/XmlDetailCompanyListFile");
 }
Ejemplo n.º 3
0
 protected override TelechargementPlus_PostDetail LoadDocumentFromWeb(bool reload = false, bool loadImage = false)
 {
     return(TelechargementPlus_LoadDetailFromWeb_v2.Load(Url, reload, loadImage));
 }