public void ShowPInfo(Patient p)
    {
        if (p.PatientID<=0)
        {
            ClearPInfo();
            return;
        }
        if ((ThisUser.UserType!= User.U_Types.ADMIN)&&
                (!p.DoctorID.equals(ThisUser.UserID)))
        {
            tbxError.setText("You are not allowed to see this patient's information.");
            ClearPInfo();
            return;
        }
        lblPID.setText(PIDtoString(p.PatientID));
        tbxPFirstName.setText(p.FirstName);
        tbxPLastName.setText(p.LastName);
        cbxPGender.setSelectedIndex(p.Gender?0:1);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        String date = sdf.format(p.BirthDate);
        tbxPBirthDate.setText(date);
        
        String[] Addr = p.Address.split(";");
        
        if (Addr.length >=2)
        {
            tbxPAddress1.setText(Addr[0]);
            tbxPAddress2.setText(Addr[1]);
        }
        else
        {
            tbxPAddress1.setText(Addr[0]);
            tbxPAddress2.setText("");
        }
        
        tbxPZipcode.setText(p.Zipcode);
        tbxPPhone.setText(p.PhoneNumber);
        tbxPDoctorID.setText(p.DoctorID);  
        btnPCreate.setEnabled(false);
        btnPUpdate.setEnabled(true);
        btnPDelete.setEnabled(true);
    }