private void loginBtn_Click(object sender, RoutedEventArgs e)
        {
            if (accList.SelectedItem == null)
            {
                MessageBox.Show("Vyberte účet!");
            }
            else
            {
                User tmp = accList.SelectedItem as User;
                PasswordWindow wnd = new PasswordWindow(tmp, "Zadejte heslo");
                wnd.ShowDialog();

                if (wnd.success)
                {
                    wnd.Close();
                    Users.ActiveUser = tmp;
                    mwnd.MainGrid.Children.Clear();
                    mwnd.MainGrid.Children.Add(new ProfileUserControl());
                }
                else
                {
                    wnd.Close();
                }
            }
        }
 private void adminBtn_Click(object sender, RoutedEventArgs e)
 {
     PasswordWindow wnd = new PasswordWindow(Users.Admin, "Zadejte heslo");
     wnd.ShowDialog();
     if (wnd.success)
     {
         wnd.Close();
         mwnd.MainGrid.Children.Clear();
         Users.ActiveUser = Users.Admin;
         mwnd.MainGrid.Children.Add(new AdminUserControl());
     }
     else
     {
         wnd.Close();
     }
 }
示例#3
0
        private void adminBtn_Click(object sender, RoutedEventArgs e)
        {
            PasswordWindow wnd = new PasswordWindow(Users.Admin, "Zadejte heslo");

            wnd.ShowDialog();
            if (wnd.success)
            {
                wnd.Close();
                mwnd.MainGrid.Children.Clear();
                Users.ActiveUser = Users.Admin;
                mwnd.MainGrid.Children.Add(new AdminUserControl());
            }
            else
            {
                wnd.Close();
            }
        }
示例#4
0
        private void editBtn_Click(object sender, RoutedEventArgs e)
        {
            bool           change = false;
            PasswordWindow wnd    = new PasswordWindow(Users.ActiveUser, "Zadejte aktuální heslo");

            wnd.ShowDialog();
            if (wnd.success)
            {
                wnd.Close();

                if (!(string.IsNullOrWhiteSpace(newpasswdBox.Password) && string.IsNullOrWhiteSpace(new2passwdBox.Password)))
                {
                    if (newpasswdBox.Password == new2passwdBox.Password)
                    {
                        Users.ActiveUser.Passwd = newpasswdBox.Password;
                        change = true;
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("Hesla se neshodují!");
                    }
                }
            }
            else
            {
                wnd.Close();
            }
            newpasswdBox.Password  = "";
            new2passwdBox.Password = "";

            if (change)
            {
                System.Windows.MessageBox.Show("Heslo bylo změněno");
                mwnd.MainGrid.Children.Clear();
                if (Users.ActiveUser.Login == "admin")
                {
                    mwnd.MainGrid.Children.Add(new AdminUserControl());
                }
                else
                {
                    mwnd.MainGrid.Children.Add(new ProfileUserControl());
                }
            }
        }
        private void editBtn_Click(object sender, RoutedEventArgs e)
        {
            bool change = false;
            PasswordWindow wnd = new PasswordWindow(Users.ActiveUser, "Zadejte aktuální heslo");
            wnd.ShowDialog();
            if (wnd.success)
            {
                wnd.Close();

                if (!(string.IsNullOrWhiteSpace(newpasswdBox.Password) && string.IsNullOrWhiteSpace(new2passwdBox.Password)))
                {
                    if (newpasswdBox.Password == new2passwdBox.Password)
                    {
                        Users.ActiveUser.Passwd = newpasswdBox.Password;
                        change = true;
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("Hesla se neshodují!");
                    }
                }
            }
            else
            {
                wnd.Close();
            }
            newpasswdBox.Password = "";
            new2passwdBox.Password = "";

            if (change)
            {
                System.Windows.MessageBox.Show("Heslo bylo změněno");
                mwnd.MainGrid.Children.Clear();
                if(Users.ActiveUser.Login == "admin")
                {
                    mwnd.MainGrid.Children.Add(new AdminUserControl());
                }
                else
                {
                    mwnd.MainGrid.Children.Add(new ProfileUserControl());
                }
            }
        }