Ejemplo n.º 1
0
        public bool UpdatePatient(tb_patient _patient)
        {
            using (ModelEntities database = new ModelEntities())
            {
                tb_patient patient = database.tb_patient.SingleOrDefault(p => p.PatientID == _patient.PatientID);
                patient.FullName = _patient.FullName;
                patient.Birthday = _patient.Birthday;
                patient.Address = _patient.Address;
                patient.Gender = _patient.Gender;
                patient.MobilePhone = _patient.MobilePhone;
                patient.Email = _patient.Email;
                patient.ProfessionID = _patient.tb_profession.ProfessionID;
                patient.Marital = _patient.Marital;
                patient.Note = _patient.Note;

                database.SaveChanges();
                return true;
            }
        }
Ejemplo n.º 2
0
 public bool RemovePatient(string patientID)
 {
     using (ModelEntities database = new ModelEntities())
     {
         tb_patient patient = database.tb_patient.SingleOrDefault(p => p.PatientID == patientID);
         database.tb_patient.Remove(patient);
         database.SaveChanges();
         return true;
     }
 }