コード例 #1
0
 // GET: Student/Delete/5
 public ActionResult Delete(int id)
 {
     try
     {
         if (repository.DeleteDoctor(id))
         {
             ViewBag.AlertMsg = "Doctor Deleted Successfully";
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #2
0
        public async Task <IActionResult> DeleteConfirmed(int?Id)
        {
            //var user = HttpContext.Session.GetString("UserName");
            //if (string.IsNullOrEmpty(user))
            //{
            //    return RedirectToAction("AccesoDenegado", "Home");
            //}

            if (Id == null)
            {
                return(NotFound());
            }

            await _repository.DeleteDoctor(Id.Value);

            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public async Task <ActionResult> Delete(int id)
        {
            var doctor = await _repository.GetById(id);

            if (doctor == null)
            {
                return(NotFound());
            }

            var respose = await _repository.DeleteDoctor(id);

            if (respose)
            {
                return(NoContent());
            }
            else
            {
                return(StatusCode(500));
            }
        }
コード例 #4
0
 public bool DeleteDoctor(string jmbg)
 {
     return(doctorRepository.DeleteDoctor(jmbg));
 }
コード例 #5
0
 public void RemoveDoctor(Doctor oldDoctor) => _doctorsFile.DeleteDoctor(oldDoctor);
コード例 #6
0
ファイル: DoctorService.cs プロジェクト: retto710/ClinicPlus
        public void DeleteDoctor(int id)
        {
            IDoctorRepository repo = new DoctorRepository();

            repo.DeleteDoctor(id);
        }