public Notification()
        {
            InitializeComponent();
            Loger.WriteLog(this.GetType() + "- InitializeComponent");
            eventTracker = new DAO.EventTrackerDAO();
            try{
                id = (int)App.Current.Properties["UserID"];
            }
            catch (Exception ex)
            {
                Loger.WriteLog(this.GetType() + "-Exception:" + ex.Message + Environment.NewLine + "StackTrace:" + ex.StackTrace);
            }
            //get all the attendee's details
            attendees = eventTracker.GetAttendeeDetails(id);

            if (attendees != null)
            {
                Loger.WriteLog(GetType() + "- attendees has data");
                //loading data to controls
                txtUID.Text = attendees.UID;
                //load the picture
                picture = eventTracker.GetPicture(id);
                //coverting the byte array to Bitmap or Image
                Bitmap b = Helper.byteArrayToImage(picture.PICTURE);
                //load the image
                imgPicture.Source = Helper.LoadBitmap(b);

                txtNameCombined.Text = attendees.LAST_NAME + " " + attendees.FISRT_NAME;
            }
            else
            {
                Helper.ShowPopUp("No Record found for " + txtUID.Text, "Empty Records!");
                Loger.WriteLog(this.GetType() + "- No Record found for " + txtUID.Text);
            }
        }
 private void Finish_button_Click(object sender, RoutedEventArgs e)
 {
     Loger.WriteLog(this.GetType() + "-" + Finish_button.Name + "Clicked");
     timer.Stop();
     try
     {
         DAO.EventTrackerDAO et = new DAO.EventTrackerDAO();
         //get the last Attendeee ID
         id = et.GetLastAttendeeID();
         //user id
         App.Current.Properties["UserID"] = id;
         if (et.SavePicture(id, picture))
         {
             Loger.WriteLog(this.GetType() + "- SavePicture return true, navigate to the next page");
             //move to next page
             Uri uri = new Uri("Notification.xaml", UriKind.Relative);
             this.NavigationService.Navigate(uri);
         }
         else
         {
             Loger.WriteLog(this.GetType() + "- SavePicture return false, a message must be shown");
             Helper.ShowPopUp("An Error Occurred while Saving Picture!", "Failed to Save");
         }
     }
     catch (Exception ex)
     {
         Helper.ShowPopUp("An Error Occurred!! Please check log for errors", "Exception");
         Loger.WriteLog(this.GetType() + "-Exception:" + ex.Message + Environment.NewLine + "StackTrace:" + ex.StackTrace);
     }
 }
        public CheckOut()
        {
            InitializeComponent();
            Loger.WriteLog(this.GetType() + "- InitializeComponent");
            // CheckIn_Button.Visibility = Visibility.Hidden;
            eventTracker = new DAO.EventTrackerDAO();

            //
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += timer_Tick;
            timer.Start();
        }
        private void Next_button_Click(object sender, RoutedEventArgs e)
        {
            timer.Stop();
            Loger.WriteLog(this.GetType() + "-" + Next_button.Name + "Clicked");

            if (!string.IsNullOrEmpty(txtFirstName.Text) && !string.IsNullOrEmpty(txtLastName.Text) && !string.IsNullOrEmpty(txtEmailAddress.Text))
            {
                Loger.WriteLog(this.GetType() + "- The fields have data");

                //clean input data
                string firstName   = txtFirstName.Text.Trim();
                string lastName    = txtLastName.Text.Trim();
                string emailAddres = txtEmailAddress.Text.Trim();
                string phoneNumber = txtPhoneNumber.Text.Trim();
                string companyName = txtCompanyName.Text.Trim();

                DAO.EventTrackerDAO eventTracker = new DAO.EventTrackerDAO();
                if (eventTracker.RegisterAttendee(firstName, lastName, emailAddres, phoneNumber, companyName))
                {
                    Loger.WriteLog(this.GetType() + "- RegisterAttendee return true, navigate to the next page");
                    //move to next page
                    Uri uri = new Uri("Take_Photo.xaml", UriKind.Relative);
                    this.NavigationService.Navigate(uri);
                }
                else
                {
                    Loger.WriteLog(this.GetType() + "- RegisterAttendee return false, a message must be shown");
                    Helper.ShowPopUp("Error Registering Attendee!", "Registration Error!");
                }
            }
            else
            {
                Helper.ShowPopUp("Please fill the fields and continue!", "Empty Fields");
                Loger.WriteLog(this.GetType() + "- Empty fields");
            }
        }