示例#1
0
 private void HeaderMouseDown(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         PwdReset.ReleaseCapture();
         PwdReset.SendMessage(base.Handle, 161, 2, 0);
     }
 }
示例#2
0
 private void AppLogin()
 {
     try
     {
         this.lbl_loginMsg.Text = LangCtrl.GetString("lbl_loginMsg", "Authenticating login...");
         this.lbl_loginMsg.Refresh();
         this.TryCount++;
         if (this.TryCount >= this.MaxTrys)
         {
             Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.LOGON_COUNT, this.vTextBox_0.Text, Guid.Empty);
             Process.GetCurrentProcess().Kill();
             base.DialogResult = DialogResult.Cancel;
             base.Close();
         }
         else
         {
             this.Cursor = Cursors.WaitCursor;
             using (RPM_Account rPMAccount = new RPM_Account())
             {
                 Account account = rPMAccount.Authenticate(vTextBox_0.Text, CryptoIO.MD5Encrypt(this.txtPwd.Text));
                 if (account == null)
                 {
                     Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.LOGON_FAILED, this.vTextBox_0.Text, Guid.Empty);
                 }
                 else
                 {
                     Global.LoginIDName   = (this.vTextBox_0.Text);
                     Global.GlobalAccount = account;
                     Global.RightsProfile = account.ApplicationRights;
                     this.Cursor          = Cursors.Default;
                     base.DialogResult    = DialogResult.OK;
                     if (account.IsPwdReset.Value)
                     {
                         PwdReset pwdReset = new PwdReset()
                         {
                             AccountID = account.Id
                         };
                         if (pwdReset.ShowDialog(this) == DialogResult.Cancel)
                         {
                             Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.PASSWORD, string.Concat("Password reset canceled: ", this.vTextBox_0.Text), account.Id);
                             base.DialogResult = DialogResult.Cancel;
                             base.Close();
                         }
                         Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.PASSWORD, string.Concat("Password reset: ", this.vTextBox_0.Text), account.Id);
                     }
                     base.DialogResult = DialogResult.OK;
                     base.Close();
                 }
             }
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception exception)
     {
     }
     if (!Global.LockLogin)
     {
         this.vTextBox_0.Text = string.Empty;
     }
     this.lbl_loginMsg.Text = string.Empty;
     this.txtPwd.Text       = string.Empty;
     this.vTextBox_0.Select();
     this.Cursor = Cursors.Default;
 }