コード例 #1
0
        //Ger åtkomst till användarens konto via huvudmenyn.
        private void Account_Click(object sender, RoutedEventArgs e)
        {
            var next_window = new UserInfo();

            next_window.Show();
            Close();
        }
コード例 #2
0
        //Lägger till ny Password
        private void NewPasswordButton(object sender, RoutedEventArgs e)
        {
            if (NewPasswordBox.Password.Length == 0)
            {
                MessageBox.Show("You have not put in all information.", "Missing input", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (OldPasswordBox.Password != State.User.Password)
            {
                MessageBox.Show("Wrong Password, please type in the correct Password.", "Wrong Password", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (State.User.Password == NewPasswordBox.Password)
            {
                MessageBox.Show("You're already using this Password, please type in a new one.", "Old Password", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            else if (OldPasswordBox.Password == State.User.Password)
            {
                State.User.Password = NewPasswordBox.Password;
                API.ctx.Customers.Update(State.User);
                API.ctx.SaveChanges();
                MessageBox.Show("You got a new Password!", "New Password successful", MessageBoxButton.OK, MessageBoxImage.Information);
                var UserInfoPage = new UserInfo();
                UserInfoPage.Show();
                this.Close();
            }
        }
コード例 #3
0
ファイル: FrmMainFromNew.cs プロジェクト: rehman922/VIRETAIL
        private void barButtonItem36_ItemClick(object sender, ItemClickEventArgs e)
        {
            opentab = 3;

            UserInfo frm = null;
            if ((frm = (UserInfo)IsFormAlreadyOpen(typeof(UserInfo))) == null)
            {
                frm = new UserInfo();
                frm.MdiParent = this;
                frm.Show();
            }
            else
            {
                frm.Select();
            }
         }