示例#1
0
        public bool insertCholestrolTest(string PID, string testid, string hdl, string ldl, string serum_cholesterol)
        {
            if (string.IsNullOrEmpty(ldl) || string.IsNullOrEmpty(hdl) || string.IsNullOrEmpty(serum_cholesterol))
            {
                return(false);
            }
            else
            {
                string query;
                labtest = new LabTest();
                //conn = ConnectionManager.GetConnection();
                try
                {
                    conn.Open();
                    query = "INSERT INTO lab_lipid_profile_test(PatientID,HDL,LDL,serum_cholesterol)VALUES(@PID,@HDL,@LDL,@serum_ch);";
                    var command = new MySqlCommand(query, conn);
                    command.Parameters.AddWithValue("@PID", Convert.ToInt32(PID));
                    command.Parameters.AddWithValue("@HDL", Convert.ToDouble(hdl));
                    command.Parameters.AddWithValue("@LDL", Convert.ToDouble(ldl));
                    command.Parameters.AddWithValue("@serum_ch", Convert.ToDouble(serum_cholesterol));

                    if (command.ExecuteNonQuery() > 0)
                    {
                        labtest.updateLabTestStatus(PID, testid);
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("DB Error :" + e.Message);
                    return(false);
                }

                finally
                {
                    conn.Close();
                }
            }
        }
示例#2
0
 public BloodTest()
 {
     labtest = new LabTest();
 }