public ActionResult DeletePersona(int id) { if (ModelState.IsValid) { PersonaDb emprep = new PersonaDb(connectionString); if (emprep.DeletePersona(id)) { ViewBag.Message = "Record Deleted Successfully"; } } return(RedirectToAction("Index")); }
public ActionResult ModificaPersona(int id, Persona p) { if (ModelState.IsValid) { PersonaDb db = new PersonaDb(connectionString); if (db.ModificaPersona(id, p)) { ViewBag.Message = "Operazione eseguita"; } } return(RedirectToAction("Index")); }
public ActionResult AddPersona(Persona p) { if (ModelState.IsValid) { PersonaDb db = new PersonaDb(connectionString); if (db.AddPersona(p)) { ViewBag.Message = "Record aggiunto con successo"; } } return(RedirectToAction("Index")); }
public ActionResult Modifica(int?id) { if (id == null || id == 0) { return(RedirectToAction("Index")); } PersonaDb db = new PersonaDb(connectionString); ModelState.Clear(); Persona p = db.GetDetails(id.GetValueOrDefault()); return(View(p)); }
public IActionResult Index(Persona p) { if (p == null) { p = new Persona(); } PersonaDb db = new PersonaDb(connectionString); ModelState.Clear(); p.list = db.GetAll(); return(View(p)); }
//________________________________________________________________________________________________________ public static List <PersonaDto> GetPersona() { return(PersonaDb.GetAll()); }
//________________________________________________________________________________________________________ public static void SavePersona(PersonaDto Persona) { PersonaDb.GrabarPersonas(ref Persona); }