示例#1
0
        async Task SetOtherAccountAsync()
        {
            Contect.SetImageResource(Resource.Drawable.contect);
            Contect.Visibility = ViewStates.Visible;
            await Task.Delay(500);

            aboutslinkapp.Text = "Even your favourite social media accounts";
            aboutslinkapp.StartAnimation(fadeouttext);
            await Task.Delay(1500);

            //adding social accounts
            Facebook.SetImageResource(Resource.Drawable.facebook);
            Facebook.Visibility = ViewStates.Visible;
            Linkedin.SetImageResource(Resource.Drawable.linkedin);
            Linkedin.Visibility = ViewStates.Visible;
            Instagram.SetImageResource(Resource.Drawable.instagram);
            Instagram.Visibility = ViewStates.Visible;

            await Task.Delay(1500);

            aboutslinkapp.Text = "Don't forget to give your card a name";
            aboutslinkapp.StartAnimation(fadeouttext);
            await Task.Delay(1500);

            aboutslinkapp.ClearAnimation();
            SetCardNameAsync();
        }
示例#2
0
        public List <ShareResult> GetUrlsShares(string url, List <SocialNetworks> networks)
        {
            List <ShareResult> shareResults = new List <ShareResult>();
            ShareResult        sr;

            foreach (var item in networks)
            {
                sr = new ShareResult();
                switch (item)
                {
                case SocialNetworks.Facebook:
                    sr = Facebook.GetShares(url);
                    break;

                case SocialNetworks.Twitter:
                    sr = Twitter.GetShares(url);
                    break;

                case SocialNetworks.Vk:
                    sr = VKontakte.GetShares(url);
                    break;

                case SocialNetworks.Linkedin:
                    sr = Linkedin.GetShares(url);
                    break;

                case SocialNetworks.Mailru:
                    sr = Mailru.GetShares(url);
                    break;

                case SocialNetworks.Pinterest:
                    sr = Pinterest.GetShares(url);
                    break;

                case SocialNetworks.Odnoklassniki:
                    sr = Odnoklassniki.GetShares(url);
                    break;

                case SocialNetworks.Reddit:
                    sr = Reddit.GetShares(url);
                    break;

                case SocialNetworks.Stumbleupon:
                    sr = Stumbleupon.GetShares(url);
                    break;

                case SocialNetworks.Google:
                    sr = Google.GetShares(url);
                    break;
                }
                shareResults.Add(sr);
            }
            return(shareResults);
        }
示例#3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (Brand != null ? Brand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Copyright != null ? Copyright.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Avatar != null ? Avatar.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Github != null ? Github.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Linkedin != null ? Linkedin.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Twitter != null ? Twitter.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public async Task <CompanyRegistrationDTO> CreateCompany(CompanyRegistrationDTO CompanyRegistrationDTO)
        {
            CompanyQualification NewCompany = await db.CompanyQualifications.Where(p => p.QualificationName == "NewCompany").FirstOrDefaultAsync();

            var country = await countryServ.GetCountry(CompanyRegistrationDTO.HGBasedInCountryId);

            if (country == null)
            {
                throw new Exception("Id Страны не правильная");
            }
            Company company;

            if (CompanyRegistrationDTO.CompanyLinkedinLink != null)
            {
                Linkedin linkedin = new Linkedin {
                    FullLink = CompanyRegistrationDTO.CompanyLinkedinLink
                };
                await db.Linkedins.AddAsync(linkedin);

                company = new Company
                {
                    CompanyLegalName   = CompanyRegistrationDTO.CompanyLegalName,
                    HGBasedInCountryId = CompanyRegistrationDTO.HGBasedInCountryId,
                    Qualification      = NewCompany,
                    TradingName        = CompanyRegistrationDTO.TradingName,
                    Website            = CompanyRegistrationDTO.Website,
                    CompanyLinkedin    = linkedin
                };
            }
            else
            {
                company = new Company
                {
                    CompanyLegalName   = CompanyRegistrationDTO.CompanyLegalName,
                    HGBasedInCountryId = CompanyRegistrationDTO.HGBasedInCountryId,
                    Qualification      = NewCompany,
                    TradingName        = CompanyRegistrationDTO.TradingName,
                    Website            = CompanyRegistrationDTO.Website
                };
            }
            await db.Companies.AddAsync(company);

            await db.SaveChangesAsync();

            return(CompanyRegistrationDTO);
        }
