Esempio n. 1
0
        public void onRecieveResult(Dictionary <String, Object> bundle)
        {
            Object senderName;
            Object senderValue;

            bundle.TryGetValue(PageDataExchange.KEY_SENDER_NAME, out senderName);
            bundle.TryGetValue(PageDataExchange.KEY_SENDER_VALUE, out senderValue);

            if (PATH.Equals(senderName))
            {
                this.lb_path.Content = senderValue.ToString();
            }
            else if (CODE.Equals(senderName))
            {
                if (senderValue == null)
                {
                    this.lb_code.Content = "";
                }
                else
                {
                    this.lb_code.Content = String.Format("报警器件代码   {0}", senderValue.ToString());
                }
            }
            else if (PageLogin.LOGIN.Equals(senderValue) || PageLogin.LOGOUT.Equals(senderValue))
            {
                User.Info usr = User.GetInstance().GetCurrentUserInfo();
                this.user.Text = usr.Account;
                this.role.Text = usr.Role;
            }
        }
Esempio n. 2
0
        //modify password
        private void onPasswordModifyClicked(object sender, RoutedEventArgs e)
        {
            String password0 = this.pb_modify_old.Password;
            String password1 = this.pb_modify_new1.Password;
            String password2 = this.pb_modify_new2.Password;
            int    roleIndex = this.register_role_list.SelectedIndex + 1;

            mState = ACTION_FAILED_MODYFY;

            User.Info info = User.GetInstance().GetCurrentUserInfo();

            if (info.IsLogin &&
                !String.IsNullOrEmpty(password0) &&
                !String.IsNullOrEmpty(password1) &&
                password1.Equals(password2) &&
                User.GetInstance().ChangePassword(info.Account, password0, password1))
            {
                mState = ACTION_SUCCESSED_MODYFY;
            }
            SwitchToPanel(mState);
        }
Esempio n. 3
0
 private void LoginState()
 {
     User.Info usr = User.GetInstance().GetCurrentUserInfo();
     this.user.Text = usr.Account;
     this.role.Text = usr.Role;
 }