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