示例#5
0
        public async Task <IActionResult> UpdateLinkedin(int id, Linkedin lin)
        {
            var linkedin = await _context.Linkedins.FindAsync(id);

            if (linkedin != null)
            {
                linkedin.candidat = linkedin.candidat;
                linkedin.linkedin = lin.linkedin;
                _context.Entry(linkedin).State = EntityState.Modified;
                _context.SaveChanges();
                return(Ok(new
                {
                    updatelinked = linkedin
                }));
            }
            return(NotFound());
        }
示例#6
0
        public List <ShareResult> GetAll(string url)
        {
            List <ShareResult> shareResults = new List <ShareResult>();

            shareResults.Add(Facebook.GetShares(url));
            shareResults.Add(Twitter.GetShares(url));
            shareResults.Add(VKontakte.GetShares(url));
            shareResults.Add(Linkedin.GetShares(url));
            shareResults.Add(Mailru.GetShares(url));
            shareResults.Add(Pinterest.GetShares(url));
            shareResults.Add(Odnoklassniki.GetShares(url));
            shareResults.Add(Reddit.GetShares(url));
            shareResults.Add(Stumbleupon.GetShares(url));
            shareResults.Add(Google.GetShares(url));


            return(shareResults);
        }
示例#7
0
        public async Task <IActionResult> AddLinkedin(string id, [FromBody] Linkedin lin)
        {
            Candidat user = (Candidat)await userManager.FindByIdAsync(id);

            if (user != null)
            {
                Linkedin x = _context.Linkedins.Where(c => c.candidat == user).FirstOrDefault();
                if (x != null)
                {
                    //_context.Remove(x);
                    //lin.candidat = user;
                    x.linkedin = lin.linkedin;
                    _context.Entry(x).State = EntityState.Modified;

                    //  lin.id_candidat = user.Id;
                    //  _context.Add(lin);
                    _context.SaveChanges();
                    return(Ok(new
                    {
                        lin = x
                    }));
                }
                else
                {
                    lin.candidat = user;
                    // lin.id_candidat = user.Id;
                    _context.Add(lin);
                    _context.SaveChanges();
                    return(Ok(new
                    {
                        lin = lin
                    }));
                }
            }
            return(NotFound());
        }
示例#8
0
 public LinkedinProfile GetProfile(int codEmpresa) => Linkedin.GetProfileLinkedin(codEmpresa);
示例#9
0
 public List <LinkedinInfo> GetEmpresa(string empresa) => Linkedin.GetDataLinkedin(empresa.Split(','));
