private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtPersonName.Text))
            {
                MessageBox.Show("Please Enter A Person's Name for the Guest Entry");
                return;
            }
            ;
            if (string.IsNullOrEmpty(txtAddress.Text))
            {
                MessageBox.Show("Please Enter A Address for the Guest Entry");
                return;
            }
            ;


            Gender gender = (Gender)Enum.Parse(typeof(Gender), cboGender.SelectedItem.ToString(), true);


            int age;

            if (!int.TryParse(txtAge.Text, out age))
            {
                MessageBox.Show("Please enter only numbers.");
                return;
            }

            log.PersonName = txtPersonName.Text;
            log.Address    = txtAddress.Text;
            log.Gender     = gender;
            log.Age        = age;

            var op = GuestBLL.Update(log);

            if (op.Code.ToLower() == "ok")
            {
                listWindow.ShowData();
                MessageBox.Show(op.Message.FirstOrDefault());
                this.Close();
            }
            else
            {
                MessageBox.Show(op.Message.FirstOrDefault());
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtPersonName.Text))
            {
                MessageBox.Show("Please Enter A Person's Name for the Guest Entry");
                return;
            }
            ;
            if (string.IsNullOrEmpty(txtAddress.Text))
            {
                MessageBox.Show("Please Enter A Address for the Guest Entry");
                return;
            }
            ;

            if (cboGender.SelectedIndex == 0)
            {
                MessageBox.Show("Please select a Gender for Guest Entry");
                return;
            }

            Gender gender = (Gender)Enum.Parse(typeof(Gender), cboGender.SelectedItem.ToString(), true);

            int age;

            if (!int.TryParse(txtAge.Text, out age))
            {
                MessageBox.Show("Please enter only numbers for age.");
                return;
            }

            decimal temp;

            if (!decimal.TryParse(txtTemperature.Text, out temp))
            {
                MessageBox.Show("Please enter valid decimal for temperature.");
                return;
            }

            //Guest log = new Guest();
            //log.PersonName = txtPersonName.Text;
            //log.Address = txtAddress.Text;
            //log.Gender = gender;
            //log.Age = age;
            //log.Id = Guid.NewGuid();

            var op = GuestBLL.Login(new GuestLoginViewModel()
            {
                Temperature = temp,
                PersonName  = txtPersonName.Text,
                Address     = txtAddress.Text,
                Age         = age,
                Gender      = gender,
            });

            if (op.Code.ToLower() == "ok")
            {
                listWindow.ShowData();
                MessageBox.Show(op.Message.FirstOrDefault());
                this.Close();
            }
            else
            {
                MessageBox.Show(op.Message.FirstOrDefault());
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtPersonName.Text))
            {
                MessageBox.Show("Please Enter A Person's Name for the Guest Entry");
                return;
            }
            ;
            if (string.IsNullOrEmpty(txtAddress.Text))
            {
                MessageBox.Show("Please Enter A Address for the Guest Entry");
                return;
            }
            ;
            Gender gender = Gender.Male;

            if (cboGender.SelectedIndex == 0)
            {
                MessageBox.Show("Please select a Gender for Guest Entry");
                return;
            }

            if (cboGender.SelectedIndex == 1)
            {
                gender = Gender.Male;
            }
            ;

            if (cboGender.SelectedIndex == 2)
            {
                gender = Gender.Female;
            }
            ;

            if (System.Text.RegularExpressions.Regex.IsMatch(txtAge.Text, "[^0-9]"))
            {
                MessageBox.Show("Please enter only numbers.");
                txtAge.Text = txtAge.Text.Remove(txtAge.Text.Length - 1);
                return;
            }

            int age;

            if (!int.TryParse(txtAge.Text, out age))
            {
                MessageBox.Show("Please enter only numbers.");
                return;
            }

            Guest guest = new Guest();

            guest.PersonName = txtPersonName.Text;
            guest.Address    = txtAddress.Text;
            guest.Gender     = gender;
            guest.Age        = age;//Convert.ToInt32(txtAge.Text);
            guest.Id         = Guid.NewGuid();
            var op = GuestBLL.Create(guest);

            if (op.Code.ToLower() == "ok")
            {
                listWindow.ShowData();
                MessageBox.Show(op.Message.FirstOrDefault());
                this.Close();
            }
            else
            {
                MessageBox.Show(op.Message.FirstOrDefault());
            }
        }