public JsonResult SaveCompany(Company company) { if (company != null) { if (company.Id.Equals(Guid.Empty)) { company.Id = Guid.NewGuid(); companyService.Add(company); return Json(true); } else { companyService.Update(company); return Json(true); } } return Json(false); }
public Company Update(Company company) { companyRepository.Update(company); return company; }
public Company Add(Company company) { companyRepository.Add(company); return company; }