コード例 #1
0
 public void deleteContact(string firstName)
 {
     if (!contactRepo.GetPersonByName(firstName))
     {
         Console.WriteLine("Person  Not Exist");
     }
     else
     {
         contactRepo.DeleteContact(firstName);
     }
 }
コード例 #2
0
        public ActionResult DeleteContact([FromQuery] string Dni)
        {
            //Check if patient exists
            var patientFromRepo = _repository.ExistContactedPerson(Dni);

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

            _repository.DeleteContact(patientFromRepo);
            _repository.SaveChanges();

            return(NoContent());
        }
コード例 #3
0
 public ActionResult DeleteContact(int id)
 {
     try
     {
         ContactRepo ContactRepoObj = new ContactRepo();
         if (ContactRepoObj.DeleteContact(id))
         {
             ViewBag.AlertMsg = "Employee details deleted successfully";
         }
         return(RedirectToAction("GetAllContactDetails"));
     }
     catch
     {
         return(RedirectToAction("GetAllContactDetails"));
     }
 }
コード例 #4
0
 public ActionResult DeleteMessage(int id)
 {
     cp.DeleteContact(id);
     return(RedirectToAction("ShowMessage"));
 }