Esempio n. 1
0
        private void btnConfirmBooking_Click(object sender, EventArgs e)
        {
            string BookingID = txtBookingID.Text;

            DateTime EventDate = dtpEventDate.Value;

            string StartTime = cboStartTime.Text;

            string EndTime = cboEndTime.Text;

            string Duration = txtDuration.Text;

            string Location = txtLocation.Text;

            string Eircode = txtEircode.Text;

            string TotalCost = "€" + txtTotalCost.Text;

            string ClientID = txtClientID.Text;

            string DJID = txtDJID.Text;

            string ServiceID = txtServiceID.Text;

            string Forename = grdMakeBookingMatchingClients.SelectedRows[0].Cells[1].Value + string.Empty;

            int parsedValueInt;


            if (!ValidateData.isValidDate3(dtpEventDate.Value))

            {
                MessageBox.Show("Cannot be previous Date", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtpEventDate.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtLocation.Text))
            {
                MessageBox.Show("Location must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtLocation.Focus();
                return;
            }

            else if (int.TryParse(txtLocation.Text, out parsedValueInt))
            {
                MessageBox.Show("Location cannot contain numbers only", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtLocation.Clear();
                txtLocation.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtEircode.Text))
            {
                MessageBox.Show("Eircode must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEircode.Focus();
                return;
            }

            else if (!ValidateData.containsSpaces(txtEircode.Text))
            {
                MessageBox.Show("Eircode cannot contain spaces", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEircode.Clear();
                txtEircode.Focus();
                return;
            }

            else if (!ValidateData.isValidEircode(txtEircode.Text))
            {
                MessageBox.Show("Eircode must be valid", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtEircode.Clear();
                txtEircode.Focus();
                return;
            }

            Bookings bookings = new Bookings(Convert.ToInt32(txtBookingID.Text), dtpEventDate.Text.ToUpper(), cboStartTime.Text.ToUpper(), cboEndTime.Text.ToUpper(),
                                             double.Parse(txtDuration.Text), ValidateData.apostChecker(txtLocation.Text.ToUpper()), txtEircode.Text.ToUpper(), Convert.ToDecimal(txtTotalCost.Text),
                                             "P", Convert.ToInt32(0), Convert.ToDecimal(0.00), "A", Convert.ToInt32(txtClientID.Text), Convert.ToInt32(txtDJID.Text), txtServiceID.Text.ToUpper());

            bookings.AddBooking();

            txtBookingID.Text          = Bookings.nextBookingID().ToString("00000");
            cboStartTime.SelectedIndex = -1;
            cboEndTime.SelectedIndex   = -1;
            txtDuration.Clear();
            txtLocation.Clear();
            txtEircode.Clear();
            txtTotalCost.Clear();
            txtClientID.Clear();
            txtServiceID.Clear();
            txtDJID.Clear();
            dtpEventDate.Value = DateTime.Now;

            txtEnterSurname.Select();

            grpMakeBookingMatchingClients.Visible = false;
            grpMakeBookingActiveServices.Visible  = false;
            grpMakeBookingActiveDJs.Visible       = false;
            grpMakeBooking.Visible = false;

            // I need to check if the content is valid before adding it to the form
            //this.textBox1.Items.Add(item);
            MessageBox.Show(text: "Booking details added!" +
                            Environment.NewLine + Environment.NewLine + "Booking ID: " + BookingID.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Event Date: " + EventDate +
                            Environment.NewLine + Environment.NewLine + "Start Time: " + StartTime +
                            Environment.NewLine + Environment.NewLine + "End Time: " + EndTime +
                            Environment.NewLine + Environment.NewLine + "Duration: " + Duration +
                            Environment.NewLine + Environment.NewLine + "Location: " + Location.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Eircode: " + Eircode.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Total Cost: €" + TotalCost +
                            Environment.NewLine + Environment.NewLine + "Client ID: " + ClientID.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "DJ ID: " + DJID.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Service ID: " + ServiceID.ToUpper());

            dtpEventDate.Value = DateTime.Now;

            //Reference for being able to send emails http://karmic-development.blogspot.com/2013/10/send-email-from-aspnet-using-gmail-as.html
            //Reference to set up various security aspects to be able to send email through google mail https://stackoverflow.com/questions/704636/sending-email-through-gmail-smtp-server-with-c-sharp/9572958#9572958
            //Reference on how to send an embedded link inside email
            MailMessage mail = new MailMessage();

            mail.From = new MailAddress("*****@*****.**", "Legend DJs");
            mail.To.Add("*****@*****.**");
            mail.IsBodyHtml = true;
            mail.Subject    = "Booking confirmed";
            //string html = "";
            mail.Body =
                "Dear " + Forename + "," +
                "<br/><br/>Thank you for making a booking with Legend DJs." +
                "<br/><br/>We provide the best DJ service in Ireland and we look forward to seeing you on the date." +
                "<br/><br/>If there are any special requirements such as song requests, plugging, or lighting systems etc, please don't hesitate to call us and we will help as best we can." +
                "<br/><br/>Please check the details below to ensure that the booking information we have is correct. You can update this information at any time up to 28 days before the event date " +
                "by contacting us." +
                "<br/><br/><h1>Booking details added!</h1>" +
                "<br/><br/>Booking ID: " + BookingID.ToUpper() +
                "<br/>Event Date: " + EventDate +
                "<br/>Start Time: " + StartTime +
                "<br/>End Time: " + EndTime +
                "<br/>Duration: " + Duration +
                "<br/>Location: " + Location.ToUpper() +
                "<br/>Eircode: " + Eircode.ToUpper() +
                "<br/>Total Cost: €" + TotalCost +
                "<br/>DJ ID: " + DJID.ToUpper() +
                "<br/>Service ID: " + ServiceID.ToUpper() +
                "<br/><br/><br/>Kind regards," +
                "<br/><br/>Legend DJs" +
                "<br/><br/><h1>Contact Us</h1>" +
                "<br/><br/>Legend DJs" +
                "<br/>Main Street" +
                "<br/>Tralee" +
                "<br/>Co. Kerry" +
                "<br/>087 170 1459" +
                "<br/><br/><html><body><a href=\"http://www.livinglegendcolmg.com/\" > LegendDJs.com</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://www.facebook.com/colm.l.gallagher/\" > LegendDJs @ facebook</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://twitter.com/LivingLegendDJ/\" > LegendDJs @ twitter</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://www.instagram.com/livinglegendcolmg/?hl=en/\" > LegendDJs @ instagram</a></body></html>";

            mail.Priority = MailPriority.High;

            SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);

            smtp.UseDefaultCredentials = false;
            //smtp.UseDefaultCredentials = true;
            smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "jcxvqxkvqrfanhqj");
            smtp.EnableSsl   = true;
            //smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

            smtp.Send(mail);

            //send email to client
            MessageBox.Show(text: "Confirmation email sent to Client");

            txtEnterSurname.Select();
        }
        private void btnUpdateService_Click(object sender, EventArgs e)
        {
            grpUpdateMatchingServices.Visible = false;

            String ServiceID = txtServiceID.Text;

            string Description = txtDescription.Text;

            string BaseRate = txtBaseRate.Text;

            decimal parsedValue;

            if (!ValidateData.isBlank(txtServiceID.Text))
            {
                MessageBox.Show("Service ID must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Focus();
                return;
            }

            else if (!ValidateData.containsNumbers(txtServiceID.Text))
            {
                MessageBox.Show("Service ID cannot contain numbers", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Clear();
                txtServiceID.Focus();
                return;
            }

            else if (!ValidateData.containsSpaces(txtServiceID.Text))
            {
                MessageBox.Show("Service ID cannot contain spaces", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Clear();
                txtServiceID.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDescription.Text))
            {
                MessageBox.Show("Description must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDescription.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtBaseRate.Text))
            {
                MessageBox.Show("Rate must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtBaseRate.Focus();
                return;
            }

            else if (!decimal.TryParse(txtBaseRate.Text, out parsedValue))
            {
                MessageBox.Show("Rate must contain numeric only values.", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                txtBaseRate.Clear();
                txtBaseRate.Focus();
                return;
            }

            else
            {
                //Update the data in the database based on the details changed in the text boxes(if any)
                Services.updateServices(txtServiceID.Text.ToUpper(), txtDescription.Text.ToUpper(), Convert.ToDecimal(txtBaseRate.Text));

                //Create a new data set and re-populates the datagrid with all Services including the updated details
                DataSet ds = new DataSet();
                grdUpdateMatchingServices.DataSource = Services.GetAllActiveServices(ds, txtServiceID.Text).Tables["searchActiveServices"];
                grdUpdateMatchingServices.Visible    = true;

                txtServiceID.Clear();
                txtDescription.Clear();
                txtBaseRate.Clear();

                txtServiceID.Focus();

                // I need to check if the content is valid before adding it to the form
                //MessageBox item = new MessageBox(this.txtForename.Text);
                //this.textBox1.Items.Add(item);
                MessageBox.Show(text: "Service details updated!" +
                                Environment.NewLine + Environment.NewLine + "Service ID: " + ServiceID.ToUpper() +
                                Environment.NewLine + Environment.NewLine + "Description: " + Description.ToUpper() +
                                Environment.NewLine + Environment.NewLine + "Base Rate: " + BaseRate);

                grpUpdateServices.Visible = false;
            }
        }
Esempio n. 3
0
        private void btnAddDJ_Click(object sender, EventArgs e)
        {
            string DJID = txtDJID.Text;

            string Forename = txtDJForename.Text;

            string Surname = txtDJSurname.Text;

            DateTime Date = dtpDJDateOfBirth.Value;

            string Contact = txtDJContactNo.Text;

            string Email = txtDJEmail.Text;

            string Street = txtDJStreet.Text;

            string Town = txtDJTown.Text;

            string City = txtDJCity.Text;

            string County = cboDJCounty.Text;

            string Eircode = txtDJEircode.Text;

            //https://ourcodeworld.com/articles/read/507/how-to-allow-only-numbers-inside-a-textbox-in-winforms-c-sharp
            decimal HourlyRate = Convert.ToDecimal(txtDJHourlyRate.Text);

            int     parsedValueInt;
            int     contact;
            decimal parsedValueDec;

            if (!ValidateData.isBlank(txtDJForename.Text))
            {
                MessageBox.Show("Forename must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJForename.Focus();
                return;
            }

            else if (!ValidateData.containsNumbers(txtDJForename.Text))
            {
                MessageBox.Show("Forename cannot contain numbers", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJForename.Clear();
                txtDJForename.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJSurname.Text))
            {
                MessageBox.Show("Surname must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJSurname.Focus();
                return;
            }

            else if (!ValidateData.containsNumbers(txtDJSurname.Text))
            {
                MessageBox.Show("Surname cannot contain numbers", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJSurname.Clear();
                txtDJSurname.Focus();
                return;
            }

            if (!ValidateData.isValidDate2(dtpDJDateOfBirth.Value))

            {
                MessageBox.Show("Cannot be future Date", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtpDJDateOfBirth.Focus();
                return;
            }

            else if (!ValidateData.isValidDate(dtpDJDateOfBirth.Value))

            {
                MessageBox.Show("You must be 18 or over to register", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtpDJDateOfBirth.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJContactNo.Text))
            {
                MessageBox.Show("Contact number must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJContactNo.Focus();
                return;
            }

            //Reference https://stackoverflow.com/questions/24279155/how-to-validate-only-number-in-winform

            else if (!int.TryParse(txtDJContactNo.Text, out contact))
            {
                MessageBox.Show("Contact Number must contain numbers only", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJContactNo.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJEmail.Text))
            {
                MessageBox.Show("Email must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJEmail.Focus();
                return;
            }

            if (!ValidateData.isValidEmail(txtDJEmail.Text))
            {
                if (!Regex.IsMatch(txtDJEmail.Text, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase))
                {
                    //MessageBox.Show("Email must be valid format", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtDJEmail.Clear();
                    txtDJEmail.Focus();
                    return;
                }
            }

            if (!ValidateData.isBlank(txtDJStreet.Text))
            {
                MessageBox.Show("Street must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJStreet.Focus();
                return;
            }

            else if (int.TryParse(txtDJStreet.Text, out parsedValueInt))
            //else if (!ValidateData.onlyNumbers(txtDJStreet.Text))
            {
                MessageBox.Show("Street cannot contain numbers only", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJStreet.Clear();
                txtDJStreet.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJTown.Text))
            {
                MessageBox.Show("Town must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJTown.Focus();
                return;
            }

            else if (int.TryParse(txtDJTown.Text, out parsedValueInt))
            //else if (!ValidateData.onlyNumbers(txtDJTown.Text))
            {
                MessageBox.Show("Town cannot contain numbers only", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJTown.Clear();
                txtDJTown.Focus();
                return;
            }

            if (int.TryParse(txtDJCity.Text, out parsedValueInt))
            //if (!ValidateData.onlyNumbers(txtDJCity.Text))
            {
                MessageBox.Show("City cannot contain numbers only", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJCity.Clear();
                txtDJCity.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJEircode.Text))
            {
                MessageBox.Show("Eircode must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJEircode.Focus();
                return;
            }

            else if (!ValidateData.containsSpaces(txtDJEircode.Text))
            {
                MessageBox.Show("Eircode cannot contain spaces", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJEircode.Clear();
                txtDJEircode.Focus();
                return;
            }

            else if (!ValidateData.isValidEircode(txtDJEircode.Text))
            {
                MessageBox.Show("Eircode must be valid", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJEircode.Clear();
                txtDJEircode.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDJHourlyRate.Text))
            {
                MessageBox.Show("Rate must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJHourlyRate.Focus();
                return;
            }

            else if (!decimal.TryParse(txtDJHourlyRate.Text, out parsedValueDec))
            {
                MessageBox.Show("Rate must contain numeric only values.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDJHourlyRate.Clear();
                txtDJHourlyRate.Focus();
                return;
            }

            DJs dj = new DJs(Convert.ToInt32(txtDJID.Text), ValidateData.apostChecker(txtDJForename.Text.ToUpper()), ValidateData.apostChecker(txtDJSurname.Text.ToUpper()), dtpDJDateOfBirth.Text.ToUpper(),
                             txtDJContactNo.Text.ToUpper(), txtDJEmail.Text.ToLower(), ValidateData.apostChecker(txtDJStreet.Text.ToUpper()), ValidateData.apostChecker(txtDJTown.Text.ToUpper()),
                             ValidateData.apostChecker(txtDJCity.Text.ToUpper()), cboDJCounty.Text.ToUpper(), txtDJEircode.Text.ToUpper(), Convert.ToDecimal(txtDJHourlyRate.Text), "A");

            dj.AddDJ();

            txtDJID.Text = DJs.nextDJID().ToString("000");
            txtDJForename.Clear();
            txtDJSurname.Clear();
            txtDJContactNo.Clear();
            txtDJEmail.Clear();
            txtDJStreet.Clear();
            txtDJTown.Clear();
            //reference for clearing combobox https://stackoverflow.com/questions/9321844/how-do-i-clear-a-combobox & https://stackoverflow.com/questions/9321844/how-do-i-clear-a-combobox
            cboDJCounty.Items.Clear();
            cboDJCounty.ResetText();
            txtDJCity.Clear();
            txtDJEircode.Clear();
            txtDJHourlyRate.Clear();
            dtpDJDateOfBirth.Value = DateTime.Now;
            txtDJForename.Focus();

            // I need to check if the content is valid before adding it to the form
            //MessageBox item = new MessageBox(this.txtForename.Text);
            //this.textBox1.Items.Add(item);
            MessageBox.Show(text: "Client details added!" +
                            Environment.NewLine + Environment.NewLine + "Client ID: " + DJID.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Forename: " + Forename.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Surname: " + Surname.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Date of Birth: " + Date +
                            Environment.NewLine + Environment.NewLine + "Contact No.: " + Contact.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Email: " + Email +
                            Environment.NewLine + Environment.NewLine + "Street: " + Street.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Town: " + Town.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "City: " + City.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "County: " + County.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Hourly Rate: €" + Convert.ToDecimal(HourlyRate) +
                            Environment.NewLine + Environment.NewLine + "Eircode: " + Eircode.ToUpper());

            dtpDJDateOfBirth.Value = DateTime.Now;

            //Reference for being able to send emails http://karmic-development.blogspot.com/2013/10/send-email-from-aspnet-using-gmail-as.html
            //Reference to set up various security aspects to be able to send email through google mail https://stackoverflow.com/questions/704636/sending-email-through-gmail-smtp-server-with-c-sharp/9572958#9572958
            //Reference on how to send an embedded link inside email
            MailMessage mail = new MailMessage();

            mail.From = new MailAddress("*****@*****.**", "Legend DJs");
            mail.To.Add("*****@*****.**");
            mail.IsBodyHtml = true;
            mail.Subject    = "DJ Registration";
            //string html = "";
            mail.Body =
                "Dear " + Forename + "," +
                "<br/><br/>Welcome to the team at Legend DJs!" +
                "<br/><br/>We look forward to a long and busy working relationship with you." +
                "<br/><br/>Please check the details below to ensure that the information we have is correct. You can update this information at any time by contacting us." +
                "<br/><br/><h1>DJ details added!</h1>" +
                "<br/><br/>Forename: " + Forename.ToUpper() +
                "<br/>Surname: " + Surname.ToUpper() +
                "<br/>Date of Birth: " + Date +
                "<br/>Contact No.: " + Contact.ToUpper() +
                "<br/>Email: " + Email +
                "<br/>Street: " + Street.ToUpper() +
                "<br/>Town: " + Town.ToUpper() +
                "<br/>City: " + City.ToUpper() +
                "<br/>County: " + County.ToUpper() +
                "<br/>Eircode: " + Eircode.ToUpper() +
                "<br/>Hourly Rate: €" + Convert.ToDecimal(HourlyRate) +
                "<br/><br/><br/>Kind regards," +
                "<br/><br/>Legend DJs" +
                "<br/><br/><h1>Contact Us</h1>" +
                "<br/><br/>Legend DJs" +
                "<br/>Main Street" +
                "<br/>Tralee" +
                "<br/>Co. Kerry" +
                "<br/>087 170 1459" +
                "<br/><br/><html><body><a href=\"http://www.livinglegendcolmg.com/\" > LegendDJs.com</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://www.facebook.com/colm.l.gallagher/\" > LegendDJs @ facebook</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://twitter.com/LivingLegendDJ/\" > LegendDJs @ twitter</a></body></html>" +
                "<br/><br/><html><body><a href=\"https://www.instagram.com/livinglegendcolmg/?hl=en/\" > LegendDJs @ instagram</a></body></html>";

            mail.Priority = MailPriority.High;

            SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);

            smtp.UseDefaultCredentials = false;
            //smtp.UseDefaultCredentials = true;
            smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "jcxvqxkvqrfanhqj");
            smtp.EnableSsl   = true;
            //smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

            smtp.Send(mail);

            //send email to client
            MessageBox.Show(text: "Confirmation email sent to DJ");
        }
Esempio n. 4
0
        private void btnLogService_Click(object sender, EventArgs e)
        {
            string ServiceID   = txtServiceID.Text;
            string Description = txtDescription.Text;
            //Reference to show how to allow numbers only inside a text box https://ourcodeworld.com/articles/read/507/how-to-allow-only-numbers-inside-a-textbox-in-winforms-c-sharp
            decimal BaseRate = Convert.ToDecimal(txtBaseRate.Text);

            decimal parsedValue;

            if (!ValidateData.isBlank(txtServiceID.Text))
            {
                MessageBox.Show("Service ID must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Focus();
                return;
            }

            else if (!ValidateData.containsNumbers(txtServiceID.Text))
            {
                MessageBox.Show("Service ID cannot contain numbers", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Clear();
                txtServiceID.Focus();
                return;
            }

            else if (!ValidateData.containsSpaces(txtServiceID.Text))
            {
                MessageBox.Show("Service ID cannot contain spaces", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtServiceID.Clear();
                txtServiceID.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtDescription.Text))
            {
                MessageBox.Show("Description must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtDescription.Focus();
                return;
            }

            if (!ValidateData.isBlank(txtBaseRate.Text))
            {
                MessageBox.Show("Rate must be entered", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtBaseRate.Focus();
                return;
            }

            else if (!decimal.TryParse(txtBaseRate.Text, out parsedValue))
            {
                MessageBox.Show("Rate must contain numeric only values.", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                txtBaseRate.Clear();
                txtBaseRate.Focus();
                return;
            }

            Services service = new Services(txtServiceID.Text.ToUpper(), txtDescription.Text.ToUpper(), Convert.ToDecimal(txtBaseRate.Text), "A");

            service.LogService();

            txtServiceID.Clear();
            txtDescription.Clear();
            txtBaseRate.Clear();

            txtServiceID.Focus();

            // I need to check if the content is valid before adding it to the form
            //MessageBox item = new MessageBox(this.txtServiceID.Text);
            //this.textBox1.Items.Add(item);
            MessageBox.Show(text: "Service details logged" +
                            Environment.NewLine + Environment.NewLine + "Service ID: " + ServiceID.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Description: " + Description.ToUpper() +
                            Environment.NewLine + Environment.NewLine + "Base Rate: €" + BaseRate);
        }