示例#10
0
        public static async Task Initialize(UserManager <User> userManager, ApiContext context, RoleManager <IdentityRole> roleManager)
        {
            string adminEmail = "*****@*****.**";
            string password   = "******";

            if (await userManager.FindByNameAsync(adminEmail) == null)
            {
                await roleManager.CreateAsync(new IdentityRole("admin"));

                await roleManager.CreateAsync(new IdentityRole("lead"));

                await roleManager.CreateAsync(new IdentityRole("client"));

                User admin = new User {
                    Email = adminEmail, UserName = adminEmail
                };
                await userManager.CreateAsync(admin, password);

                await userManager.AddToRoleAsync(admin, "admin");

                User lead = new User {
                    Email = "*****@*****.**", UserName = "******", FirstName = "Dustin", LastName = "Carroll"
                };
                await userManager.CreateAsync(lead, password);

                await userManager.AddToRoleAsync(lead, "lead");

                User client = new User {
                    Email = "*****@*****.**", UserName = "******", FirstName = "John", LastName = "Hale"
                };
                await userManager.CreateAsync(client, password);

                await userManager.AddToRoleAsync(client, "client");

                User admin1 = new User {
                    Email = "*****@*****.**", UserName = "******", FirstName = "Douglas", LastName = "Henry"
                };
                await userManager.CreateAsync(admin1, password);

                await userManager.AddToRoleAsync(admin1, "admin");

                User client1 = new User {
                    Email = "*****@*****.**", UserName = "******", FirstName = "Dale", LastName = "Hopkins"
                };
                await userManager.CreateAsync(client1, password);

                await userManager.AddToRoleAsync(client1, "client");

                Region Africa = new Region {
                    Name = "Africa"
                };
                Region Antarctica = new Region {
                    Name = "Antarctica"
                };
                Region AsiaPacific = new Region {
                    Name = "Asia/Pacifig"
                };
                Region Europe = new Region {
                    Name = "Europe"
                };
                Region NorthAmerica = new Region {
                    Name = "North America"
                };
                Region SouthAmerica = new Region {
                    Name = "South America"
                };
                await context.Regions.AddRangeAsync(Africa, Antarctica, AsiaPacific, Europe, NorthAmerica, SouthAmerica);

                Country Australia = new Country {
                    Capital = "Canberra", Name = "Australia", Region = AsiaPacific
                };
                Country Germany = new Country {
                    Capital = "Berlin", Name = "Germany", Region = Europe
                };
                Country Slovakia = new Country {
                    Capital = "Bratislava", Name = "Slovakia", Region = Europe
                };
                Country USA = new Country {
                    Capital = "Washington", Name = "Unated States", Region = NorthAmerica
                };
                Country TM = new Country {
                    Capital = "Ashgabat", Name = "Turkmenistan", Region = AsiaPacific
                };
                await context.Countries.AddRangeAsync(Australia, Germany, Slovakia, USA);

                CompanyQualification Qualified = new CompanyQualification {
                    QualificationName = "Qualified"
                };
                CompanyQualification NotQualified = new CompanyQualification {
                    QualificationName = "NotQualified"
                };
                CompanyQualification NewCompany = new CompanyQualification {
                    QualificationName = "NewCompany"
                };
                await context.CompanyQualifications.AddRangeAsync(Qualified, NotQualified, NewCompany);

                Linkedin SlastininLinkedin = new Linkedin {
                    FullLink = "linkedin.com/in/aleksandr-slastinin-379654183/"
                };
                Linkedin TTRLinkedin = new Linkedin {
                    FullLink = "linkedin.com/company/turkmen-tranzit/"
                };
                Linkedin TTWLinkedin = new Linkedin {
                    FullLink = "linkedin.com/company/ttweb/"
                };
                await context.Linkedins.AddRangeAsync(SlastininLinkedin, TTRLinkedin, TTWLinkedin);

                await context.SaveChangesAsync();

                Contact contact1 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact2 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact3 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact4 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact5 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact6 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact7 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact8 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact9 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact10 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact11 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact contact12 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact TtrContact1 = new Contact
                {
                    Email     = "*****@*****.**",
                    FirstName = "Aleksandr",
                    Position  = "department head",
                    Surname   = "Slastinin",
                    Linkedin  = SlastininLinkedin
                };
                Contact TtrContact2 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact TtrContact3 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact TtwebContact1 = new Contact
                {
                    Email     = "*****@*****.**",
                    FirstName = "Irada",
                    Position  = "Project Manager",
                    Surname   = "davletowa",
                };
                Contact TtwebContact2 = new Contact {
                    Email = "*****@*****.**"
                };
                Contact TtwebContact3 = new Contact {
                    Email = "*****@*****.**"
                };

                await context.Contacts.AddRangeAsync(contact1, contact2, contact3, contact4, contact5, contact6, contact7, contact8, contact9, contact10, contact11, contact12, TtrContact1, TtrContact2, TtrContact3, TtwebContact1, TtwebContact2, TtwebContact3);

                await context.SaveChangesAsync();

                Company ACN = new Company
                {
                    CompanyLegalName = "ATM ATM Pty Ltd",
                    HGBasedInCountry = Australia,
                    Qualification    = Qualified,
                    TradingName      = "A.C.N.",
                    Website          = "b24.turkmen-tranzit.com"
                };
                await context.Companies.AddAsync(ACN);

                CompanyContactLink ContactACN1 = new CompanyContactLink
                {
                    Company = ACN,
                    Contact = contact1
                };
                CompanyContactLink ContactACN2 = new CompanyContactLink
                {
                    Company = ACN,
                    Contact = contact2
                };
                CompanyContactLink ContactACN3 = new CompanyContactLink
                {
                    Company = ACN,
                    Contact = contact3
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactACN1, ContactACN2, ContactACN3);

                Company ATM = new Company
                {
                    CompanyLegalName = "A.C.N. 605 479 678 Pty Ltd",
                    HGBasedInCountry = Australia,
                    Qualification    = Qualified,
                    TradingName      = "ATM",
                    LeadOwner        = lead,
                    QualifiedDate    = DateTime.Now,
                    Website          = "ttweb.org/blog"
                };
                await context.Companies.AddAsync(ATM);

                CompanyContactLink ContactATM1 = new CompanyContactLink
                {
                    Company = ATM,
                    Contact = contact4
                };
                CompanyContactLink ContactATM2 = new CompanyContactLink
                {
                    Company = ATM,
                    Contact = contact5
                };
                CompanyContactLink ContactATM3 = new CompanyContactLink
                {
                    Company = ATM,
                    Contact = contact6
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactATM1, ContactATM2, ContactATM3);

                Company Pay = new Company
                {
                    CompanyLegalName = "24-pay s.r.o",
                    HGBasedInCountry = Australia,
                    Qualification    = NotQualified,
                    TradingName      = "24 Pay SRO",
                    LeadOwner        = lead,
                    Website          = "24-pay.sk"
                };
                await context.Companies.AddAsync(Pay);

                CompanyContactLink ContactPay1 = new CompanyContactLink
                {
                    Company = Pay,
                    Contact = contact7
                };
                CompanyContactLink ContactPay2 = new CompanyContactLink
                {
                    Company = Pay,
                    Contact = contact8
                };
                CompanyContactLink ContactPay3 = new CompanyContactLink
                {
                    Company = Pay,
                    Contact = contact9
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactPay1, ContactPay2, ContactPay3);

                Company Ttz = new Company
                {
                    CompanyLegalName = "HO ''Turkmen-Tranzit''",
                    HGBasedInCountry = TM,
                    Qualification    = NewCompany,
                    TradingName      = "Turkmen-Tranzit",
                    Website          = "Turkmen-Tranzit.com",
                    CompanyLinkedin  = TTRLinkedin
                };
                await context.Companies.AddAsync(Ttz);

                CompanyContactLink ContactTtz1 = new CompanyContactLink
                {
                    Company = Ttz,
                    Contact = TtrContact1
                };
                CompanyContactLink ContactTtz2 = new CompanyContactLink
                {
                    Company = Ttz,
                    Contact = TtrContact2
                };
                CompanyContactLink ContactTtz3 = new CompanyContactLink
                {
                    Company = Ttz,
                    Contact = TtrContact3
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactTtz1, ContactTtz2, ContactTtz3);

                await context.SaveChangesAsync();

                Company Ttw = new Company
                {
                    CompanyLegalName = "HO ''Turkmen-Tranzit'' -> TTWeb",
                    HGBasedInCountry = TM,
                    Qualification    = Qualified,
                    TradingName      = "TtWeb",
                    Website          = "Ttweb.org",
                    CompanyLinkedin  = TTWLinkedin
                };
                await context.Companies.AddAsync(Ttw);

                CompanyContactLink ContactTtw1 = new CompanyContactLink
                {
                    Company = Ttw,
                    Contact = TtwebContact1
                };
                CompanyContactLink ContactTtw2 = new CompanyContactLink
                {
                    Company = Ttw,
                    Contact = TtwebContact2
                };
                CompanyContactLink ContactTtw3 = new CompanyContactLink
                {
                    Company = Ttw,
                    Contact = TtwebContact3
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactTtw1, ContactTtw2, ContactTtw3);

                await context.SaveChangesAsync();

                Company google = new Company
                {
                    CompanyLegalName = "google",
                    HGBasedInCountry = USA,
                    Qualification    = Qualified,
                    TradingName      = "google",
                    Website          = "google.com"
                };
                await context.Companies.AddAsync(google);

                CompanyContactLink ContactGoogle1 = new CompanyContactLink
                {
                    Company = google,
                    Contact = contact10
                };
                CompanyContactLink ContactGoogle2 = new CompanyContactLink
                {
                    Company = google,
                    Contact = contact11
                };
                CompanyContactLink ContactGoogle3 = new CompanyContactLink
                {
                    Company = google,
                    Contact = contact12
                };
                await context.CompanyContactLinks.AddRangeAsync(ContactGoogle1, ContactGoogle2, ContactGoogle3);

                Company microsoft = new Company
                {
                    CompanyLegalName = "microsoft",
                    HGBasedInCountry = USA,
                    Qualification    = Qualified,
                    TradingName      = "microsoft",
                    Website          = "microsoft.com"
                };
                await context.Companies.AddAsync(microsoft);

                AdvertisingCompany advertisingCompany = new AdvertisingCompany
                {
                    Id   = "cam_r7jfwbKo46XiS9okW",
                    Name = "ttweb"
                };

                await context.AddAsync(advertisingCompany);


                await context.SaveChangesAsync();
            }
        }
