public JsonResult Add(StudentEntity entity = null) { if (entity == null) { throw new ArgumentNullException(); } return(Json(_studentBusiness.Add(entity))); }
public ActionResult Create(Student student) { try { // TODO: Add insert logic here StudentBusiness.Add(student); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(Student model) { try { // TODO: Add insert logic here char c = model.FirstName.FirstOrDefault(); model.Alias = c + model.LastName; StudentBusiness.Add(model); return(RedirectToAction("Index")); } catch { return(View()); } }
public Student Add(Student student) { try { var bc = new StudentBusiness(); return(bc.Add(student)); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Create(Student student) { var studentBussines = new StudentBusiness(); studentBussines.Add(student); }