コード例 #1
0
        public static int AddPatient(Patient p)
        {
            List <Patient> Patients = SELECTPatient();
            string         path     = AppDomain.CurrentDomain.BaseDirectory + "Hospital/Patients.txt";

            using (StreamWriter sw = File.AppendText(path))
            {
                Patient s = new Patient();
                s.idPatient     = p.idPatient;
                s.namePatient   = p.namePatient;
                s.dateBirth     = DateTime.Parse(p.dateBirth).ToShortDateString();
                s.dateResived   = DateTime.Parse(p.dateResived).ToShortDateString();
                s.describe      = p.describe;
                s.codeCity      = p.codeCity;
                s.codeRoom      = p.codeRoom;
                s.codeDiagnosis = p.codeDiagnosis;
                sw.WriteLine(s.ToString());
            }
            return(1);
        }