示例#11
0
        public async Task <IEnumerable <Contact> > FindDomainContacts(string DomainName)
        {
            Company company = await db.Companies.FindAsync(_tempService.GetSelectedId());

            List <Contact>    contacts    = new List <Contact>();
            List <ContactDTO> AllContacts = _tempService.Contacts.ToList();

            using HttpClient Http = new HttpClient();
            var response = await Http.GetAsync("https://api.hunter.io/v2/domain-search?domain=" + DomainName + "&api_key=" + API_SECRET_KEY);

            HunterResponseDTO FoundContacts = new HunterResponseDTO();

            if (response.IsSuccessStatusCode)
            {
                var result = response.Content.ReadAsStringAsync().Result;
                FoundContacts = JsonSerializer.Deserialize <HunterResponseDTO>(result);
            }
            foreach (var contact in FoundContacts.data.emails)
            {
                Linkedin linkedin;
                if (contact.linkedin != null && contact.linkedin != "null")
                {
                    linkedin = new Linkedin
                    {
                        FullLink = contact.linkedin
                    };
                    await db.Linkedins.AddAsync(linkedin);

                    Contact newContact = new Contact
                    {
                        Email     = contact.value,
                        FirstName = contact.first_name,
                        Linkedin  = linkedin,
                        Surname   = contact.last_name,
                        Position  = contact.position
                    };
                    if (AllContacts.Where(p => p.Email == contact.value) == null)
                    {
                        await db.Contacts.AddAsync(newContact);

                        CompanyContactLink companyContactLink = new CompanyContactLink
                        {
                            Company = company,
                            Contact = newContact
                        };
                        await db.CompanyContactLinks.AddAsync(companyContactLink);

                        await db.SaveChangesAsync();

                        contacts.Add(newContact);
                    }
                }
                else
                {
                    Contact newContact = new Contact
                    {
                        Email     = contact.value,
                        FirstName = contact.first_name,
                        Surname   = contact.last_name,
                        Position  = contact.position
                    };
                    if (AllContacts.Where(p => p.Email == contact.value).FirstOrDefault() == null)
                    {
                        await db.Contacts.AddAsync(newContact);

                        CompanyContactLink companyContactLink = new CompanyContactLink
                        {
                            Company = company,
                            Contact = newContact
                        };
                        await db.CompanyContactLinks.AddAsync(companyContactLink);

                        await db.SaveChangesAsync();

                        contacts.Add(newContact);
                    }
                }
            }
            return(contacts);
        }