Ejemplo n.º 1
0
        void initialize()

        {
            if (previousForm == 0 || previousForm == 1)
            {
                acceptButton.Visibility  = Visibility.Hidden;
                declineButton.Visibility = Visibility.Hidden;
            }

            if (idx == 0)
            {
                name.Content = child.ElementAt(cIdx).firstName + " " + child.ElementAt(cIdx).lastName;
                mChild       = child.ElementAt(cIdx);

                ImageOperation op = new ImageOperation();
                if (op.BinaryToImage(mChild.image) != null)
                {
                    profilePicture.ImageSource = op.BinaryToImage(mChild.image);
                }
            }
            else if (idx == 1)
            {
                name.Content = parent.ElementAt(pIdx).firstName + " " + parent.ElementAt(pIdx).lastName;
                mParent      = parent.ElementAt(pIdx);
            }
            else if (idx == 2)
            {
                name.Content = staff.ElementAt(sIdx).firstName + " " + staff.ElementAt(sIdx).lastName;
                mStaff       = staff.ElementAt(sIdx);
            }

            if (previousForm == 2)
            {
                acceptButton.Visibility  = Visibility.Visible;
                declineButton.Visibility = Visibility.Visible;
            }
        }
        public void fillProfile()
        {
            ImageOperation op = new ImageOperation();

            if (op.BinaryToImage(GlobalVariables.globalChild.image) != null)
            {
                profilePicture.ImageSource = op.BinaryToImage(GlobalVariables.globalChild.image);
            }

            childName.Text         = GlobalVariables.globalChild.firstName;
            DOBpicker.SelectedDate = GlobalVariables.globalChild.DOB;
            addFeaturesToList();
            if (GlobalVariables.globalChild.gender == "Male")
            {
                male.IsChecked = true;
            }
            else
            {
                female.IsChecked = true;
            }
            roomID.Text = Convert.ToString(GlobalVariables.globalChild.roomID);
            getCheckedFeatures();
            addFeaturesToList();
        }
Ejemplo n.º 3
0
        private void parentGrid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (previousForm == 0)
            {
                childWindow cw = new childWindow(pWindow);
                cw.dailyDetails.IsReadOnly      = true;
                GlobalVariables.globalChild     = mChild;
                cw.sendDailyDetails.Visibility  = Visibility.Hidden;
                cw.roomID.IsEnabled             = false;
                cw.editProfileButton.Visibility = Visibility.Visible;
                cw.showDailyDetails.Visibility  = Visibility.Visible;
                cw.fillProfile();
                cw.ShowDialog();
            }
            else if (previousForm == 1)
            {
                childWindow cw = new childWindow(pWindow);
                cw.roomID.IsReadOnly            = true;
                cw.childName.IsReadOnly         = true;
                cw.DOBpicker.IsEnabled          = false;
                cw.editProfileButton.Visibility = Visibility.Hidden;
                cw.female.IsEnabled             = false;
                cw.male.IsEnabled = false;
                cw.showDailyDetails.Visibility = Visibility.Hidden;
                GlobalVariables.globalChild    = mChild;
                cw.fillProfile();
                cw.ShowDialog();
            }
            else if (previousForm == 2)
            {
                //from pending
                //disable all texts and buttons

                if (idx == 0) // Holding child
                {
                    GlobalVariables.globalChild = mChild;
                    childSignUp window = new childSignUp();
                    window.signUpButton.Visibility     = Visibility.Hidden;
                    window.childFeaturesList.IsEnabled = false;
                    window.roomID.Visibility           = Visibility.Visible;
                    //fill child data here
                    ImageOperation op = new ImageOperation();
                    if (op.BinaryToImage(GlobalVariables.globalChild.image) != null)
                    {
                        window.profileImage.ImageSource = op.BinaryToImage(GlobalVariables.globalChild.image);
                    }

                    window.fillCdata();
                    window.disabledChild_info();

                    window.ShowDialog();
                }
                else if (idx == 1) // Holding Parent
                {
                    GlobalVariables.globalParent = mParent;
                    parentSignUp window = new parentSignUp();
                    //fill parent data here
                    window.fillPdata1();
                    window.OKButton.Visibility = Visibility.Hidden;
                    window.disabledParent_info1();

                    //fill parent data here

                    window.ShowDialog();
                }
                else if (idx == 2) //Holding Staff
                {
                    GlobalVariables.globalStaff = mStaff;
                    staffSignUp window = new staffSignUp();
                    window.signUpButton.Visibility = Visibility.Hidden;
                    //fill staff data here
                    window.fillSdata();
                    window.disabledStaff();
                    window.salary.Visibility   = Visibility.Visible;
                    window.roomID.Visibility   = Visibility.Visible;
                    window.OKButton.Visibility = Visibility.Visible;
                    //fill staff data here

                    window.ShowDialog();
                }
            }
            else if (previousForm == 3)
            {
                //from editDatabase

                if (idx == 0) // Holding child
                {
                    GlobalVariables.globalChild = mChild;
                    childSignUp window = new childSignUp();
                    window.signUpButton.Visibility = Visibility.Hidden;
                    window.OKButton.Visibility     = Visibility.Visible;
                    window.roomID.Visibility       = Visibility.Visible;
                    ImageOperation op = new ImageOperation();
                    if (op.BinaryToImage(GlobalVariables.globalChild.image) != null)
                    {
                        window.profileImage.ImageSource = op.BinaryToImage(GlobalVariables.globalChild.image);
                    }
                    //fill child data here
                    window.fillCdata();

                    window.ShowDialog();
                }
                else if (idx == 1) // Holding Parent
                {
                    GlobalVariables.globalParent = mParent;
                    parentSignUp window = new parentSignUp();

                    //fill parent data here
                    window.fillPdata1();
                    window.ID.IsEnabled       = false;
                    window.username.IsEnabled = false;

                    //fill parent data here

                    window.ShowDialog();
                }
                else if (idx == 2) //Holding Staff
                {
                    GlobalVariables.globalStaff = mStaff;
                    staffSignUp window = new staffSignUp();
                    window.signUpButton.Visibility = Visibility.Hidden;
                    window.ID.IsEnabled            = false;
                    window.OKButton.Visibility     = Visibility.Visible;

                    window.username.IsEnabled = false;

                    window.ID.IsEnabled = false;

                    window.salary.Visibility   = Visibility.Visible;
                    window.roomID.Visibility   = Visibility.Visible;
                    window.OKButton.Visibility = Visibility.Visible;
                    //fill staff data here
                    window.fillSdata();
                    //fill staff data here

                    window.ShowDialog();
                }
            }
        }