public async Task<IHttpActionResult> PutCompany(string id, Company company)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != company.id)
            {
                return BadRequest();
            }

            db.Entry(company).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CompanyExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Exemplo n.º 2
0
        //Populates the Company table
        private void PopulateCompany()
        {
            Company privat = new Company()
            {
                id = "privat",
                name = "Privatperson",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo =
                    "http://kompetansetorget.uia.no/extension/kompetansetorget/design/kompetansetorget/images/logo-virksomhet.jpg"
            };

            Company husbanken = new Company()
            {
                id = "husbanken",
                name = "Husbanken",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/extension/kompetansetorget/design/kompetansetorget/images/logo-virksomhet.jpg"
            };

            Company uia = new Company()
            {
                id = "uia",
                name = "Universitetet i Agder",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter-internt/universitetet-i-agder/18076-2-nor-NO/universitetet-i-agder_width-4.jpg"

            };
             

            Company travelbird = new Company()
            {
                id = "travelbird",
                name = "TravelBird",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/travelbird/151481-1-nor-NO/travelbird_width-4.jpg"

            };

            Company testbirds = new Company()
            {
                id = "testbirds",
                name = "Testbirds",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/testbirds/29460-2-nor-NO/testbirds_width-4.jpg"

            };

            Company testbirds2 = new Company()
            {
                id = "testbirds2",
                name = "Testbirds",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/testbirds/29460-2-nor-NO/testbirds_width-4.jpg"

            };

            Company cuponation = new Company()
            {
                id = "cuponation",
                name = "Cuponation",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/cuponation-gmbh/157932-2-nor-NO/cuponation-gmbh_width-4.png"

            };

            Company beconnected = new Company()
            {
                id = "beconnected",
                name = "BeConnected",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/beconnected/156649-1-nor-NO/beconnected_width-4.png"

            };

            Company mentornorge = new Company()
            {
                id = "mentornorge",
                name = "MentorNorge AS",
                adress = "",
                url = "www.mentornorge.no",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/mentornorge-as/13005-1-nor-NO/mentornorge-as_width-4.png"
            };

            Company archipelagos = new Company()
            {
                id = "archipelagos",
                name = "Archipelagos Institute",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/archipelagos-institute/83424-1-nor-NO/archipelagos-institute_width-4.png"
            };

            Company grimstadkommune = new Company()
            {
                id = "grimstadkommune",
                name = "Grimstad Kommune, Berge gård senter",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = ""
            };

            Company ikstart = new Company()
            {
                id = "ikstart",
                name = "IKStart",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/ik-start/47382-1-nor-NO/ik-start_width-4.gif"
            };

            Company accurateequity = new Company()
            {
                id = "accurateequity",
                name = "Accurate Equity - an Equatex Company",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/accurate-equity-an-equatex-company/35741-1-nor-NO/accurate-equity-an-equatex-company_width-4.jpg"
            };

            Company rabble = new Company()
            {
                id = "rabble",
                name = "Rabble",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "https://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/rabble/33218-2-nor-NO/rabble_width-4.png"
            };

            db.companies.Add(privat);
            db.companies.Add(husbanken);
            db.companies.Add(uia);
            db.companies.Add(archipelagos);
            db.companies.Add(beconnected);
            db.companies.Add(travelbird);
            db.companies.Add(testbirds);
            db.companies.Add(testbirds2);
            db.companies.Add(cuponation);
            db.companies.Add(mentornorge);
            db.companies.Add(grimstadkommune);
            db.companies.Add(ikstart);
            db.companies.Add(accurateequity);
            db.companies.Add(rabble);
            db.SaveChanges();

        }
Exemplo n.º 3
0
        public void ExtraData2()
        {
            Contact kirsti = new Contact()
            {
                id = 16,
                name = "Kirsti Lie",
                position = "",
                phone = "48264770",
                email = "*****@*****.**"
            };

            Company agderEnergi = new Company()
            {
                id = "agderEnergi",
                name = "Agder Energi",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/var/kompetansetorget/storage/images/virksomheter/agder-energi/10593-1-nor-NO/agder-energi_width-4.jpg"
            };

            db.contacts.Add(kirsti);
            db.companies.Add(agderEnergi);
            db.SaveChanges();

            Project strategi = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Fullstendig interaktiv 3D visualisering av Kraftstasjon (Tungefoss) med innlagte e-læringsressurser og dokumentasjon",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/utarbeiding-av-strategi-i-forbindelse-med-lansering-av-nytt-produkt",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 02, 08),
                published = new DateTime(2016, 02, 08),
                modified = new DateTime(2016, 02, 08),
                status = "Valgt"
            };

            StudyGroup data = db.studyGroup.First(x => x.id.Equals("datateknologi"));
            JobType virk = db.jobTypes.First(x => x.id.Equals("virksomhet"));
            Degree bach = db.degrees.First(x => x.id.Equals("bachelor"));
            Course dat303 = db.courses.First(x => x.id.Equals("DAT-303"));

            strategi.contacts.Add(kirsti);
            strategi.companies.Add(agderEnergi);
            strategi.jobTypes.Add(virk);
            strategi.studyGroups.Add(data);
            strategi.degrees.Add(bach);
            strategi.courses.Add(dat303);
            db.SaveChanges();
        }
