public IActionResult EditFacility(DropOffFacility dropOffFacility)
 {
     if (ModelState.IsValid)
     {
         dropOffFacilityRepository.UpdateAct(dropOffFacility);
         dropOffFacilityRepository.CommitChanges();
         return(RedirectToAction("ViewFacilities", "AdminUser"));
     }
     else
     {
         return(View(dropOffFacility));
     }
 }
        public IActionResult DeleteFacility(Guid FacilityId)
        {
            var             facility  = dropOffFacilityRepository.GetById(FacilityId);
            DropOffFacility facilityD = new DropOffFacility();

            facilityD.FacilityId   = facility.FacilityId;
            facilityD.PostalCode   = facility.PostalCode;
            facilityD.Street       = facility.Street;
            facilityD.City         = facility.City;
            facilityD.FacilityName = facility.FacilityName;
            facilityD.Hours        = facility.Hours;
            dropOffFacilityRepository.Delete(facilityD);
            return(RedirectToAction("ViewFacilities"));
        }
 public IActionResult AddFacility(DropOffFacility dropOffFacility)
 {
     if (ModelState.IsValid)
     {
         dropOffFacility.FacilityId = Guid.NewGuid();
         dropOffFacilityRepository.Insert(dropOffFacility);
         dropOffFacilityRepository.CommitChanges();
         return(RedirectToAction("ViewFacilities", "AdminUser"));
     }
     else
     {
         return(View(dropOffFacility));
     }
 }
 public IActionResult EditFacility(Guid FacilityId)
 {
     if (ModelState.IsValid)
     {
         DropOffFacility facilityD = new DropOffFacility();
         var             facility  = dropOffFacilityRepository.GetById(FacilityId);
         facilityD.FacilityId   = facility.FacilityId;
         facilityD.PostalCode   = facility.PostalCode;
         facilityD.Street       = facility.Street;
         facilityD.City         = facility.City;
         facilityD.FacilityName = facility.FacilityName;
         facilityD.Hours        = facility.Hours;
         return(View(facilityD));
     }
     else
     {
         ModelState.AddModelError("Error", "Facility could not be edited.");
         return(RedirectToAction("Error", "AdminUser"));
     }
 }