Exemple #1
0
        private void PopulateFields()
        {
            DataTable dt                   = patient.GetPatient(patientID);
            DataRow   row                  = dt.Rows[0];
            String    firstName            = row["fname"].ToString();
            String    lastName             = row["lname"].ToString();
            String    dob                  = row["dob"].ToString();
            String    address              = row["address"].ToString();
            String    bloodType            = row["blood_type"].ToString();
            String    allergies            = row["allergies"].ToString();
            String    contactOne           = row["contact_one"].ToString();
            String    contactTwo           = row["contact_two"].ToString();
            String    emergencyContact     = row["emergency_contact"].ToString();
            String    sex                  = row["sex"].ToString();
            String    numberOfAppointments = row["No.of Appointments"].ToString();

            textBoxFname.Text            = firstName;
            textBoxLname.Text            = lastName;
            patientDOBPicker.Value       = Convert.ToDateTime(dob);
            textBoxAddress.Text          = address;
            textBoxBloodType.Text        = bloodType;
            textBoxAllergies.Text        = allergies;
            textBoxContactOne.Text       = contactOne;
            textBoxContactTwo.Text       = contactTwo;
            textBoxEmergencyContact.Text = emergencyContact;
        }
        private void PopulateDataGridView(int ID)
        {
            DataTable dt                   = patient.GetPatient(ID);
            DataRow   row                  = dt.Rows[0];
            String    firstName            = row["fname"].ToString();
            String    lastName             = row["lname"].ToString();
            String    dob                  = row["dob"].ToString();
            String    address              = row["address"].ToString();
            String    bloodType            = row["blood_type"].ToString();
            String    allergies            = row["allergies"].ToString();
            String    contactOne           = row["contact_one"].ToString();
            String    contactTwo           = row["contact_two"].ToString();
            String    emergencyContact     = row["emergency_contact"].ToString();
            String    sex                  = row["sex"].ToString();
            String    numberOfAppointments = row["No.of Appointments"].ToString();

            labelName.Text             = firstName + " " + lastName;
            labelAddress.Text          = address;
            labelDOB.Text              = dob;
            labelAllergies.Text        = allergies;
            labelBloodType.Text        = bloodType;
            labelSex.Text              = sex;
            labelContactOne.Text       = contactOne;
            labelContactTwo.Text       = contactTwo;
            labelEmergencyContact.Text = emergencyContact;
            labelNoAppointments.Text   = numberOfAppointments;
        }