private void AddOrUpdate(StudentDetail item) { var saveItem = _id == "" ? _repo.AddStudent(item) : _repo.UpdateStudent(item); if (saveItem == string.Empty) { Base.ShowSuccess("Success", "Student saved successfully"); this.Close(); } else { Base.ShowError("Failed", saveItem); } }
public ActionResult Create(Student std) { try { if (ModelState.IsValid) { StudentRepo repo = new StudentRepo(); repo.AddStudent(std); } return(RedirectToAction("Index")); } catch { return(View()); } }