private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            List <Features> featurs = new List <Features>();

            featurs = checkedFeatures();
            SQLQuery mSqlQuery = new SQLQuery();

            if (roomID.SelectedIndex > -1 && featurs.Count > 0)
            {
                mSqlQuery.deleteChildFeature((int)GlobalVariables.globalChild.id);
                foreach (var item in featurs)
                {
                    mSqlQuery.insertChildFeature(((int)GlobalVariables.globalChild.id), FeatureToID[item.featureName]);
                }
                GlobalVariables.globalChild.roomID = Convert.ToInt32(getRoomID[int.Parse(roomID.Text.ToString())]);
                mSqlQuery.updateChildData(GlobalVariables.globalChild);
                MessageBox.Show("Data Updated Successflly", "Process Finshed", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (featurs.Count == 0)
            {
                MessageBox.Show("Please Enter atleast one feature", "Invaild Data", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBox.Show("Please Enter the Room number", "Invaild Data", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void editProfileButton_Click(object sender, RoutedEventArgs e)
        {
            SQLQuery mSQLQuery = new SQLQuery();


            if (childName.Text.Length >= 2 && DOBpicker.SelectedDate != null)
            {
                string gender;
                if (female.IsChecked == true)
                {
                    gender = "Female";
                }
                else
                {
                    gender = "Male";
                }


                mSQLQuery.deleteChildFeature((int)GlobalVariables.globalChild.id);
                GlobalVariables.globalChild.DOB       = DOBpicker.SelectedDate.Value;
                GlobalVariables.globalChild.firstName = childName.Text;
                GlobalVariables.globalChild.lastName  = GlobalVariables.globalParent.firstName;
                GlobalVariables.globalChild.gender    = gender;

                List <Features> featurs = new List <Features>();

                featurs = checkedFeatures();
                foreach (var item in featurs)
                {
                    mSQLQuery.insertChildFeature((int)GlobalVariables.globalChild.id, FeatureToID[item.featureName]);
                }
                mSQLQuery.updateChildData(GlobalVariables.globalChild);
                MessageBox.Show("Updated", "Updated successfully ", MessageBoxButton.OK, MessageBoxImage.None);
            }
            else if (childName.Text.Length < 2)
            {
                MessageBox.Show("Please Enter at least 2 letter", "Invaild Child Name", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBox.Show("Please enter the Date of Birth", "Missing DOB", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #3
0
        private void acceptButton_Click(object sender, RoutedEventArgs e)
        {
            //set pending to 0 ---> accepted
            SQLQuery mSQLQuery = new SQLQuery();

            if (idx == 0)
            {
                mChild.pending = 0;
                mSQLQuery.updateChildData(mChild);
            }
            else if (idx == 1)
            {
                mParent.pending = 0;
                mSQLQuery.updateParentData(mParent);
            }
            else if (idx == 2)
            {
                mStaff.pending = 0;
                mSQLQuery.updateStaffData(mStaff);
            }


            removeFromParent();
        }