Exemplo n.º 4
0
        private void Extra()
        {
            Contact siri = new Contact()
            {
                id = 13,
                name = "Siri Håvås Haugland",
                position = "",
                phone = "",
                email = "*****@*****.**"
            };

            db.contacts.Add(siri);
            db.SaveChanges();

            Project informasjonsmateriell = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Utvikle informasjonsmateriell/pakke til forskningsseminar",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/utvikle-informasjonsmateriell-pakke-til-forskningsseminar",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 04, 15),
                published = new DateTime(2016, 04, 15),
                modified = new DateTime(2016, 04, 15),
                status = "Ledig"
            };
            Company uia = db.companies.First(x => x.id.Equals("uia"));
            JobType fagl = db.jobTypes.First(x => x.id.Equals("faglærer"));
            informasjonsmateriell.contacts.Add(siri);
            informasjonsmateriell.companies.Add(uia);
            informasjonsmateriell.jobTypes.Add(fagl);

            db.projects.Add(informasjonsmateriell);
            db.SaveChanges();

            Contact yngvar = new Contact()
            {
                id = 14,
                name = "Yngvar Asbjørn Olsen",
                position = "",
                phone = "",
                email = "*****@*****.**"
            };

            db.contacts.Add(yngvar);
            db.SaveChanges();

            Project gyrodactylus = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Utvikling av en metode for farging av Gyrodactylus spp in vitro",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/utvikling-av-en-metode-for-farging-av-gyrodactylus-spp-in-vitro",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 04, 16, 1, 1, 2),
                published = new DateTime(2016, 04, 16, 1, 1, 2),
                modified = new DateTime(2016, 04, 16, 1, 1, 2),
                status = "Ledig"
            };

            StudyGroup realfag = db.studyGroup.First(x => x.id.Equals("realfag"));
            Course bio300 = db.courses.First(x => x.id.Equals("BIO-300"));

            gyrodactylus.contacts.Add(yngvar);
            gyrodactylus.companies.Add(uia);
            gyrodactylus.jobTypes.Add(fagl);
            gyrodactylus.studyGroups.Add(realfag);
            gyrodactylus.courses.Add(bio300);

            db.projects.Add(gyrodactylus);
            db.SaveChanges();


            Contact erlend = new Contact()
            {
                id = 15,
                name = "Erlend Wangsteen",
                position = "",
                phone = "41009164",
                email = "*****@*****.**"
            };

            Company abnc = new Company()
            {
                id = "abnc",
                name = "abnc",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/extension/kompetansetorget/design/kompetansetorget/images/logo-virksomhet.jpg"
            };

            db.contacts.Add(erlend);
            db.companies.Add(abnc);
            db.SaveChanges();
            Project strategi = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Utarbeiding av strategi i forbindelse med lansering av nytt produkt.",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/utarbeiding-av-strategi-i-forbindelse-med-lansering-av-nytt-produkt",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 02, 16),
                published = new DateTime(2016, 02, 16),
                modified = new DateTime(2016, 02, 16),
                status = "Ledig"
            };

            StudyGroup admin = db.studyGroup.First(x => x.id.Equals("administrasjon"));
            JobType virk = db.jobTypes.First(x => x.id.Equals("virksomhet"));

            strategi.contacts.Add(erlend);
            strategi.companies.Add(abnc);
            strategi.jobTypes.Add(virk);
            strategi.studyGroups.Add(admin);

            db.projects.Add(strategi);
            db.SaveChanges();

            Project demohandelsplattform = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Konstruksjon av demo-handelsplattform",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/konstruksjon-av-demo-handelsplattform",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 02, 18),
                published = new DateTime(2016, 02, 18),
                modified = new DateTime(2016, 02, 18),
                status = "Ledig"
            };

            StudyGroup datateknologi = db.studyGroup.First(x => x.id.Equals("datateknologi"));
            demohandelsplattform.contacts.Add(erlend);
            demohandelsplattform.companies.Add(abnc);
            demohandelsplattform.jobTypes.Add(virk);
            demohandelsplattform.studyGroups.Add(datateknologi);

            db.projects.Add(demohandelsplattform);
            db.SaveChanges();

            Project handelsplattform = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Utarbeiding av derivater for internett-handelsplattform",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/utarbeiding-av-derivater-for-internett-handelsplattform",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 02, 16, 1, 1, 1),
                published = new DateTime(2016, 02, 16, 1, 1, 1),
                modified = new DateTime(2016, 02, 16, 1, 1, 1),
                status = "Ledig"
            };

            StudyGroup oko = db.studyGroup.First(x => x.id.Equals("økonomi"));
            handelsplattform.contacts.Add(erlend);
            handelsplattform.companies.Add(abnc);
            handelsplattform.jobTypes.Add(virk);
            handelsplattform.studyGroups.Add(oko);

            db.projects.Add(handelsplattform);
            db.SaveChanges();
        }
