/// <summary>
        /// Fetch a patient's information
        /// </summary>
        /// <param name="patientid"></param>
        /// <param name="category"></param>
        public void loadPatientInfo(int patientid, string category)
        {
            profile newPage = new profile(parent, this, patientid, category);

            pageTransitionControl.TransitionType = PageTransitionType.SlideAndFade;
            pageTransitionControl.ShowPage(newPage);
        }
        /// <summary>
        /// Get information of patient
        /// </summary>
        /// <param name="root"></param>
        /// <param name="sub"></param>
        /// <param name="id"></param>
        /// <param name="operation"></param>
        public recordWindow(MainWindow root, profile sub, int id, string operation)
        {
            parent    = root;
            subparent = sub;
            _id       = id;
            operate   = operation;
            InitializeComponent();
            if (operation.Equals("new"))
            {
                DataTable qry = root.query("select  (select concat(lastname,' ',firstname) as patient from patient where patientid=" + id + "),(select concat(lastname,' ',firstname) from doctor where doctorid=" + subparent.subparent.DoctorId + "),(select photoblob from photo where id=(select login_user_id from patient where patientid=" + id + " ) ) as photo");
                if (qry.Rows.Count > 0)
                {
                    DataRow rw = qry.Rows[0];
                    patientName.Content = rw[0];
                    doctorLabel.Content = "Doctor: " + rw[1];
                    doc_name            = rw[1].ToString();
                    dateLabel.Content   = "Date: " + DateTime.Now.ToLongDateString();
                    profilePix.Source   = parent.getImg((byte[])rw["photo"]);
                }
            }


            if (operation.Equals("update"))
            {
                DataTable qry = root.query("select patientid,comment,date_added, (select concat(lastname,' ',firstname) as patient from patient where patientid=record.patientid) as patient,(select concat(lastname,' ',firstname) from doctor where doctorid=record.doctorid) as doctor,(select photoblob from photo where id=(select login_user_id from patient where patientid=record.patientid ) ) as photo from record where recordid=" + id);
                if (qry.Rows.Count > 0)
                {
                    DataRow rw = qry.Rows[0];
                    patientName.Content = rw["patient"];
                    doctorLabel.Content = "Doctor: " + rw["doctor"];
                    doc_name            = rw["doctor"].ToString();
                    dateLabel.Content   = "Date: " + DateTime.Parse(rw["date_added"].ToString()).ToLongDateString();
                    profilePix.Source   = parent.getImg((byte[])rw["photo"]);
                    update_patient_id   = int.Parse(rw["patientid"].ToString());
                    commentBox.AppendText(rw["comment"].ToString());
                }


                qry = root.query("select details from result where recordid=" + id);

                foreach (DataRow rw in qry.Rows)
                {
                    resultList.Items.Add(rw["details"].ToString());
                }


                qry = root.query("select details from prescription where recordid=" + id);

                foreach (DataRow rw in qry.Rows)
                {
                    presList.Items.Add(rw["details"].ToString());
                }
            }
        }