示例#1
0
        protected virtual void BuildQOL_Therapy(int PatientID, string FormName, string FormType)
        {
            QOL_TherapyDa QolDa = new QOL_TherapyDa();
            DataSet       QolDs = QolDa.FormListQOL_Therapy(PatientID, FormName, FormType);

            if (QolDs.Tables.Count > 0 && QolDs.Tables[0].Rows.Count > 0)
            {
                QolTherapy.DataSource = QolDs.Tables[0].DefaultView;
                QolTherapy.DataBind();
            }
        }
        protected void BuildQOL_Therapy(int MinNumQOL_TherapyRowsToShow, int minNumBlankQOL_TherapyRows)
        {
            if (patientID != 0)
            {
                QOL_TherapyDa QolDa = new QOL_TherapyDa();
                DataSet       QolDs = QolDa.FormListQOL_Therapy(this.patientID, this._formName, "Dynamic");

                if (QolDs.Tables.Count > 0)
                {
                    int numBlankQolRows = minNumBlankQOL_TherapyRows - QolDs.Tables[0].Rows.Count;



                    // be sure you have at least the number of blank rows specified earlier
                    if (numBlankQolRows < minNumBlankQOL_TherapyRows)
                    {
                        numBlankQolRows = minNumBlankQOL_TherapyRows;
                    }

                    if (numBlankQolRows > 0)
                    {
                        // add the blank rows
                        for (int i = 0; i < numBlankQolRows; i++)
                        {
                            DataRow blankQolRow;
                            blankQolRow = QolDs.Tables[0].NewRow();
                            blankQolRow["QOL_Therapy"]        = "&nbsp;";
                            blankQolRow["QOL_TxDateText"]     = "&nbsp;";
                            blankQolRow["QOL_TxStopDateText"] = "&nbsp;";
                            QolDs.Tables[0].Rows.Add(blankQolRow);
                        }
                    }
                    QolTherapy.DataSource = QolDs.Tables[0].DefaultView;
                }
                else
                {
                    QolTherapy.DataSource = BlankQOL_Therapy(MinNumQOL_TherapyRowsToShow).DefaultView;
                }
            }
            else
            {
                QolTherapy.DataSource = BlankQOL_Therapy(MinNumQOL_TherapyRowsToShow).DefaultView;
            }

            QolTherapy.DataBind();
        }