public bool AddPatientVital(PatientVital model)
 {
     try
     {
         entities.PatientVitals.Add(model);
         entities.SaveChanges();
         return true;
     }
     catch (Exception x)
     {
         throw x;
     }
 }
        private void btnAddMeasurement_Click(object sender, EventArgs e)
        {
            PatientVital vital = new PatientVital();
            vital.PatientId = _patientid;
            vital.BPHigh = txtBPHigh.Text;
            vital.BPLow = txtBPLow.Text;
            vital.PulseRate = txtPR.Text;
            vital.RespiratoryRate = txtRR.Text;
            vital.Temperature = txtTemp.Text;
            vital.Height = txtHeight.Text;
            vital.Weight = txtWeight.Text;
            vital.BMI = txtBMI.Text;
            vital.TimeLine = DateTime.Now;

            bool result = new PatientVitalData().AddPatientVital(vital);

            if (result)
                MessageBox.Show("Added Successfully");

            FillGrid();
            RefreshTexts();
        }