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 addPerson() { clsDatabase objDB = new clsDatabase(StaticValues.RemoteDB); string SQL = addPerson_SQL(); bool blPass = objDB.ExecuteNonQuery(SQL); if (blPass == true) { MessageBox.Show("The patient has been added to the DB"); returningName(txtFirst.Text + " " + txtLast.Text); CancelControl(); } }
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 addToWaitList() { clsDatabase objDB = new clsDatabase(StaticValues.RemoteDB); string SQL = add2WaitListSQL(); bool blPass = objDB.ExecuteNonQuery(SQL); if (blPass == true) { MessageBox.Show(txtPatient.Text + " has been added to the wait list."); } else { MessageBox.Show("Error - was not able to add the user to the wait list. If the problem persists please contact IT."); } }
private void addDate() { clsDatabase objDB = new clsDatabase(strDB); string SQL = addDate_SQL(); bool blPass = objDB.ExecuteNonQuery(SQL); if (blPass != true) { MessageBox.Show("Your date was not added to database, if problem persists please contact IT."); } else { loadTP_Dates(strAccount); MessageBox.Show("A new Treatment Plan has been added to the database."); } }
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 deleteDate() { clsFormat objFormat = new clsFormat(); string strDelete = objFormat.formatDate(dtDate.Text); string SQL = returnDeleteDate_SQL(strDelete); clsDatabase objDatabase = new clsDatabase(strDB); bool blPass = objDatabase.ExecuteNonQuery(SQL); if (blPass != true) { MessageBox.Show("The date was not deleted, if problem persists please contact IT."); } else { loadTP_Dates(strAccount); } }
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; }
private void deleteWaitList() { if (blWaitList == true) { clsDatabase objDB = new clsDatabase(strDB); string SQL = deleteWaitListSQL(); bool blPass = objDB.ExecuteNonQuery(SQL); if (blPass == true) { MessageBox.Show(txtPatient.Text + " has been deleted from the wait list."); } else { MessageBox.Show("Error - was not able to delete the user to the wait list. If the problem persists please contact IT."); } } else { blWaitList = true; } }
private void deleteTP() { if (TP_ID != 0) { clsDatabase objDB = new clsDatabase(strDB); string SQL = deleteTPSQL(); bool blPass = objDB.ExecuteNonQuery(SQL); if (blPass == true) { MessageBox.Show(txtPatient.Text + " has removed his treatment plan."); clearTPPanel(); } else { MessageBox.Show("Error - was not able to delete the user to the treatment plan. If the problem persists please contact IT."); } } else { blTP = true; } }