Esempio n. 1
0
        private void updateAdministrative(string Type)
        {
            clsDB objDB = new clsDB(resPinnacle.liveDB);

            string SQL = "";

            if (Type == "Enter")
            {
                SQL = addAdmin_SQL();
            }
            else if (Type == "Update")
            {
                SQL = updateAdmin_SQL();
            }
            else if (Type == "Delete")
            {
                SQL = deleteAdmin_SQL();
            }

            bool blPass = objDB.executeNonQuery(SQL);

            if (blPass == true)
            {
                fillGridAdmin();
                Clear_Administrative();
            }
            else
            {
                MessageBox.Show("Your administrative task was not updated, if problem persists please contact IT.");
            }
        }
Esempio n. 2
0
        private bool addNewConsumer(ref string strResponse)
        {
            string strSQL;
            bool   blAdded     = false;
            bool   blValidated = validateData(this.Controls);


            if (blValidated == true)
            {
                clsDB objDB = new clsDB(resPinnacle.liveDB);
                strSQL  = returnAddConsumerSQL(objDB);
                blAdded = objDB.executeNonQuery(strSQL);

                if (blAdded == true)
                {
                    strResponse = txtFirst.Text + " " + txtLast.Text + " has been successfully added to the database.";
                }
                else
                {
                    strResponse = "The consumer was not added to the database. Please try again. Consult IT if problem persists";
                    txtFirst.Focus();
                }
            }

            return(blAdded);
        }
Esempio n. 3
0
        private void addMeeting()
        {
            //checkNewJob();

            string strSQL = addMeetingSQL();
            clsDB  objDB  = new clsDB(strDB);
            bool   blPass = objDB.executeNonQuery(strSQL);

            if (blPass == false)
            {
                MessageBox.Show("Your review was not entered into the database, please consult IT if problem persists.");
            }
        }
Esempio n. 4
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();
        }
Esempio n. 5
0
        private void updateMeeting()
        {
            clsDB  objDB = new clsDB(strDB);
            string SQL   = updateMeetingSQL();

            bool blPass = objDB.executeNonQuery(SQL);

            if (blPass == true)
            {
                MessageBox.Show(txtConsumer.Text + "'s review was successfully updated.");
            }
            else
            {
                MessageBox.Show(txtConsumer.Text + "'s review was NOT updated. Please try again if problem persists contact IT.");
            }
        }
Esempio n. 6
0
        private void DeleteConsumer(string strConsumer, string strID)
        {
            clsDB        objDB     = new clsDB(strDB);
            DialogResult objResult = MessageBox.Show("Are you sure you want to delete " + strConsumer + " from the database? This permanently deletes the user from the database.", "Delete - " + strConsumer, MessageBoxButtons.YesNo);

            if (objResult == DialogResult.Yes)
            {
                string SQL    = "Delete from Consumer where Consumer.ID = " + strID;
                bool   blPass = objDB.executeNonQuery(SQL);
                if (blPass == true)
                {
                    MessageBox.Show(strConsumer + " was successfully deleted from the system");
                    LoadControl();
                }
            }
        }
Esempio n. 7
0
        private void DeleteReview(string strConsumer, string strReviewID)
        {
            clsDB  objDB  = new clsDB(resPinnacle.liveDB);
            string SQL    = "Delete from Review where ID = " + strReviewID;
            bool   blPass = objDB.executeNonQuery(SQL);

            if (blPass == false)
            {
                MessageBox.Show("Your review was not deleted. If problem persists please contact IT.");
            }

            SQL = selectedConsumer_SQL();
            SQLiteDataReader objReader = objDB.returnDataReader(SQL);
            clsGridUtils     objGrid   = new clsGridUtils();

            objGrid.fillGrid(objReader, 3, ref grdConsumers, this.CreateGraphics());
        }
Esempio n. 8
0
        private bool removeStaff_DB()
        {
            string SQL    = "";
            clsDB  objDB  = new clsDB(resPinnacle.liveDB);
            bool   blPass = true;   // if value is not updated it will return false

            for (int j = 0; j < deleteStaff.Count; j++)
            {
                SQL = "Delete from ConsumerStaff Where ConsumerStaff.ID = (";
                SQL = SQL + " Select ConsumerStaff.ID from ConsumerStaff";
                SQL = SQL + " Join Staff on ConsumerStaff.Staff_ID = Staff.ID";
                SQL = SQL + " Where Consumer_ID = " + ID;
                SQL = SQL + " and Staff.FirstName || ' ' || Staff.LastName = '" + deleteStaff[j] + "')";

                blPass = objDB.executeNonQuery(SQL);
            }

            return(blPass);
        }
Esempio n. 9
0
        private bool updateStaff()
        {
            clsDB objDB  = new clsDB(resPinnacle.liveDB);
            bool  blPass = true;    // if value is not updated it will return false

            // Creating SQL to update ConsumerSTaff
            for (int j = 0; j < StaffIDs.Count; j++)
            {
                string SQL = "Insert into ConsumerStaff(Staff_ID, Consumer_ID)";
                SQL    = SQL + " Values(" + StaffIDs[j].ID + "," + ID + ")";
                blPass = objDB.executeNonQuery(SQL);

                if (blPass != true)
                {
                    break;
                }
            }

            return(blPass);
        }
Esempio n. 10
0
        private void DeleteVoucher()
        {
            string strVoucherID = grdVouchers.SelectedRows[0].Cells[0].Value.ToString();

            string SQL = "Delete From Voucher";

            SQL = SQL + " Where ID = " + strVoucherID;

            clsDB objDB  = new clsDB(resPinnacle.liveDB);
            bool  blPass = objDB.executeNonQuery(SQL);

            if (blPass == true)
            {
                fillGridVoucher();
            }
            else
            {
                MessageBox.Show("There was an error, your voucher was not deleted. If problem persists please notify IT.");
            }
        }
Esempio n. 11
0
        private void DeleteReview()
        {
            DialogResult objResult;

            objResult = MessageBox.Show("Are you sure you want to delete this review", "Delete Review", MessageBoxButtons.YesNo);
            if (objResult == DialogResult.Yes)
            {
                string SQL      = "DELETE from Review where ID=" + grdActivity[1, grdActivity.CurrentRow.Index].Value.ToString();
                clsDB  objDB    = new clsDB(resPinnacle.liveDB);
                bool   blDelete = objDB.executeNonQuery(SQL);
                if (blDelete == false)
                {
                    MessageBox.Show("The review was not deleted. Please try again. If problem persists, please contact IT.");
                }
                else
                {
                    loadSelectedConsumer();
                }
            }
        }
Esempio n. 12
0
        private bool updateVRC()
        {
            clsDB objDB = new clsDB(resPinnacle.liveDB);

            string SQL = "Update Consumer";

            if (cmbCounselor.Text == "")
            {
                SQL = SQL + " Set VRC_ID = null";
            }
            else
            {
                SQL = SQL + " Set VRC_ID = (Select VRC.ID From VRC Where VRC.FirstName || ' ' || VRC.LastName = '" + cmbCounselor.Text + "'";
                SQL = SQL + " and Consumer.ID = " + ID + ")";
            }
            SQL = SQL + " Where Consumer.ID = " + ID;

            bool blPass = objDB.executeNonQuery(SQL);

            return(blPass);
        }