예제 #1
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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);
        }
예제 #2
0
        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"]);
            }
        }
예제 #3
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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());
            }
        }
예제 #4
0
        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();
            }
        }
예제 #5
0
        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.");
            }
        }
예제 #6
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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());
            }
        }
예제 #7
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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.");
            }
        }
예제 #8
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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.");
            }
        }
예제 #9
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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;
            }
        }
예제 #10
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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);
            }
        }
예제 #11
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
        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;
        }
예제 #12
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
 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;
     }
 }
예제 #13
0
파일: frmMain.cs 프로젝트: jworkman119/HTC
 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;
     }
 }