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);
            }
        }
Exemple #2
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Loger.WriteLog(this.GetType() + "-" + Load_Button.Name + " Clicked");

            if (!string.IsNullOrEmpty(txtGetUID.Text))
            {
                uid = txtGetUID.Text.Trim();

                attendees = eventTracker.GetAttendeeUID_Details(uid);


                if (attendees != null)
                {
                    int id = attendees.ID;
                    CheckIn_Button.Visibility = Visibility.Visible;
                    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
                    try {
                        if (picture.PICTURE != null)
                        {
                            Bitmap b = Helper.byteArrayToImage(picture.PICTURE);
                            //load the image
                            imgPicture.Source = Helper.LoadBitmap(b);
                        }
                        else
                        {
                        }
                    }
                    catch (Exception ex) { Loger.WriteLog(this.GetType() + "-Exception:" + ex.Message + Environment.NewLine + "StackTrace:" + ex.StackTrace); }
                    txtNameCombined.Text = attendees.LAST_NAME + " " + attendees.FISRT_NAME;
                }
                else
                {
                    Helper.ShowPopUp("No records found for " + txtGetUID.Text, "No Record!");
                    Loger.WriteLog(this.GetType() + "- No Record found for " + txtGetUID.Text);
                }
            }
            else
            {
                Helper.ShowPopUp("Please enter Card number before you check!", "No Card Number");

                Loger.WriteLog(this.GetType() + "- Please enter Card number before you check!");
            }
        }