private bool returnWaitList() { WaitList_ID = 0; bool blRows = false; clsDatabase objDB = new clsDatabase(strDB); string SQL = returnWaitListSQL(); SQLiteDataReader objReader = objDB.returnDataReader(SQL); if (objReader.HasRows == true) { blRows = true; while (objReader.Read()) { WaitList_ID = Convert.ToInt32(objReader["ID"]); dtWaitStart.Text = objReader["StartDate"].ToString(); dtWaitEnd.Text = objReader["EndDate"].ToString(); //Setting up combobox int Items = cmbResource.Items.Count; for (int j = 0; j < Items; j++) { if (cmbResource.Items[j].ToString() == objReader["Resource"].ToString()) { cmbResource.SelectedIndex = j; break; } } rdYes.Checked = true; } } return(blRows); }
private void fillCombobox() { clsDatabase objDB = new clsDatabase(StaticValues.RemoteDB); SQLiteDataReader objReader = objDB.returnDataReader("Select FirstName || ' ' || LastName as Counselor FROM Resource"); while (objReader.Read()) { cmbResource.Items.Add(objReader["Counselor"]); } }
private void loadConsumerList() { clsDatabase objDB = new clsDatabase(strDB); string SQL = returnPatientsSQL(); SQLiteDataReader objReader = objDB.returnDataReader(SQL); while (objReader.Read()) { txtPatient.AutoCompleteCustomSource.Add(objReader["Patient"].ToString()); } }
private void butRun_Click(object sender, EventArgs e) { bool blPass = false; clsDatabase objDB = new clsDatabase(StaticValues.RemoteDB); string SQL = ""; if (rdTPDates.Checked == true) { SQL = returnTPDateSQL(); } else { SQL = returnWaitListSQL(); } SQLiteDataReader objReader = objDB.returnDataReader(SQL); if (objReader.HasRows == true) { clsReports objReport = new clsReports(); string TimeFrame = returnTimeFrame(); this.Cursor = Cursors.WaitCursor; if (rdTPDates.Checked == true) { blPass = objReport.createReport(objReader, TimeFrame, "TPDates"); } else { blPass = objReport.createReport(objReader, TimeFrame, "WaitList"); } this.Cursor = Cursors.Default; if (blPass == true) { this.Close(); } else { MessageBox.Show("The report did not run properly if the problem persists please contact IT"); this.Close(); } } else { MessageBox.Show("The report did not return any rows for the requested time frame."); } }
private void loadResource(ComboBox cmbCombo) { string SQL = "Select Resource.FirstName || ' ' || Resource.LastName as Counselor"; SQL = SQL + " From Resource Where Active = 1 order by FirstName "; clsDatabase objDB = new clsDatabase(strDB); SQLiteDataReader objReader = objDB.returnDataReader(SQL); while (objReader.Read()) { cmbCombo.Items.Add(objReader[0].ToString()); } }
private void loadTP_Dates(string sAccount) { clsDatabase objDB = new clsDatabase(strDB); string SQL = returnTP_SQL(sAccount); SQLiteDataReader objReader = objDB.returnDataReader(SQL); TP_ID = 0; while (objReader.Read()) { int.TryParse(objReader["ID"].ToString(), out TP_ID); dtDate.Text = objReader["Date"].ToString(); setupComboBox(cmbCounselor, objReader["Counselor"].ToString()); setupComboBox(cmbLocation, objReader["Location"].ToString()); rbTPyes.Checked = true; } }
private void returnPatientInfo() { clsDatabase objDB = new clsDatabase(strDB); string SQL = returnPatientSQL(); SQLiteDataReader objReader = objDB.returnDataReader(SQL); while (objReader.Read()) { txtAccount.Text = objReader["Account"].ToString(); txtDOB.Text = objReader["DOB"].ToString(); txtCounselor.Text = objReader["Counselor"].ToString(); txtPhone.Text = objReader["Phone"].ToString(); strAccount = objReader["Account"].ToString(); } clearTPPanel(); loadTP_Dates(strAccount); tabApps.SelectedIndex = 0; }