Exemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string logName = this.txtLogName.Text.Trim();
            string pwd = this.txtPassword.Text.Trim();

            if (string.IsNullOrEmpty(logName))
            {
                MessageBox.Show(LJH.Attendance.UI.Properties.Resources.FrmLogin_InvalidUserName);
                return;
            }

            if (string.IsNullOrEmpty(pwd))
            {
                MessageBox.Show(LJH.Attendance.UI.Properties.Resources.FrmLogin_InvalidPwd);
                return;
            }
            SaveConnectString();

            OperatorBll authen = new OperatorBll(AppSettings.CurrentSetting.ConnectUri);
            if (authen.Authentication(logName, pwd))
            {
                this.DialogResult = DialogResult.OK;
                if (AppSettings.CurrentSetting.RememberLogID) SaveHistoryOperators();
                this.Close();
            }
            else
            {
                MessageBox.Show(LJH.Attendance.UI.Properties.Resources.FrmLogin_AuthenFail);
            }
        }