コード例 #1
0
        private void frmFulfillment_Load(object sender, EventArgs e)
        {
            try
            {
                myPatientID = frmPatientPrescription.myPatientID;
                //call combo box filling methods
                FillDrugCombo();
                FillPhysicianCombo();
                FillPatientCombo();

                //Fill the refill and prescription Information
                myPrescriptionID = frmPatientPrescription.myPrescriptionID;
                PharmacyDataTier aPharm = new PharmacyDataTier();
                DataSet          ds     = new DataSet();

                ds = aPharm.GetPrescriptionPID(myPrescriptionID);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtPrescriptionID.Text       = ds.Tables[0].Rows[0]["prescriptionID"].ToString().Trim();
                    cboPhysicianID.SelectedValue = ds.Tables[0].Rows[0]["physicianID"].ToString().Trim();
                    cboDrug.SelectedValue        = ds.Tables[0].Rows[0]["NDCPackageCode"].ToString().Trim();
                    dtpPrescribed.Value          = DateTime.Parse(ds.Tables[0].Rows[0]["Time"].ToString().Trim());
                    txtRefill.Text = ds.Tables[0].Rows[0]["totalRefills"].ToString().Trim();
                }

                //Fill the data grid with refills
                UpdateRefillDatagrid();
            }
            catch (Exception ex)
            {
                string myException = ex.ToString();
                MessageBox.Show(myException, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }