public ActionResult Edit(empy e) { obj.Entry(e).State = EntityState.Modified; int o = obj.SaveChanges(); if (o > 0) { TempData["res"] = "Data Ubdated Succesfully"; return(RedirectToAction("index")); } else { TempData["res"] = "Error In Upadte"; } return(View()); }
public ActionResult Create(empy a) { obj.Objk.Add(a); int o = obj.SaveChanges(); if (o > 0) { TempData["rest"] = "Data Entered Succesfully"; return(RedirectToAction("index")); } else { TempData["rest"] = "Error In Data"; } return(View()); }