示例#1
0
        public async Task <IActionResult> UpdateCompanyAndHeadquarter([FromBody] CompanyHeadquarterModel model)
        {
            manager.UpdateCompanyAndHeadquarter(model);

            var companies = manager.GetCompanies();

            return(Ok(companies));
        }
示例#2
0
        public void UpdateCompanyAndHeadquarter(CompanyHeadquarterModel model)
        {
            var company     = GetCompanyById(model.Id);
            var headquarter = GetHeadquarterById(company.HeadquarterId);

            company.Name = model.Name;

            headquarter.Country = model.Country;
            headquarter.City    = model.City;
            headquarter.Street  = model.Street;

            db.Companies.Update(company);
            db.Headquarters.Update(headquarter);

            db.SaveChanges();
        }
示例#3
0
 public void UpdateCompanyAndHeadquarter(CompanyHeadquarterModel model)
 {
     repository.UpdateCompanyAndHeadquarter(model);
 }