예제 #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();
            }
        }
예제 #3
0
        public void sellSugar(Player player)
        {
            Console.WriteLine("Enter how many cups of sugar you would like to buy: \n\r '8' - '20' - '50'");
            int numberOfSugarCups = Console.ReadLine();

            switch (numberOfSugarCups)
            {
            case 8:
                double priceOfSugar = 0.75;
                sugar  sugar        = new sugar();
                player.invetory.Sugar.Add(sugar);

                player.bank -= priceOfSugar;
                break;

            case 20:
                double priceOfSugar = 1.60;
                sugar  sugar        = new sugar();
                player.invetory.Sugar.Add(sugar);

                player.bank -= priceOfSugar;
                break;

            case 50:
                double priceOfSugar = 3.30;
                sugar  sugar        = new sugar();
                player.invetory.Sugar.Add(sugar);

                player.bank -= priceOfSugar;
                break;

            default:
                sellSugar(player);
                break;
            }
        }