public List <PatientSurgery> getPatientSurgery(bool currentOnly)
 {
     if (currentOnly)
     {
         return(database.getPatientSurgery(patient).Where(ps => ps.End_Date.Equals(DateTime.Parse("12/31/9999"))).ToList());
     }
     else
     {
         return(database.getPatientSurgery(patient));
     }
 }
 private void DisplaySurgery()
 {
     dgvPatientProperties.Columns.Add("cName", "Name");
     dgvPatientProperties.Columns.Add("cDateReceived", "Date Received");
     patientSurgery = database.getPatientSurgery(patient);
     patientSurgery.ForEach(ps => dgvPatientProperties.Rows.Add(ps.Surgery.Name, ps.Date_Received.ToShortDateString()));
     btnViewDetails.Text = "View Surgery Details";
 }
        private void loadSurgery(TreeView tvMedicalData)
        {
            tvMedicalData.Nodes.Add("Surgery");
            tvMedicalData.Nodes[tvMedicalData.Nodes.Count - 1].ImageIndex         = 4;
            tvMedicalData.Nodes[tvMedicalData.Nodes.Count - 1].SelectedImageIndex = 4;

            List <PatientSurgery> patientSurgery = database.getPatientSurgery(patient).OrderBy(ps => ps.Date_Received).ToList();

            foreach (PatientSurgery ps in patientSurgery)
            {
                tvMedicalData.Nodes[tvMedicalData.Nodes.Count - 1].Nodes.Add(
                    ps.Surgery.Name + " - " + ps.Date_Received);
                tvMedicalData.Nodes[tvMedicalData.Nodes.Count - 1].LastNode.ImageIndex         = 4;
                tvMedicalData.Nodes[tvMedicalData.Nodes.Count - 1].LastNode.SelectedImageIndex = 4;
            }
        }