Beispiel #1
0
        private string addMeetingSQL()
        {
            clsFormat objFormat = new clsFormat();

            if (JobID == "" || JobID == null)
            {
                JobID = "null";
            }
            /* Todo - update this SQL statement to fit in with new logic within system */
            string strSQL = "Insert into Review(Date,DesiredOutcome,Barriers,Note,Job_ID, Staff_ID, Meeting_ID, Funding_ID, Consumer_ID, TimeIn, TimeOut)";

            strSQL = strSQL + " Select " + objFormat.formatDate(dtDate.Text) + ",'" + objFormat.removeApostrophe(txtOutcome.Text) + "','" + objFormat.removeApostrophe(txtBarriers.Text) + "',";
            strSQL = strSQL + " '" + objFormat.removeApostrophe(txtDetails.Text) + "'," + JobID + ", Staff.ID, Meeting.ID, Consumer.Funding_ID," + ID;
            strSQL = strSQL + ", '" + objFormat.convertTime_24hr(dtTimeIn.Value) + "', '" + objFormat.convertTime_24hr(dtTimeOut.Value) + "'";
            strSQL = strSQL + " FROM Staff, Consumer, Meeting ";
//            strSQL = strSQL + " Join ConsumerStaff  on Staff.ID = ConsumerStaff.Staff_ID";
//            strSQL = strSQL + " Join Consumer on ConsumerStaff.Consumer_ID = Consumer.ID";
//            strSQL = strSQL + " , Meeting";
            strSQL = strSQL + " WHERE Staff.FirstName || ' ' || Staff.LastName = '" + Staff + "'";
            strSQL = strSQL + " AND Meeting.Description = '" + cmbMeeting.Text + "'";
            strSQL = strSQL + " AND Consumer.ID = " + ID;


            return(strSQL);
        }
Beispiel #2
0
        private void dtDate_ValueChanged(object sender, EventArgs e)
        {
            clsFormat objFormat = new clsFormat();
            string    Day       = objFormat.formatDate(dtDate.Text);

            getCurrentJob(ID, Day);
        }
Beispiel #3
0
        private string returnUpdateConsumerSQL(clsDB objDB)
        {
            string strSQL = "Update Consumer";

            strSQL = strSQL + " Set FirstName = '" + txtFirst.Text + "'";
            strSQL = strSQL + ", LastName= '" + txtLast.Text + "'";
            strSQL = strSQL + ", SSN = '" + txtSSN.Text + "'";
            strSQL = strSQL + ", AVR = '" + txtAVR.Text + "'";
            strSQL = strSQL + ", VESID = '" + txtVesid.Text + "'";
            strSQL = strSQL + ", Units = '" + txtUnits.Text + "'";
            strSQL = strSQL + ", Service_ID = '" + cmbService.Text + "'";
            strSQL = strSQL + ", Disability_ID = '" + objDB.returnComboBox_Key("Disability", "Description", cmbDisability.Text) + "'";
            strSQL = strSQL + ", Funding_ID = '" + objDB.returnComboBox_Key("Funding", "Description", cmbFunding.Text) + "'";

            clsFormat objFormat = new clsFormat();

            if (dtReferral.Checked == true)
            {
                strSQL = strSQL + ", ReferralDate = " + objFormat.formatDate(dtReferral.Text);
            }
            else
            {
                strSQL = strSQL + ", ReferralDate = null";
            }

            if (dtIntake.Checked == true)
            {
                strSQL = strSQL + ", IntakeDate = " + objFormat.formatDate(dtIntake.Text);
            }
            else
            {
                strSQL = strSQL + ", IntakeDate = null";
            }

            strSQL = strSQL + " Where Consumer.ID = " + ID;

            strSQL = strSQL.Replace("'   -  -'", "null");
            strSQL = strSQL.Replace("''", "null");
            return(strSQL);
        }
Beispiel #4
0
        private string returnAddConsumerSQL(clsDB objDB)
        {
            string SQL = "Insert into Consumer(SSN,AVR, VESID, FirstName, LastName, Disability_ID, Service_ID,Units, Funding_ID, ReferralDate,IntakeDate)";

            SQL = SQL + " Values(";
            SQL = SQL + "'" + txtSSN.Text + "'";
            SQL = SQL + ",'" + txtAVR.Text + "'";
            SQL = SQL + ",'" + txtVesid.Text + "'";
            SQL = SQL + ",'" + txtFirst.Text + "'";
            SQL = SQL + ",'" + txtLast.Text + "'";
            SQL = SQL + ",'" + objDB.returnComboBox_Key("Disability", "Description", cmbDisability.Text) + "'";
            SQL = SQL + ",'" + cmbService.Text + "'";
            SQL = SQL + ",'" + txtUnits.Text + "'";
            SQL = SQL + ",'" + objDB.returnComboBox_Key("Funding", "Description", cmbFunding.Text) + "'";


            clsFormat objFormat = new clsFormat();

            if (dtReferral.Checked == true)
            {
                SQL = SQL + ", " + objFormat.formatDate(dtReferral.Text);
            }
            else
            {
                SQL = SQL + ", null";
            }

            if (dtIntake.Checked == true)
            {
                SQL = SQL + ", " + objFormat.formatDate(dtIntake.Text);
            }
            else
            {
                SQL = SQL + ", null";
            }

            SQL = SQL + ")";
            return(SQL);
        }
