protected void Button2_Click(object sender, EventArgs e)
        {
            String nameauto1 = nameauto.Text;
            String age1 = age.Text;
            String gender1 = gender.Text;
            String marital1 = marital.Text;
            String mainHealthIssue1 = mainHealthIssue.Text;
            String duration1 = duration.Text;
            String description1 = description.Text;
            String degree11 = degree1.Text;
            String degree21 = degree2.Text;
            String comments1 = comments.Text;
            String treatment1=treatment.Text;
            String problemsInThePast1=problemsInThePast.Text;
            String isTreatmentTaken1=isTreatmentTaken.Text;
            String majorIllness1 = majorIllness.Text;
            String chronicIssue1 = chronicIssue.Text;
            String allergies1 = allergies.Text;
            String familyMainComplaint1 = familyMainComplaint.Text;
            String familyChronic1 = familyChronic.Text;
            Boolean isImgPresent = FileUpload1.HasFile;

            PatientNaming pn=new PatientNaming();
            nameauto1 = pn.getUniqueName();

            //find out the first letter
            int j;
            for ( j = 0; j < nameauto1.Length; j++)
            {
                if (nameauto1[j] != '#' && nameauto1[j] != ' ')
                {
                    break;
                }

            }

            nameauto1=nameauto1.Substring(j);

            byte[] imgByte;

            if (isImgPresent)
            {
                imgByte = new byte[FileUpload1.PostedFile.InputStream.Length + 1];
                FileUpload1.PostedFile.InputStream.Read(imgByte, 0, imgByte.Length);
            }
            else
            {
                imgByte = null;// new byte[10];
            }

            Patient p = new Patient(nameauto1,
                                    age1,
                                    gender1,
                                    marital1,
                                    mainHealthIssue1,
                                    duration1,
                                    description1,
                                    degree11,
                                    degree21,
                                    comments1,
                                    treatment1,
                                    problemsInThePast1,
                                    isTreatmentTaken1,
                                    majorIllness1,
                                    chronicIssue1,
                                    allergies1,
                                    familyMainComplaint1,
                                    familyChronic1,
                                    imgByte,
                                    isImgPresent);

            TextBox1.Text= p.insertPatientData().ToString();

            Label1.Text = nameauto1;

            ShowNamePanel.Visible = true;
            FormQuestionsPanel.Visible = false;
            ImageUploadPanel.Visible = false;

            //insert into database
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            if (CheckBox1.Checked == false)
            {
                Label2DisclaimerError.Text = " Aren't you okay with the disclaimer?";
                return;
            }

            String nameauto1 = Session["username"].ToString();
            String age1 = age.Text;
            String gender1 = gender.Text;
            String marital1 = marital.Text;
            String mainHealthIssue1 = mainHealthIssue.Text;
            String duration1 = duration.Text;
            String description1 = description.Text;
            String degree11 = degree1.Text;
            String degree21 = degree2.Text;
            String comments1 = comments.Text;
            String treatment1=treatment.Text;
            String problemsInThePast1=problemsInThePast.Text;
            String isTreatmentTaken1=isTreatmentTaken.Text;
            String majorIllness1 = majorIllness.Text;
            String chronicIssue1 = chronicIssue.Text;
            String allergies1 = allergies.Text;
            String familyMainComplaint1 = familyMainComplaint.Text;
            String familyChronic1 = familyChronic.Text;
            Boolean isImgPresent = FileUpload1.HasFile;

            PatientNaming pn=new PatientNaming();

              /*
            nameauto1 = pn.getUniqueName();

            //find out the first letter
            int j;
            for ( j = 0; j < nameauto1.Length; j++)
            {
                if (nameauto1[j] != '#' && nameauto1[j] != ' ')
                {
                    break;
                }

            }

            nameauto1=nameauto1.Substring(j);
            */
            byte[] imgByte;

            if (isImgPresent)
            {
                imgByte = new byte[FileUpload1.PostedFile.InputStream.Length + 1];
                FileUpload1.PostedFile.InputStream.Read(imgByte, 0, imgByte.Length);
            }
            else
            {
                imgByte = null;// new byte[10];
            }

            Patient p = new Patient(nameauto1,
                                    age1,
                                    gender1,
                                    marital1,
                                    mainHealthIssue1,
                                    duration1,
                                    description1,
                                    degree11,
                                    degree21,
                                    comments1,
                                    treatment1,
                                    problemsInThePast1,
                                    isTreatmentTaken1,
                                    majorIllness1,
                                    chronicIssue1,
                                    allergies1,
                                    familyMainComplaint1,
                                    familyChronic1,
                                    imgByte,
                                    isImgPresent);

               p.insertPatientData().ToString();

               Response.Redirect("docInterface/showProblemsTable.aspx");

            //insert into database
        }