Exemplo n.º 1
0
        public void Update(patient patientUpdated)
        {
            patient patientFromDb = _clinicEntities.patients.Find(patientUpdated.id);

            if (patientFromDb != null)
            {
                _clinicEntities.Entry(patientFromDb).CurrentValues.SetValues(patientUpdated);
                Save();
            }
        }
Exemplo n.º 2
0
        public void Update(clinic_service serviceChanged)
        {
            int indexToReplace = (_serviceList).FindIndex(m => m.id == serviceChanged.id);

            _serviceList[indexToReplace] = serviceChanged;//replace this way for refresh list immediately

            var serviceFromDb = _clinicEntities.clinic_service.Find(serviceChanged.id);

            if (serviceFromDb != null)
            {
                _clinicEntities.Entry(serviceFromDb).CurrentValues.SetValues(serviceChanged);
                Save();
            }
        }
Exemplo n.º 3
0
        public void Update(medicine medicineChanged)
        {
            int indexToReplace = (_medicineList).FindIndex(m => m.id == medicineChanged.id);

            _medicineList[indexToReplace] = medicineChanged;//replace this way for refresh list immediately

            var medicineFromDb = _clinicEntities.medicines.Find(medicineChanged.id);

            if (medicineFromDb != null)
            {
                medicineChanged.entry_day             = medicineFromDb.entry_day;
                medicineChanged.quantity_in_sale_unit = medicineFromDb.quantity_in_sale_unit;
                _clinicEntities.Entry(medicineFromDb).CurrentValues.SetValues(medicineChanged);
                Save();
            }
        }