public ActionResult DeleteStudent(Student student)
        {
            string  errorStatus = _student.DeleteStudent(student);
            Message message     = new Message(errorStatus);

            return(Ok(message.ErrorMessage(student.StudentId)));
        }
예제 #2
0
        public async Task <ActionResult> DeleteStudent(int id)
        {
            var deletedStudent = student.DeleteStudent(id);

            if (deletedStudent is null)
            {
                return(BadRequest());
            }
            return(NoContent());
        }
예제 #3
0
        public IActionResult DeleteStudent(int Id)
        {
            if (Id < 0)
            {
                return(BadRequest());
            }

            _studentRepo.DeleteStudent(Id);

            return(Ok());
        }
예제 #4
0
 public ActionResult Delete(StudentDto studentDto)
 {
     if (studentDto.Id != null && studentDto.Id > 0)
     {
         return(Json(_student.DeleteStudent(studentDto)));
     }
     else
     {
         return(BadRequest("کد یکتای مربوط به جدول دانش آموز صحیح نیست"));
     }
 }
예제 #5
0
 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));
     }
 }
예제 #6
0
        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);
            }
        }
예제 #7
0
        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));
        }
예제 #8
0
        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());
        }
예제 #9
0
 public IActionResult DeleteStudent(string Id)
 {
     try
     {
         var result = _student.DeleteStudent(Id);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #10
0
 // 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)));
     }
 }
예제 #11
0
        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"));
        }
예제 #12
0
        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));
 }
예제 #14
0
 public void Delete(int id)
 {
     objStudent.DeleteStudent(id);
 }
예제 #15
0
 public IActionResult DeleteStudent(int id)
 {
     _stud.DeleteStudent(id);
     return(RedirectToAction("Index"));
 }
예제 #16
0
 /// <summary>
 /// 通过Sql语句删除一个学生信息
 /// </summary>
 /// <param name="stuId"></param>
 /// <returns></returns>
 public int DeleteStudent(string stuId)
 {
     return(studentDAL.DeleteStudent(stuId));
 }