コード例 #1
0
        public static Doctores GetDoctorById(int doctor_id)
        {
            if (doctor_id <= 0)
            {
                throw new ArgumentException("El id del Doctor no puede ser menor o igual que cero");
            }
            DoctordbTableAdapters.DoctorTableAdapter adapter = new DoctordbTableAdapters.DoctorTableAdapter();
            Doctordb.DoctorDataTable table = adapter.GetDataBy3(doctor_id);
            Doctores obj = GetDoctorFromRow(table[0]);

            return(obj);
        }
コード例 #2
0
        public static List <Doctores> GetDoctor()
        {
            DoctordbTableAdapters.DoctorTableAdapter adapter = new DoctordbTableAdapters.DoctorTableAdapter();
            Doctordb.DoctorDataTable table = adapter.GetDoctor();
            List <Doctores>          list  = new List <Doctores>();

            foreach (var row in table)
            {
                Doctores obj = GetDoctorFromRow(row);
                list.Add(obj);
            }
            return(list);
        }