Beispiel #5
0
        private string updateAdmin_SQL()
        {
            clsFormat objFormat = new clsFormat();
            string    SQL       = "Update Administrative";

            SQL = SQL + " Set Date = " + objFormat.formatDate(dtDateAdmin.Text);
            SQL = SQL + " , Description = '" + objFormat.removeApostrophe(txtDescription.Text) + "'";
            SQL = SQL + " , StartTime = '" + objFormat.convertTime_24hr(dtTimeIn.Value) + "'";
            SQL = SQL + " , EndTime = '" + objFormat.convertTime_24hr(dtTimeOut.Value) + "'";
            SQL = SQL + " Where Administrative.ID = " + AdminID;

            return(SQL);
        }
Beispiel #6
0
        private void addNewVoucher()
        {
            clsDB objDB = new clsDB(resPinnacle.liveDB);

            string SQL = "Insert Into Voucher(Start,End,Consumer_ID)";

            clsFormat objFormat = new clsFormat();

            SQL = SQL + " Values('" + objFormat.formatDate(dtVoucherStart.Text) + "','" + objFormat.formatDate(dtVoucherEnd.Text) + "','" + ID + "')";

            bool blPass = objDB.executeNonQuery(SQL);

            fillGridVoucher();
        }
Beispiel #7
0
        public void LoadControl(string strID, string strConsumer, string strStaffID)
        {
            fillComboBox();
            txtConsumer.Text = strConsumer;
            ID    = strID;
            Staff = strStaffID;


            clsFormat objFormat = new clsFormat();
            string    Day       = objFormat.formatDate(dtDate.Text);

            getCurrentJob(strID, Day);
            LoadTimes();
            txtOutcome.Focus();
        }
Beispiel #8
0
        private string addAdmin_SQL()
        {
            clsFormat objFormat = new clsFormat();

            string SQL = "Insert Into Administrative(Date,Description,StartTime,EndTime, staff_ID)";

            SQL = SQL + " Select " + objFormat.formatDate(dtDateAdmin.Text);
            SQL = SQL + " ,'" + objFormat.removeApostrophe(txtDescription.Text) + "'";
            SQL = SQL + " ,'" + objFormat.convertTime_24hr(dtTimeIn.Value) + "'";
            SQL = SQL + " ,'" + objFormat.convertTime_24hr(dtTimeOut.Value) + "'";
            SQL = SQL + " , Staff.ID";
            SQL = SQL + " From Staff";
            SQL = SQL + " Where FirstName || ' ' || LastName = '" + StaffID + "'";

            return(SQL);
        }
Beispiel #9
0
        private string updateMeetingSQL()
        {
            clsFormat objFormat = new clsFormat();

            if (JobID == "" || JobID == null)
            {
                JobID = "null";
            }

            string SQL = "Update Review";

            SQL = SQL + " Set Date = " + objFormat.formatDate(dtDate.Text) + ", DesiredOutcome = '" + objFormat.removeApostrophe(txtOutcome.Text) + "'";
            SQL = SQL + ", Barriers ='" + objFormat.removeApostrophe(txtBarriers.Text) + "'";
            SQL = SQL + ", Note ='" + objFormat.removeApostrophe(txtDetails.Text) + "'";
            SQL = SQL + ",Job_ID = " + JobID + ", Staff_ID = " + StaffID + ", Meeting_ID ='" + MeetingID + "'";
            SQL = SQL + ",TimeIn= '" + objFormat.convertTime_24hr(dtTimeIn.Value) + "', TimeOut = '" + objFormat.convertTime_24hr(dtTimeOut.Value) + "'";
            SQL = SQL + " Where Review.ID = " + ReviewID;
            return(SQL);
        }
Beispiel #10
0
        public void LoadControl(string strReviewID, string strStaff)
        {
            fillComboBox();

            clsDB  objDB = new clsDB(strDB);
            string SQL   = "Select Consumer.ID as Consumer_ID, Consumer.FirstName || ' ' || Consumer.LastName as Consumer,Staff_ID,  strftime('%m/%d/%Y',Date)";

            SQL = SQL + " From Review Join Consumer on Review.Consumer_ID = Consumer.ID";
            SQL = SQL + " Where Review.ID = " + strReviewID;

            SQLiteDataReader objReader = objDB.returnDataReader(SQL);

            txtConsumer.Text = objReader["Consumer"].ToString();
            ID      = strReviewID;
            StaffID = objReader["Staff_ID"].ToString();

            clsFormat objFormat = new clsFormat();
            string    Day       = objFormat.formatDate(dtDate.Text);

            getCurrentJob(ID, Day);
            LoadTimes();
            txtOutcome.Focus();
        }
Beispiel #11
0
        private void checkNewJob()
        {
            if ((txtEmployer.Text != Employer || txtJob.Text != Job) && txtJob.Text != "")
            {
                clsDB     objDB     = new clsDB(strDB);
                clsFormat objFormat = new clsFormat();

                string strInsert = "Insert Into Job(Title, Description, Employer, Address,City, Zip,PlacementDate,Consumer_ID)";
                string strValues = " Values('" + txtJob.Text + "','" + objFormat.removeApostrophe(txtDescription.Text) + "','" + objFormat.removeApostrophe(txtEmployer.Text) + "','" + txtAddress.Text + "'";
                strValues = strValues + ",'" + txtCity.Text + "','" + objFormat.formatZip(txtZip.Text) + "'," + objFormat.formatDate(txtPlacement.Text) + "," + ID + ")";

                objDB.assignJob(strInsert + strValues);

                // logic to email Kristen.
                clsEmail objEmail = new clsEmail();
                objEmail.MailInfo("*****@*****.**", txtConsumer.Text);
            }
        }