public JsonResult DeleteStudant(Studant studant) { if (studant == null) { return(Json(new { Message = "Erro", HasError = true }, JsonRequestBehavior.AllowGet)); } var dao = new StudantDAO(); var message = dao.deleteStudant(studant); return(Json(new { Message = message }, JsonRequestBehavior.AllowGet)); }
public JsonResult ListStudant(Studant studant) { if (studant == null) { return(Json(new { Message = "Error", HasError = true }, JsonRequestBehavior.AllowGet)); } var dao = new StudantDAO(); var List = dao.ListStudant(); if (!List.Any()) { return(Json(new { Message = "No entry found" }, JsonRequestBehavior.AllowGet)); } return(Json(List, JsonRequestBehavior.AllowGet)); }