示例#1
0
        public Model.Doctor.Examination NewExamination(Model.Doctor.Examination examination)
        {
            List <Examination> canceledExaminations = ReadFromFile();
            Examination        searchExamination    = GetExaminationById(examination.IdExamination);

            if (searchExamination != null)
            {
                return(null);
            }
            canceledExaminations.Add(examination);
            WriteInFile(canceledExaminations);
            return(examination);
        }
示例#2
0
        public Model.Doctor.Examination SetExamination(Model.Doctor.Examination examination)
        {
            List <Examination> scheduledExaminations = ReadFromFile();

            foreach (Examination e in scheduledExaminations)
            {
                if (e.IdExamination == examination.IdExamination)
                {
                    e.Type        = examination.Type;
                    e.DateAndTime = examination.DateAndTime;
                    e.doctor      = examination.doctor;
                    e.room        = examination.room;
                    e.patientCard = examination.patientCard;
                    break;
                }
            }
            WriteInFile(scheduledExaminations);
            return(examination);
        }