示例#1
0
        public async Task <ActionResult> Get(string id)
        {
            if (id == null)
            {
                throw new NullReferenceException("doctor not found");
            }
            if (!_context.Doctors.Any())
            {
                throw new NullReferenceException("doctor not found");
            }
            var doctor = await _doctorService.Get(id);

            return(Ok(doctor));
        }
        private void button2_Click(object sender, EventArgs e)
        {
            DoctorService doctorService = new DoctorService();
            Doctor        temp          = new Doctor();

            temp.Phone = textBox1.Text;
            Doctor doctor = new Doctor();

            doctor = doctorService.Get(temp);
            if (doctor == null)
            {
                MessageBox.Show("Not Found !");
            }
            else
            {
                textBox2.Text = doctor.Name;
                textBox6.Text = doctor.Gender;
                textBox3.Text = doctor.Address;
                textBox7.Text = doctor.Phone;
                textBox5.Text = doctor.Salary.ToString();
            }
        }
示例#3
0
 public List <DoctorModel> GetAll() =>
 service.Get();
示例#4
0
 public Doctor Get(int id)
 {
     return(_doctorService.Get(id));
 }