Exemplo n.º 5
0
        private void temp()
        {
            Company etterIsoleringAgder = new Company()
            {
                id = "etterIsoleringAgder",
                name = "Etterisolering Agder AS",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/extension/kompetansetorget/design/kompetansetorget/images/logo-virksomhet.jpg"
            };

            Contact bjorn = new Contact()
            {
                id = 11,
                name = "Bjørn Ingebretsen",
                position = "styreleder",
                phone = "91564082",
                email = "*****@*****.**"

            };

            db.companies.Add(etterIsoleringAgder);
            db.contacts.Add(bjorn);
            db.SaveChanges();

            Project isolasjon = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Blåse isolasjon bak diffusjonsperre",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/blaase-isolasjon-bak-diffusjonsperre",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 05, 23),
                published = new DateTime(2016, 05, 23),
                modified = new DateTime(2016, 05, 23),
                status = "Ledig"
            };
            //Contact contact6 = db.contacts.First(x => x.id == 6);
            //Company uia = db.companies.First(x => x.id.Equals("uia"));
            //Degree bachelor = db.degrees.First(x => x.id.Equals("bachelor"));
            //StudyGroup realfag = db.studyGroup.First(x => x.id.Equals("realfag"));
            JobType virks = db.jobTypes.First(x => x.id.Equals("virksomhet"));
     
            isolasjon.contacts.Add(bjorn);
            isolasjon.companies.Add(etterIsoleringAgder);
            isolasjon.jobTypes.Add(virks);
            //pro1.studyGroups.Add(realfag);

            //pro1.degrees.Add(bachelor);
            //pro1.jobTypes.Add(fagl);


            db.projects.Add(isolasjon);
            db.SaveChanges();


            Company fia = new Company()
            {
                id = "fia",
                name = "Farm in Action",
                adress = "",
                url = "",
                facebook = "",
                linkedIn = "",
                description = "",
                logo = "http://kompetansetorget.uia.no/extension/kompetansetorget/design/kompetansetorget/images/logo-virksomhet.jpg"
            };

            Contact magnus = new Contact()
            {
                id = 12,
                name = "Magnus Gellein",
                position = "Faglig ansvarlig",
                phone = "94139095",
                email = "*****@*****.**"

            };

            db.companies.Add(fia);
            db.contacts.Add(magnus);
            db.SaveChanges();

            Project rusrehab = new Project()
            {
                uuid = Guid.NewGuid().ToString(),
                title = "Rusrehabilitering i InnPåTunet tiltak, med faglig oppfølgning inkludert.",
                description = "",
                webpage = "http://kompetansetorget.uia.no/oppgaver/rusrehabilitering-i-innpaatunet-tiltak-med-faglig-oppfoelgning-inkludert",
                linkedInProfile = "",
                stepsToApply = "",
                tutor = "",
                created = new DateTime(2016, 04, 16),
                published = new DateTime(2016, 04, 16),
                modified = new DateTime(2016, 04, 16),
                status = "Ledig"
            };

            Degree master = db.degrees.First(x => x.id.Equals("master"));
            StudyGroup helse = db.studyGroup.First(x => x.id.Equals("helse"));
            Course me504 = db.courses.First(x => x.id.Equals("ME-504"));


            rusrehab.contacts.Add(magnus);
            rusrehab.companies.Add(fia);
            rusrehab.jobTypes.Add(virks);
            rusrehab.degrees.Add(master);
            rusrehab.studyGroups.Add(helse);
            rusrehab.courses.Add(me504);


            //pro1.studyGroups.Add(realfag);

            //pro1.degrees.Add(bachelor);
            //pro1.jobTypes.Add(fagl);


            db.projects.Add(rusrehab);
            db.SaveChanges();
        }
        public async Task<IHttpActionResult> PostCompany(Company company)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.companies.Add(company);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (CompanyExists(company.id))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = company.id }, company);
        }