public void EditCompany(int id, Company company)
 {
     var companyToEdit = GetCompany(id);
     if (companyToEdit == null) return;
     companyToEdit.Name = company.Name;
     _db.SaveChanges();
 }
 public ActionResult Create(Company company)
 {
     try
     {
         _companyHandler.AddCompany(company);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(company);
     }
 }
Exemple #3
0
 public void EditCompany(int id, Company company)
 {
     _companyRepository.EditCompany(id, company);
 }
 public void AddCompany(Company company)
 {
     _db.Company.Add(company);
     _db.SaveChanges();
 }
Exemple #5
0
 public void AddCompany(Company company)
 {
     _companyRepository.AddCompany(company);
 }