Beispiel #1
0
        public bool Remove(long id)
        {
            var userForDelete = _hcestablishmentsRepository.Get(id);

            if (userForDelete == null)
            {
                return(false);
            }

            _hcestablishmentsRepository.Remove(userForDelete);

            return(true);
        }
Beispiel #2
0
        public IActionResult AddWorker(HCWorkerViewModel newWorker)
        {
            var model    = _mapper.Map <HCWorker>(newWorker);
            var citizen  = _citizenRepository.Get(newWorker.CitizenId);
            var facility = _hcestablishmentsRepository.Get(newWorker.FacilityId);

            model.CitizenId    = citizen.Id;
            model.Name         = citizen.Name;
            model.FacilityId   = facility.Id;
            model.FacilityName = facility.Name;

            _hcworkerRepository.Save(model);

            return(RedirectToAction("Index"));
        }