示例#1
0
        public bool EventClear98(string putData)  //98级密码事件清零
        {
            string sData = "";

            sData += Transfer.ReverseString(Psw.Substring(0, 6) + "98");
            sData += Transfer.ReverseString(OprCode);
            sData += Transfer.ReverseString(putData);

            string sendFrm = AssembleFrm("1B", (04 + 04 + putData.Length / 2).ToString("X2"), sData);
            string ret     = SendAndRec(sendFrm);

            if (ret != null && ret.Length > 0)
            {
                if (_retFrm.hexCtrolNum == 0x9b)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
示例#2
0
 /// <summary>
 /// 去除首位空格
 /// </summary>
 public void Trim()
 {
     Psw        = Psw.Trim();
     PswConfirm = PswConfirm.Trim();
     UserName   = UserName.Trim();
     Nick       = Nick.Trim();
 }
示例#3
0
        public bool MeterClr(string putData /*, out string result*/)
        {
            string sData = "";

            sData += Transfer.ReverseString(Psw.Substring(0, 6) + "98");
            sData += Transfer.ReverseString(OprCode);
            sData += Transfer.ReverseString(putData);

            string sendFrm = AssembleFrm("1A", (04 + 04 + putData.Length / 2).ToString("X2"), sData);

            string ret = SendAndRec(sendFrm);

            if (ret != null && ret.Length > 0)
            {
                if (_retFrm.hexCtrolNum == 0x9a)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
        public AuthenticationView()
        {
            InitializeComponent();
            DataContextChanged += delegate
            {
                var cr = DataContext as AuthenticationViewModel;
                if (cr != null)
                {
                    cr.CloseRequest += (s, e) =>
                    {
                        Hide();
                        Close();
                    };
                    cr.DataError += (s, e) => Psw.Focus();

                    if (!string.IsNullOrEmpty(cr.Login))
                    {
                        Psw.BackgroundFocus();
                    }
                }
            };
#if DEBUG
            Topmost = false;
#endif
            Loaded += OnLoaded;
        }