private void SetGlobalValues(IEnumerable<Company> company) { Company company1; if (company.ToList().Count>0) { company1 = company.ToList().FirstOrDefault(); } else { company1 = new Company(); } if (GlobalSetup.Company == null) { GlobalSetup.Company = company1; } }
public ActionResult Create(Company company) { try { if (ModelState.IsValid) { CompanyService.Add(company); return RedirectToAction("Index"); } return View(company); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); return View(company); } }
public void SetGlobalSetup() { var company = new Company(); var company1 = companyService.GetAll().FirstOrDefault(); GlobalSetup.Company = company; }
public void SetGlobalSetup() { var company = new Company(); var company1 = CompanyRepository.GetAll().FirstOrDefault(); GlobalSetup.Company = company; }
public Company Update(Company entity) { return repository.Update(entity); }
public void Delete(Company entity) { repository.Delete(entity); }
public Company Add(Company entity) { entity = repository.Add(entity); unitOfWork.Commit(); return entity; }