Esempio n. 1
0
        public PatientStatusDTO UpdatePatientStatus(PatientStatusUpdateDTO info)
        {
            StoreContext db = new StoreContext();

            PatientStatus patientStatus = db.PatientStatus.Where(a => a.Id == Helper.DecryptInt(info.Id)).FirstOrDefault();

            if (patientStatus != null)
            {
                patientStatus.Name     = info.Name;
                patientStatus.IsActive = info.IsActive;

                db.SaveChanges();

                PatientStatusDTO response = mapper.Map <PatientStatusDTO>(patientStatus);

                return(response);
            }

            else
            {
                return(null);
            }
        }
        public IActionResult UpdatePatientStatus([FromBody] PatientStatusUpdateDTO info)
        {
            PatientStatusDTO response = repository.UpdatePatientStatus(info);

            return(new ObjectResult(response));
        }