public ActionResult DeleteStudent(Student student) { string errorStatus = _student.DeleteStudent(student); Message message = new Message(errorStatus); return(Ok(message.ErrorMessage(student.StudentId))); }
public async Task <ActionResult> DeleteStudent(int id) { var deletedStudent = student.DeleteStudent(id); if (deletedStudent is null) { return(BadRequest()); } return(NoContent()); }
public IActionResult DeleteStudent(int Id) { if (Id < 0) { return(BadRequest()); } _studentRepo.DeleteStudent(Id); return(Ok()); }
public ActionResult Delete(StudentDto studentDto) { if (studentDto.Id != null && studentDto.Id > 0) { return(Json(_student.DeleteStudent(studentDto))); } else { return(BadRequest("کد یکتای مربوط به جدول دانش آموز صحیح نیست")); } }
public IActionResult Delete(int id) { try { studentrepository.DeleteStudent(id); return(StatusCode(StatusCodes.Status200OK, "Record Deleted successfully.")); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
private async Task DeleteStudents(StudentTableViewModel student) { var a = ""; if (await _pageService.DisplayAlert("Warning", $"Are you sure you want to delete{student.StudentID}?", "Yes", "No")) { Students.Remove(student); var userStudent = await _studentStore.GetStudents(student.Id); await _studentStore.DeleteStudent(userStudent); } }
public IActionResult DeleteStudentRecord(int id) { var record = repo.GetById(id); if (record == null) { return(BadRequest("Record Not Found!")); } var response = repo.DeleteStudent(record); return(Ok(response)); }
public IActionResult DeleteStudent(int sid) { var studentObj = _student.GetStudent(sid); if (!_student.DeleteStudent(sid)) { ModelState.AddModelError("", $"Something went wrong when saving the record{studentObj.Name}"); return(StatusCode(500, ModelState)); } return(NoContent()); }
public IActionResult DeleteStudent(string Id) { try { var result = _student.DeleteStudent(Id); return(Ok(result)); } catch (Exception ex) { throw ex; } }
// GET: StudentController/Delete/5 public ActionResult Delete(int id) { try { _istudent.DeleteStudent(id); TempData["Message"] = "Student was deleted successfully"; return(RedirectToAction(nameof(Index))); } catch (Exception e) { TempData["MessageError"] = e.Message.ToString(); return(RedirectToAction(nameof(Index))); } }
public async Task <IActionResult> Delete() { if (!string.IsNullOrEmpty(RouteData.Values["id"].ToString())) { var id = int.Parse(RouteData.Values["id"].ToString()); var student = new DAL.Student { STUDENTID = id }; await _student.DeleteStudent(student); await AddLog(id + " numaralı öğrenci silindi."); } return(RedirectToAction("Index")); }
public HttpResponseMessage Delete(int id) { try { _student.DeleteStudent(id); var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.OK }; return(response); } catch (Exception) { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.InternalServerError }; return(response); } }
public JsonResult Delete(string id) { return(Json(_student.DeleteStudent(Convert.ToInt32(id)), JsonRequestBehavior.AllowGet)); }
public void Delete(int id) { objStudent.DeleteStudent(id); }
public IActionResult DeleteStudent(int id) { _stud.DeleteStudent(id); return(RedirectToAction("Index")); }
/// <summary> /// 通过Sql语句删除一个学生信息 /// </summary> /// <param name="stuId"></param> /// <returns></returns> public int DeleteStudent(string stuId) { return(studentDAL.DeleteStudent(stuId)); }