private void tbtnLotto_Changed(object sender, RoutedEventArgs e)
        {
            this.NotifyStatus();
            DisplayMessage msg = new DisplayMessage();
            if (txtbTest.Text != "null")
            {
                string toastTemplate = txtbTest.Text;
                string alarmName = "";

                if (toastTemplate.Contains("On"))
                {
                    alarmName = "Alarm is set on";
                }
                else if (toastTemplate.Contains("Off"))
                {
                    alarmName = "Alarm is set off";
                }

                string toastXmlString =
                    "<toast duration=\"long\">\n" +
                        "<visual>\n" +
                            "<binding template=\"ToastText02\">\n" +
                                "<text id=\"1\">Lotto and LottoPlus Notifications</text>\n" +
                                "<text id=\"2\">" + alarmName + "</text>\n" +
                            "</binding>\n" +
                        "</visual>\n" +
                        "<commands scenario=\"alarm\">\n" +
                            "<command id=\"snooze\"/>\n" +
                            "<command id=\"dismiss\"/>\n" +
                        "</commands>\n" +
                        "<audio src=\"ms-winsoundevent:Notification.Looping.Alarm2\" loop=\"true\" />\n" +
                    "</toast>\n";
                var toastDOM = new Windows.Data.Xml.Dom.XmlDocument();
                toastDOM.LoadXml(toastXmlString);

                var toastNotifier = Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier();

                if (toastTemplate.Contains("On"))
                {
                    int customSnoozeSeconds = 5 * 60;
                    TimeSpan snoozeInterval = TimeSpan.FromSeconds(customSnoozeSeconds);
                    var customAlarmScheduledToast = new Windows.UI.Notifications.ScheduledToastNotification(toastDOM, DateTime.Now.AddSeconds(5), snoozeInterval, 0);
                    toastNotifier.AddToSchedule(customAlarmScheduledToast);
                }
                else
                {
                    var customAlarmScheduledToast = new Windows.UI.Notifications.ScheduledToastNotification(toastDOM, DateTime.Now.AddSeconds(5));
                    toastNotifier.AddToSchedule(customAlarmScheduledToast);
                }
            }

        }
        private void appbarSaveResults_Click(object sender, RoutedEventArgs e)
        {
            DisplayMessage display = new DisplayMessage();
            try
            {
                Lotto insert = new Lotto();
                int storeValue = 0;
                bool txtBox = display.checkNullTextboxes(txtOne.Text, txtTwo.Text, txtThree.Text, txtFour.Text, txtFive.Text, txtSix.Text, txtBonus.Text);
                bool final = display.checkForChar(txtOne.Text, txtTwo.Text, txtThree.Text, txtFour.Text, txtFive.Text, txtSix.Text, txtBonus.Text);
                if (txtBox == true)
                {
                    display.msgBox("textbox must not be left empty!!");
                }
                else if (final == false)
                {
                    display.msgBox("You must enter number/s and not character/s.");
                }
                else
                {
                    bool blnValid = display.checkIntegerLottoResults(txtOne.Text, txtTwo.Text, txtThree.Text, txtFour.Text, txtFive.Text, txtSix.Text, txtBonus.Text);
                    if (blnValid == true && final == true)
                    {
                        storeValue = 1;
                    }
                    else if (blnValid == false)
                    {
                        display.msgBox("number must be within the 1-49 range.");
                    }
                }

                if (storeValue == 1)
                {
                    int check = 0;
                    string line = dpDate.Date.ToString().Substring(0, 11).Trim();//date from datepicker
                    string but = ((ComboBoxItem)cmbType.SelectedItem).Content.ToString();
                    if (but == "Lotto")
                    {
                        winnings.store(but, txtOne.Text, txtTwo.Text, txtThree.Text, txtFour.Text, txtFive.Text, txtSix.Text, txtBonus.Text);
                        check = 1;
                    }
                    else if (but == "LottoPlus")
                    {
                        winnings.storeLottoPlus(but, txtOne.Text, txtTwo.Text, txtThree.Text, txtFour.Text, txtFive.Text, txtSix.Text, txtBonus.Text);
                        check = 2;
                    }
                    /////////////FROM HERE STORE NUMBERS INTO THE DATABASE///////////
                    if (check == 1)
                    {
                        storeValues.setStoreLottoLiveResults(winnings.getNumbers(0), winnings.getNumbers(1), winnings.getNumbers(2), winnings.getNumbers(3), winnings.getNumbers(4), winnings.getNumbers(5), winnings.getNumbers(6), line);
                        display.msgBox("all is good. refresh the page");
                    }
                    else if (check == 2)
                    {
                        storeValues.setStoreLottoPlusResults(winnings.getLottoPlus(0), winnings.getLottoPlus(1), winnings.getLottoPlus(2), winnings.getLottoPlus(3), winnings.getLottoPlus(4), winnings.getLottoPlus(5), winnings.getLottoPlus(6), line);
                        display.msgBox("all is good. refresh the page");
                    }                  
                    ////////////FROM HERE STORE NUMBERS INTO THE DATABASE////////////
                }
            }
            catch (Exception ex)
            {
                display.msgBox(ex.Message);
            }
        }