예제 #1
0
파일: LipidTest.cs 프로젝트: wink94/FMC-LAB
        public DataSet fillCholesterolReport(string PID)
        {
            string query;

            conn = ConnectionManager.GetConnection();
            try
            {
                conn.Open();
                query = "select lp.labPatientName,lp.labPatientAge,lp.labPatientGender,lpt.HDL,lpt.LDL,lpt.serum_cholesterol,la.labAppointmentDate,lp.labPatientID from lab_lipid_profile_test lpt,lab_patient lp,lab_appointment la where lp.labPatientID=lpt.PatientID and la.labPatientID=lp.labPatientID and lp.labPatientID=@PID";
                var command = new MySqlCommand(query, conn);
                command.Parameters.AddWithValue("@PID", Convert.ToInt32(PID));
                var da = new MySqlDataAdapter(command);
                var ds = new sugar();
                ds.Clear();
                da.Fill(ds.Tables["CholesterolTestTable"]);
                return(ds);
            }
            catch (Exception e)
            {
                MessageBox.Show("DB Error :" + e.Message);
                return(null);
            }
            finally
            {
                conn.Close();
            }
        }
예제 #2
0
        public DataSet fillCellcountReport(string PID)
        {
            string query;

            conn = ConnectionManager.GetConnection();
            try
            {
                conn.Open();
                query = "select lp.labPatientName,lp.labPatientAge,lp.labPatientGender,lbt.blood_cell_count_WBC,lbt.blood_cell_count_RBC,la.labAppointmentDate from lab_blood_test lbt,lab_patient lp,lab_appointment la where lp.labPatientID=lbt.PatientID and la.labPatientID=lp.labPatientID and lp.labPatientID=@PID";
                var command = new MySqlCommand(query, conn);
                command.Parameters.AddWithValue("@PID", Convert.ToInt32(PID));
                var da = new MySqlDataAdapter(command);
                var ds = new sugar();
                ds.Clear();
                da.Fill(ds.Tables["cellCount1"]);
                return(ds);
            }
            catch (Exception e)
            {
                MessageBox.Show("DB Error :" + e.Message);
                return(null);
            }
            finally
            {
                conn.Close();
            }
        }