Beispiel #1
0
        /***********************************************************************/
        // ADMIN
        /***********************************************************************/
        #region Admin

        /***********************************************************/
        // "Admin controls click
        /***********************************************************/
        private void btnAdminControls_click(object sender, RoutedEventArgs e)
        {
            AdminControlWindow adminControlWindow = new AdminControlWindow();

            adminControlWindow.ShowDialog();

            //AdminWindow adminWindow = new AdminWindow();
            //adminWindow.ShowDialog();
        }
Beispiel #2
0
        public CreateUserWindow(AdminControlWindow adminControlWindow, User user, bool resetPassword)
        {
            InitializeComponent();

            this.adminControlWindow = adminControlWindow;
            this.user          = user;
            this.resetPassword = resetPassword;

            string[] admin = new string[] { "True", "False" };
            cbbAdmin.SelectedIndex = 1;
            cbbAdmin.ItemsSource   = admin;

            if (user != null)
            {
                tbFirstName.Text      = user.FirstName;
                tbLastname.Text       = user.LastName;
                tbPassword.Visibility = Visibility.Hidden;

                if (user.Admin)
                {
                    cbbAdmin.SelectedIndex = 0;
                }
                else
                {
                    cbbAdmin.SelectedIndex = 1;
                }

                rowPassword.Height = new GridLength(0, GridUnitType.Pixel);
                this.Height        = 180;

                btnCreate.Content = "Update user";
            }

            if (resetPassword)
            {
                tbFirstName.IsEnabled = false;
                tbLastname.IsEnabled  = false;
                cbbAdmin.IsEnabled    = false;

                tbPassword.Visibility = Visibility.Visible;
                tbPassword.Text       = "";

                rowPassword.Height = new GridLength(30, GridUnitType.Pixel);
                this.Height        = 210;
                btnCreate.Content  = "Reset password";
            }
        }
Beispiel #3
0
        public CreateCustomerWindow(AdminControlWindow adminControlWindow)
        {
            InitializeComponent();

            this.adminControlWindow = adminControlWindow;
        }