public ActionResult Create(CompanyAddressCategory companyaddresscategory) { if (ModelState.IsValid) { companyaddresscategoryRepository.InsertOrUpdate(companyaddresscategory); companyaddresscategoryRepository.Save(); return RedirectToAction("Index"); } else { return View(companyaddresscategory); } }
public void InsertOrUpdate(CompanyAddressCategory companyaddresscategory) { if (companyaddresscategory.CompanyAddressCategoryID == default(int)) { // New entity context.CompanyAddressCategory.Add(companyaddresscategory); } else { // Existing entity context.Entry(companyaddresscategory).State = EntityState.Modified; } }
public ActionResult Create() { CompanyAddressCategory companyaddresscategory = new CompanyAddressCategory(); return View(companyaddresscategory); }
public ViewResult Search(CompanyAddressCategory searchCompanyAddressCategory) { if(searchCompanyAddressCategory!=null) { } return View("Index",companyaddresscategoryRepository.All); }